head=1 link=[['C',3],['A',5],['F',6],['A',4],['E',2],['B',0],['C',-1]] d=input() p=head flag=False while p!=-1: if d==link[p][0]: if p==head: link.append(["AA",__________]) head=len(link)-1 else: link.append(["AA",__________]) link[q][1]=len(link)-1 __________ __________ __________ if not flag: link.append(["AA",-1]) __________ p=head while p!=-1: if link[p][1]!=-1: print(link[p][0],end="->") else: print(link[p][0]) p=link[p][1]