#include #include #include #include #include using namespace std; using mint=atcoder::static_modint<1000000901>; mint pB[3000]; int N,L,Q; string S[1000]; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); { random_device seed; mt19937 rng(seed()); mint B=rng()%(mint::mod()-1)+1; pB[0]=1; for(int i=1;i<3000;i++)pB[i]=pB[i-1]*B; } cin>>N>>L>>Q; vector >H(N); for(int i=0;i>S[i]; H[i]=atcoder::fenwick_tree(L); for(int j=0;j>op; if(op==1) { int k;char c,d; cin>>k>>c>>d;k--; for(int i=0;i>t; mint h=0; for(int j=0;j