import sys sys.setrecursionlimit(5*10**5) input = sys.stdin.readline from collections import defaultdict, deque, Counter from heapq import heappop, heappush from bisect import bisect_left, bisect_right from math import gcd import pypyjit pypyjit.set_param('max_unroll_recursion=-1') n = int(input()) graph = [[] for i in range(n+1)] deg = [0]*(n+1) e = [] for i in range(n): a,b = map(int,input().split()) graph[a].append(b) graph[b].append(a) deg[a] += 1 deg[b] += 1 e.append((a,b)) que = [] use = set() ans = [] for i in range(1,n+1): if deg[i] == 1: que.append(i) while que: crr = que.pop() use.add(crr) for nxt in graph[crr]: if nxt in use: continue ans.append([crr, nxt]) deg[nxt] -= 1 if deg[nxt] == 1: que.append(nxt) v = [0]*(n+1) for i in range(1,n+1): if i in use: v[i] = 1 ord = [] def dfs(crr): v[crr] = 1 ord.append(crr) for nxt in graph[crr]: if v[nxt]: continue dfs(nxt) for i in range(1,n+1): if i not in use: dfs(i) break for i in range(len(ord)): ans.append([ord[i], ord[i-1]]) ans = set([(a,b) for a,b in ans ]) for a,b in e: if (a,b) in ans: print("->") else: print("<-")