//入力確認用 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; template istream& operator >> (istream& is, vector& vec){for(T& val: vec) is >> val; return is;} template istream& operator , (istream& is, T& val){ return is >> val;} template ostream& operator << (ostream& os, const vector& vec){for(int i=0; i ostream& operator , (ostream& os, const T& val){ return os << " " << val;} template ostream& operator >> (ostream& os, const T& val){ return os << " " << val;} class UnionFindTree{ struct base_node{ int parent; int rank; int size; }; vector node; public: UnionFindTree(int n){ node.resize(n); for(int i=0; i node[y].rank){ node[y].parent = x; node[x].size += node[y].size; }else{ node[x].rank++; unite(x,y); } } }; int main_(){ int n; cin >> n; assert(2<=n && n<=100000); vector a(n); for(int i=0; i> a[i]; assert(1<=a[i] && a[i]<=100000); } UnionFindTree uft(n); for(int i=0; i> u,v; //scanf("%d%d", &u,&v); assert(1<=u && u<=n); assert(1<=v && v<=n); assert(u!=v); u--,v--; uft.unite(u,v); } int q; cin >> q; assert(1<=q && q<=100000); while(q--){ int u,v; cin >> u,v; //scanf("%d%d", &u,&v); assert(1<=u && u<=n); assert(1<=v && v<=n); assert(u!=v); cout << "UNKO" << endl; } return 0; } int main(){ //auto s = clock(); main_(); //cerr << clock()-s << " [ms] " << endl; return 0; }