n = int(input()) deg = [0] * n edges = [[] for _ in range(n)] E = {} for i in range(n): u, v = map(int, input().split()) u -= 1 v -= 1 E[(u, v)] = i edges[u].append(v) edges[v].append(u) deg[u] += 1 deg[v] += 1 ans = [""] * n st = [] for i in range(n): if deg[i] == 1: st.append(i) while st: pos = st.pop() for npos in edges[pos]: if deg[npos] == 0: continue if (pos, npos) in E: ans[E[(pos, npos)]] = "->" else: ans[E[(npos, pos)]] = "<-" deg[pos] -= 1 deg[npos] -= 1 if deg[npos] == 1: st.append(npos) u = -1 for i in range(n): if deg[i] > 0: u = i deg[i] -= 1 break cycle = [u] while 1: for v in edges[u]: if deg[v] > 0: cycle.append(v) deg[u] -= 1 deg[v] -= 1 u = v break else: break for i in range(len(cycle)): pos = cycle[i] npos = cycle[(i + 1) % len(cycle)] if (pos, npos) in E: ans[E[(pos, npos)]] = "->" else: ans[E[(npos, pos)]] = "<-" print(*ans, sep="\n")