//Daniel Grzegorzewski #include #define MP make_pair #define PB push_back #define ST first #define ND second #define int long long using namespace std; typedef pair PII; typedef vector VI; typedef vector VII; typedef long long LL; void init_ios() { ios_base::sync_with_stdio(0); cin.tie(0); } const int MOD = (int)1e9 + 7; int fpow(int x, int y) { if (y == 0) return 1; if (y&1) return (x*fpow(x, y-1))%MOD; int res = fpow(x, y/2); return (res*res)%MOD; } const int N = (int)1e5 + 10; int n, q, sil[N], inv[N], pref[N]; string s; int brut(int a, int b) { int res = 0; int ile[30]; for (int i = 0; i < 30; ++i) ile[i] = 0; for (int i = a; i <= b; ++i) ++ile[s[i]-'a']; int grupy = 0; for (int i = 0; i < 26; ++i) grupy += ile[i]/2; for (int i = 0; i < 26; ++i) { if (ile[i] == 0) continue; int naile = ile[i]; int gr = grupy; if (ile[i]%2 == 0) --gr; int yolo = (naile*sil[gr])%MOD; res = (res+yolo*pref[gr])%MOD; } if (grupy > 0) res = (res+sil[grupy]*inv[grupy-1])%MOD; return res; } signed main() { init_ios(); sil[0] = 1; inv[0] = 1; pref[0] = 1; for (int i = 1; i < N-5; ++i) { sil[i] = (i*sil[i-1])%MOD; inv[i] = fpow(sil[i], MOD-2); pref[i] = (pref[i-1]+inv[i])%MOD; } cin >> n >> q >> s; if (n <= 500 && q <= 500) { while (q--) { int z, a, b, c; cin >> z; if (z == 1) { cin >> a >> b >> c; c %= 26; for (int i = a; i <= b; ++i) { int pom = c; while (pom--) { if (s[i] == 'z') s[i] = 'a'; else ++s[i]; } } } else { cin >> a >> b; cout<