/****************************************** * AUTHOR: BHUVNESH JAIN * * INSTITUITION: BITS PILANI, PILANI * ******************************************/ #include using namespace std; typedef long long LL; typedef long double LD; const int MAX = 1e3 + 3; const int MOD = 1e9 + 7; int fact[MAX], invp[MAX]; char s[MAX]; char t[MAX]; int f[MAX]; int main() { #ifndef ONLINE_JUDGE //freopen("inp.txt", "r", stdin); #endif int n, q; scanf("%d %d", &n, &q); scanf("%s", s); int type, u, v, a; while(q--) { scanf("%d %d %d", &type, &u, &v); if (type == 1) { scanf("%d", &a); for(int i = u; i <= v; ++i) { s[i] = (s[i] - 'a' + a) % 26 + 'a'; } } else { int cnt = 0; for(int i = u; i <= v; ++i) { t[cnt++] = s[i]; } int up = 1 << cnt, ans = 0; for(int i = 1; i < up; ++i) { for(int j = 0; j < cnt; ++j) { if (i & (1<