def decodeLab(lab):
    """
    Transform a dict of the form
    {
     nlines:   2,
     ncolumns: 2,
     (0,0): [(0,1)], (0,1): [(0,0), (1,1)],
     (1,0): [(1,1)], (1,1): [(1,0), (0,1)]
    }
    
    Into a nested list of the form
    [
        ["g", "db"],
        ["g", "dh"]
    ]
    
    """
    tab = [["" for j in range(lab["ncolumns"])] for i in range(lab["nlines"])]
    for i in range(len(tab)):
        for j in range(len(tab[i])):
            if (i-1, j) in lab[(i, j)]:
                tab[i][j] += 'h'
            if (i, j+1) in lab[(i, j)]:
                tab[i][j] += 'd'
            if (i+1, j) in lab[(i, j)]:
                tab[i][j] += 'b'
            if (i, j-1) in lab[(i, j)]:
                tab[i][j] += 'g'
    return tab