#include #include #include #include #include using namespace std; const long long m = 1000000007; int main() { int n, q; cin >> n >> q; char s[n+1]; cin >> s; while(q--){ int num; cin >> num; if(num==1){ int i, j, t; cin >> i >> j >> t; for(int f = i; f<=j; f++){ int res = (((int)s[f]-'a'+1)+t)%26; if(res==0){ res = 26; } s[f] = (char)(res+'a'-1); } } else if(num==2){ int i, j; cin >> i >> j; long long count = (j-i+1)%m, countprev = 0, mid1 = i, mid2 = j; int mid = i + (j-i)/2; for(int k = mid; k>=i; k--){ int f = k+1; while(f<=j){ if(s[f]==s[k]){ if(mid1>k && mid2