#include #include #include #include #include using namespace std; //ifstream f("a.in"); //#define cin f #define rrrr 500000 char s[rrrr]; int p[rrrr]; pair ad[rrrr]; int t,n,i,x,y,a,q[rrrr],l; bool viz[rrrr]; vector v[rrrr]; //#define maxb 16384 //char buf[maxb]; //int ppp(maxb); /*int gi() { int nr=0; while (buf[ppp]<'0' || buf[ppp]>'9') if (++ppp>=maxb) cin.read(buf,maxb),ppp=0; while (buf[ppp]>='0' && buf[ppp]<='9') { nr=nr*10+buf[ppp]-'0'; if (++ppp>=maxb) cin.read(buf,maxb),ppp=0; } return nr; } char gc() { while (buf[ppp]<'a' || buf[ppp]>'z') if (++ppp>=maxb) cin.read(buf,maxb),ppp=0; char c=buf[ppp]; if (++ppp>=maxb) cin.read(buf,maxb),ppp=0; return c; }*/ void df(int nod) { viz[nod]=true; for(int i=0; i>t; //cout<>n; //cout<>s+1;//,cout<>x>>y; //cout<