ll@n,@m,@s,@g;VI@f(2m),t(2n);ll@u;rep(u)t[rd_ll()]=1;unionFind a('w',2n,1);rep[f,i](x,2m)i&t[x]