n=int(input()) e=[[] for i in range(n)] d={} for i in range(n): a,b=map(int,input().split()) a-=1 b-=1 e[a]+=[b] e[b]+=[a] d[(a,b)]=i v=[0]*n g=[0]*n v[0]=1 q=[0] o=[] while len(q)>0: s=q[-1] while g[s]"]*n for i in range(len(o)): s=o[i-1] t=o[i] if s>t: ans[d[(t,s)]]="<-" v=[0]*n q=[] for s in o: v[s]=1 q+=[s] for s in q: for t in e[s]: if v[t]==0: if s