def span(cells):
    """Produces information regarding the layout of a group of cells.
    
    For each cell in cells, record the location (row and column) of the cell.
    
    Also record a row or column common to two or more cells.
    
    Args:
        cells (list): a list of type Cell.
        
    Returns:
        (tuple): the rows and columns containing one of the cells,
                 and the row and/or column shared by several cells.
    """
    rows = []
    cols = []
    
    shared_r = -1
    shared_c = -1
    for cell in cells:
        if cell.r in rows:
            shared_r = cell.r
        else:
            rows.append(cell.r)
            
        if cell.c in cols:
            shared_c = cell.c
        else:
            cols.append(cell.c)          

    return rows, cols, shared_r, shared_c