#include #define ll long long using namespace std; int n,q; string s; int p,a,b,t,mas[26],m[26]; ll ans,pas,MOD=1e9+7,sum,ss; char f (char ch, int x){return 'a'+(ch+x-'a')%26;} ll power (ll a, ll b){ ll x=1,y=a,ans=1; while (x<=b){ if (x&b)ans=ans*y%MOD; x*=2; y=y*y%MOD; } return ans; } ll C (ll n, ll m){ ll ans=1; for (ll i=m+1;i<=n;i++) ans=ans*i/(i-m)%MOD; return ans; } int main(){ cin>>n>>q>>s; while (q--){ cin>>p>>a>>b; if (p==1){ cin>>t; t%=26; for (int i=a;i<=b;++i)s[i]=f(s[i],t); continue; } for (int i=0;i<26;i++)mas[i]=0; for (int i=a;i<=b;++i)mas[s[i]-'a']++; ans=1; for (int i=0;i<26;++i){ pas=0; for (int j=0;j<=mas[i];j+=2) pas=(pas+C(mas[i],j))%MOD; ans=ans*pas%MOD; m[i]=pas; } for (int i=0;i<26;i++) if (mas[i]){ ss=1; //cout<