#include #include #include #include #include #include using namespace std; bool canFormPalindrome(string str) { // Create a count array and initialize all values as 0 //int count[NO_OF_CHARS] = {0}; vectorcount(126,0); // For each character in input strings, increment count in // the corresponding count array for (int i = 0; str[i]; i++) count[str[i]]++; // Count odd occurring characters int odd = 0; for (int i = 0; i < 126; i++) if (count[i] & 1) odd++; // Return true if odd count is 0 or 1, otherwise false return (odd <= 1); } int palindromeSubStrs(string s) { //cout<vec(s.size(),0); int k=j1; for(int j=0;j m; int n = s.size(); int R[2][n+1]; s = "@" + s + "#"; for (int j = 0; j <= 1; j++) { int rp = 0; R[j][0] = 0; int i = 1; while (i <= n) { while (s[i - rp - 1] == s[i + j + rp]) rp++; R[j][i] = rp; int k = 1; while ((R[j][i - k] != rp - k) && (k < rp)) { R[j][i + k] = min(R[j][i - k],rp - k); k++; } rp = max(rp - k,0); i += k; } } // remove 'guards' s = s.substr(1, n); // Put all obtained palindromes in a hash map to // find only distinct palindromess int sum=0; m[string(1, s[0])]=1; for (int i = 1; i <= n; i++) { for (int j = 0; j <= 1; j++) for (int rp = R[j][i]; rp > 0; rp--){ if(m.find(s.substr(i - rp - 1, 2 * rp + j))!=m.end() ) sum++; m[s.substr(i - rp - 1, 2 * rp + j)]=1; } if(m.find(string(1, s[i]))!=m.end()) sum++; m[string(1, s[i])]=1; } //printing all distinct palindromes from hash map // if(sum>0) sum++; //return sum+m.size()-1; return m.size()-1; }*/ int main() { int n,Q; cin>>n>>Q; string st;cin>>st; for(int i1=0;i1>x; if(x==1) { cin>>i>>j>>t; char a; for(int k=i;k<=j;k++) { a=st[k]; a=(a+t)%(123); st[k]=a; } //cout<>i>>j; for(int k=i;k<=j;k++) s+=st[k]; cout<