for key in G:

    start = key

    pile = deque()

    pile.append((start, []))



    while pile:

        (S, path) = pile.pop()

        list_nodes = [n for n in G[S] if n not in path]

        for i in list_nodes:

            if i == start:

                print([start] + path + [i])

            else:

                pile.append((i, path + [i]))