#include #include //#include using namespace std; //ifstream f("a.in"); //#define cin f char s[100010]; int p[100010],ad[100010]; int t,n,i,x,y,a,q[100010],l; bool viz[100010]; vector v[100010]; #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<