import sys input = sys.stdin.readline N=int(input()) EDGE=[list(map(int,input().split())) for i in range(N)] E=[[] for i in range(N+1)] DEG=[0]*(N+1) for i in range(N): a,b=EDGE[i] E[a].append((b,0,i)) E[b].append((a,1,i)) DEG[a]+=1 DEG[b]+=1 ANS=[""]*N Q=[] for i in range(1,N+1): if DEG[i]==1: Q.append(i) while Q: x=Q.pop() for to ,com, ind in E[x]: DEG[to]-=1 if com==0: ANS[ind]="->" else: ANS[ind]="<-" if DEG[to]==1: Q.append(to) USE=[0]*(N+1) for i in range(1,N+1): if DEG[i]==2: now=i else: USE[i]=1 initial = now while USE[now]==0: #print("!",now) USE[now]=1 for to ,com, ind in E[now]: if USE[to]==0 or to==initial: if com==0: ANS[ind]="->" else: ANS[ind]="<-" now=to break for ans in ANS: print(ans)