def hanoi(nb_disks,start, middle, end):
    l=[]
    hanoi_rec(l,nb_disks,start, middle, end)
    return l

def hanoi_rec(l,nb_disks, start, middle, end):
    if nb_disks == 1:
        return l.append([start,end])
    else:
        hanoi_rec(l,nb_disks - 1, start, end, middle)
        l.append([start,end])
        hanoi_rec(l,nb_disks - 1, middle, start, end)
        
print(hanoi(4,"A","B","C"))

