#include using namespace std; struct UnionFind { vector _parent, _size; UnionFind(int n) { _parent.resize(n); _size.resize(n, 1); for(int i=0; i>n>>m; UnionFind uf(n*2); vector> g1,g2; for(int i=0; i>a>>b; a--; b--; uf.unite(a,b+n); uf.unite(a+n,b); } bool ok=true; for(int i=0; i