#include using namespace std; #include using namespace atcoder; template inline bool chmax(T &a, T b) { return ((a < b) ? (a = b, true) : (false)); } template inline bool chmin(T &a, T b) { return ((a > b) ? (a = b, true) : (false)); } #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) #define rep2(i, m ,n) for (int i = (m); i < (long long)(n); i++) #define REP(i, n) for (long long i = 1; i < (long long)(n); i++) typedef long long ll; #define updiv(N,X) (N + X - 1) / X #define l(n) n.begin(),n.end() #define YesNo(Q) Q==1?cout<<"Yes":cout<<"No" using P = pair; using mint = modint; const int MOD = 998244353LL; const ll INF = 999999999999LL; vector fact, fact_inv, inv; /* init_nCk :二項係数のための前処理 計算量:O(n) */ template void input(vector &v){ rep(i,v.size()){cin>>v[i];} return; } void init_nCk(int SIZE) { fact.resize(SIZE + 5); fact_inv.resize(SIZE + 5); inv.resize(SIZE + 5); fact[0] = fact[1] = 1; fact_inv[0] = fact_inv[1] = 1; inv[1] = 1; for (int i = 2; i < SIZE + 5; i++) { fact[i] = fact[i - 1] * i % MOD; inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD; fact_inv[i] = fact_inv[i - 1] * inv[i] % MOD; } } /* nCk :MODでの二項係数を求める(前処理 int_nCk が必要) 計算量:O(1) */ long long nCk(int n, int k) { assert(!(n < k)); assert(!(n < 0 || k < 0)); return fact[n] * (fact_inv[k] * fact_inv[n - k] % MOD) % MOD; } long long modpow(long long a, long long n, long long mod) { long long res = 1; while (n > 0) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return res; } ll POW(ll a,ll n){ long long res = 1; while (n > 0) { if (n & 1) res = res * a; a = a * a; n >>= 1; } return res; } class KMP { public: string pattern; int plen; vector table; KMP(const string s) : pattern(s), plen((int)pattern.size()), table(plen+1){ table[0] = -1; int j = -1; for(int i = 0; i < plen; i++){ while(j >= 0 && pattern[i] != pattern[j]) j = table[j]; if(pattern[i+1] == pattern[++j]) table[i+1] = table[j]; else table[i+1] = j; } } void search(const string& text, vector& res){ int head = 0, j = 0, tlen = (int)text.size(); while(head + j < tlen){ if(pattern[j] == text[head + j]){ if(++j != plen) continue; res.push_back(head); } head += j - table[j], j = max(table[j], 0); } } }; int main() { int n,m,k;cin>>n>>m>>k; string s,t;cin>>s>>t;auto s1 = s;auto t1 = t; rep(i,n){s1[i]=tolower(s[i]);} rep(i,m){t1[i]=tolower(t[i]);} KMP kmp(t1); vector res; kmp.search(s1,res); set st; rep(i,res.size()){st.insert(res[i]);} vector a(n,0);vector b(m,0); rep(i,n){if(islower(s[i])){a[i]++;}} rep(i,m){if(isupper(t[t.size()-1-i])){b[i]++;}} auto u = convolution_ll(a,b); rep(i,n){a[i] = 1-a[i];} rep(i,m){b[i] = 1-b[i];} auto v = convolution_ll(a,b); //t.size()-1 //rep(i,a.size()){cout<