import sys from collections import deque, Counter input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) inf = 2 ** 63 - 1 mod = 998244353 from typing import List, Tuple class BipartiteMatching: '''二部マッチング問題のソルバー。 https://snuke.hatenablog.com/entry/2019/05/07/013609 のコードをPythonにベタ移植したもの。 snuke is God. ''' def __init__(self, n: int, m: int) -> None: self._n = n self._m = m self._to: List[List[int]] = [[] for _ in range(n)] def add_edge(self, a: int, b: int) -> None: self._to[a].append(b) def solve(self) -> List[Tuple[int, int]]: n, m, to = self._n, self._m, self._to pre = [-1] * n root = [-1] * n p = [-1] * n q = [-1] * m upd = True while upd: upd = False s = [] s_front = 0 for i in range(n): if p[i] == -1: root[i] = i s.append(i) while s_front < len(s): v = s[s_front] s_front += 1 if p[root[v]] != -1: continue for u in to[v]: if q[u] == -1: while u != -1: q[u] = v p[v], u = u, p[v] v = pre[v] upd = True break u = q[u] if pre[u] != -1: continue pre[u] = v root[u] = root[v] s.append(u) if upd: for i in range(n): pre[i] = -1 root[i] = -1 return [(v, p[v]) for v in range(n) if p[v] != -1] n = ii() G = BipartiteMatching(n, n) e = [] for i in range(n): u, v = mi() e.append(u - 1) G.add_edge(u - 1, i) G.add_edge(v - 1, i) E = G.solve() for i in range(n): if E[i][1] == e[i]: print('->') else: print('<-')