#include using namespace std; typedef long long ll; const ll MOD=1e9+7; struct RollingHash{ ll M; vector H,B; RollingHash(string s,ll b=1009LL,ll m=1000000007LL){//999999937LL M = m; ll n = s.size(); B.resize(n+1); H.resize(n+1,0); B[0] = 1; for(ll i=0;i> S >> M; Sl = S.size(); map ma1,ma2; RollingHash Shash1(S); RollingHash Shash2(S,9973,999999937); for(int i=0;i> C; RollingHash Chash1(C); RollingHash Chash2(C,9973,999999937); ll cl = C.size(); ll ch1 = Chash1.GetHash(0,cl); ll ch2 = Chash2.GetHash(0,cl); ma1[ch1]++; ma2[ch2]++; } for(int i=1;i<11;i++){ for(int j=0;j