#include #include using namespace std; using namespace atcoder; typedef modint998244353 mint; typedef long long ll; int main(){ int n; cin >> n; vector>> ikeru; ikeru.resize(n); vector deg(n); vector x(n), y(n); for (int i=0; i> a >> b; a--; b--; deg[a]++; deg[b]++; x[i] = a; y[i] = b; ikeru[a].push_back(pair(b,i)); ikeru[b].push_back(pair(a,i)); } vector mada; vector isnamori(n, true); vector comefrom(n,-1); vector kousha(n,-1); for (int i=0; i tansaku(n); for (int i=0; i arr; while(!mada.empty()){ int i = mada.back(); mada.pop_back(); if (tansaku[i]) continue; arr.push_back(i); tansaku[i] = true; for (auto [j,c]: ikeru[i]){ if (!tansaku[j]){ mada.push_back(j); } } } int m = arr.size(); arr.push_back(arr[0]); for (int i=0; i" << endl; }else{ cout << "<-" << endl; } }else if (isnamori[x[i]] && !isnamori[y[i]]){ cout << "<-" << endl; }else if (!isnamori[x[i]] && isnamori[y[i]]){ cout << "->" << endl; }else{ if (kousha[i] == y[i]){ cout << "->" << endl; }else{ cout << "<-" << endl; } } } }