tmp=list(map(int,input().split())) n,head,deleting=tmp[0],tmp[1],tmp[-1] cur,pre,l=[],[],[head] for i in range(2,len(tmp)-1,2): cur.append(tmp[i]) for i in range(3,len(tmp)-1,2): pre.append(tmp[i]) for i in range(len(pre)): l.insert(l.index(pre[i])+1,cur[i]) l.pop(l.index(deleting)) fo...