#includeusing namespace std;const int MAX_N=1000005;int n,k;int Rank[MAX_N+1];int tmp[MAX_N+1];int sa[MAX_N+1];bool compare_sa(int i,int j){ if(Rank[i]!=Rank[j])return Rank[i] 1){ int c=(a+b)/2; if(S.compare(sa[c],T.length(),T)<0)a=c; else b=c; } return S.compare(sa[b],T.length(),T)==0;}int main(){ string str,ss; cin>>str;//主串 construct_sa(str,sa); while(cin>>ss) { cout< <