from collections import deque N = int(input()) edge_cnt = [0]*N edge_L = [[] for i in range(N)] orig_edge_L = [] for i in range(N): a, b = map(int, input().split()) a -= 1 b -= 1 edge_L[a].append(b) edge_L[b].append(a) edge_cnt[a] += 1 edge_cnt[b] += 1 orig_edge_L.append([a, b]) que = deque() for i in range(N): if edge_cnt[i] == 1: que.append(i) used_flg = [False]*N confirm_edge_s = set() while que: now_pos = que.popleft() used_flg[now_pos] = True for next_pos in edge_L[now_pos]: if used_flg[next_pos]: continue confirm_edge_s.add((now_pos, next_pos)) edge_cnt[next_pos] -= 1 if edge_cnt[next_pos] == 1: que.append(next_pos) for i in range(N): if used_flg[i] == False: start_pos = i que.append(i) break while que: now_pos = que.popleft() used_flg[now_pos] = True for next_pos in edge_L[now_pos]: if used_flg[next_pos]: continue que.append(next_pos) confirm_edge_s.add((now_pos,next_pos)) break confirm_edge_s.add((now_pos,start_pos)) for a,b in orig_edge_L: if (a,b) in confirm_edge_s: print('->') else: print('<-')