import java.io.IOException; import java.io.InputStream; import java.util.InputMismatchException; public class Hack44_4{ void solve() { int n = ni(); int q = ni(); char[] s = ca(n); while(q-->0) { int k = ni(); if(k==1) { int i = ni(); int j = ni(); int sh = ni()%26; for(int tr=i;tr<=j;tr++) { s[tr] = (char)(s[tr]+sh); if(s[tr]>='z') s[tr] = (char)(s[tr]-'a'); } } else { int[] al = new int[26]; int i = ni(); int j = ni(); for(int tr=i;tr<=j;tr++) al[s[tr]-'a']++; int sm = 0; for(int x=0;x<26;x++) sm+=al[x]; System.out.println(sm); } } } int C(int n,int r) { r = Math.min(r,n-r); int ans = 1; for(int i=0;i=bufLength) { bufCurrent = 0; try {bufLength = inputStream.read(bufferArray);} catch(IOException e) { throw new InputMismatchException();} if(bufLength<=0) return -1; } return bufferArray[bufCurrent++]; } boolean isSpaceChar(int x) {return (x<33 || x>126);} boolean isDigit(int x) {return (x>='0' && x<='9');} int nextNonSpace() { int x; while((x=nextByte())!=-1 && isSpaceChar(x)); return x; } int ni() { int ans = 0; int sign = 1; int x = nextNonSpace(); if(x=='-') { sign = -1; x = nextByte(); } while(!isSpaceChar(x)) { if(isDigit(x)) { ans = ans*10 + x -'0'; x = nextByte(); } else throw new InputMismatchException(); } return sign*ans; } long nl() { long ans = 0; long sign = 1; int x = nextNonSpace(); if(x=='-') { sign = -1; x = nextByte(); } while(!isSpaceChar(x)) { if(isDigit(x)) { ans = ans*10 + x -'0'; x = nextByte(); } else throw new InputMismatchException(); } return sign*ans; } String ns() { StringBuilder sb = new StringBuilder(); int x = nextNonSpace(); while(!isSpaceChar(x)) { sb.append((char)x); x = nextByte(); } return sb.toString(); } String nL() { StringBuilder sb = new StringBuilder(); int x = nextNonSpace(); while(x==32 || !isSpaceChar(x)) { sb.append((char)x); x = nextByte(); } return sb.toString(); } char nc() { return (char)nextNonSpace();} double nd() { return (double)Double.parseDouble(ns()); } char[] ca() { return ns().toCharArray();} char[] ca(int n) { char[] ans = new char[n]; int p =0; int x = nextNonSpace(); while(p