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)

USE=[0]*(N+1)

while Q:
    x=Q.pop()
    USE[x]=1

    for to ,com, ind in E[x]:
        if USE[to]==1:
            continue
        DEG[to]-=1
        
        if com==0:
            ANS[ind]="->"
        else:
            ANS[ind]="<-"

        if DEG[to]==1:
            Q.append(to)

#print(ANS)

USE=[0]*(N+1)

for i in range(1,N+1):
    if DEG[i]==2:
        now=i
    else:
        USE[i]=1

initial = now

LIST=[]

while USE[now]==0:
    USE[now]=1
    LIST.append(now)
    for to ,com, ind in E[now]:
        if USE[to]==0:
            now=to
            break

for i in range(len(LIST)):
    for to ,com, ind in E[LIST[i]]:
        if to==LIST[i-1]:
            if com==0:
                ANS[ind]="->"
            else:
                ANS[ind]="<-"
            break

            

for ans in ANS:
    print(ans)