from collections import deque G = { 'A' : ['B','D','E'] , 'B' : ['A','C'] ,