N = int(input()) G = [[] for i in range(N)] D = [0] * N S = set() for i in range(N): u, v = map(int, input().split()) u, v = u - 1, v - 1 G[u].append((v, i, 0)) G[v].append((u, i, 1)) D[u] += 1 D[v] += 1 stack = [] for i in range(N): if D[i] == 1: stack.append(i) ans = [-1] * N while stack: u = stack.pop() for v, i, a in G[u]: if (u, v) in S: continue ans[i] = a D[v] -= 1 if D[v] == 1: stack.append(v) S.add((u, v)) S.add((v, u)) s = -1 for i in range(N): if ans[i] == -1: s = i break stack = [s] while stack: u = stack.pop() for v, i, a in G[u]: if (u, v) in S: continue S.add((u, v)) S.add((v, u)) ans[i] = a stack.append(v) break for i in range(N): print("<-") if ans[i] else print("->")