#include using namespace std; void palin(string s) { long long t,i,a[55][55],p,cnt,j; for(i=0;i<55;i++) for(j=0;j<55;j++) a[i][j]=0; p=s.length(); for(i=p-1;i>=0;i--) { cnt=1; a[i][i]=1; if(i+1!=p){ if(s[i]==s[i+1]) { cnt++; a[i][i+1]=3;// in case aab-->a,a,aa } else a[i][i+1]=2; } for(j=i+2;j>n>>q; string str; cin>>str; for(int z=0;z>a; if(a==1) { int l,r,s; cin>>l>>r>>s; s=s%26; for(int i=l;i<=r;i++) { int p=(int)str[i]; p=p+s; if(p>122) p=96+p-122; str[i]=char(p); } } else { int l,r; cin>>l>>r; string str1=str.substr(l,r-l+1); palin(str1); } } }