#include using namespace std; class rolling_hash{ mt19937 mt; const size_t p_cnt = 3; const uint32_t p[3] = {2111511013, 2131131137, 2147483647}; uint64_t b[3]; uint64_t mpow(uint64_t x, uint64_t y, uint32_t m){ if(y == 0) return 1; if(y == 1) return x%m; if(y%2 == 0) return mpow(x*x%m, y/2, m); return mpow(x*x%m, y/2, m) * x % m; } bool is_equal(const vector &x, const vector &y){ for(size_t i=0;i operator()(string s){ vector h = {0, 0, 0}; for(char c : s){ for(size_t i=0;i &xs, const string &y){ if(xs.size() == 0) return 0; size_t xl = xs[0].size(), yl = y.size(); if(xl > yl) return 0; uint64_t bl[p_cnt]; for(size_t i=0;i> xhs(xs.size()); for(size_t i=0;i(p_cnt, 0); vector yh(3, 0); for(size_t i=0;i> s; cin >> m; for(int i=0;i> c[i]; vector cs[11]; for(int i=0;i