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