#include #include using namespace std; using ll = long long; using namespace atcoder; mt19937_64 rng(time(0)); const ll B=1; ll MOD[B] = {998244353}; ll BASE[B] = {static_cast(rng() % MOD[0])}; //Rolling Hash on Segment Tree struct Record{ ll hash, pow; }; using S = array; S op(S a, S b){ S res; for (int i=0; i> N >> L >> Q; vector s(N); vector> tree; auto to_hash=[&](string &s){ S x; int N=s.size(); vector v(N); for (int i=0; i(v); }; vector p(B, vector(L)); for (int i=0; i res(B); for (int i=0; i> s[i]; tree.push_back(to_hash(s[i])); }; while(Q--){ cin >> t; if (t == 1){ cin >> k >> c >> d; k--; for (int i=0; i> T; int ans=0; vector x = to_hash2(T); for (int i=0; i