#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define ll long long #define mod 9973 #define inf 999999999 #define esp 0.00000000001 //#pragma comment(linker, "/STACK:102400000,102400000") int scan() { int res = 0 , ch ; while( !( ( ch = getchar() ) >= '0' && ch <= '9' ) ) { if( ch == EOF ) return 1 << 30 ; } res = ch - '0' ; while( ( ch = getchar() ) >= '0' && ch <= '9' ) res = res * 10 + ( ch - '0' ) ; return res ; } char a[100010]; int mul[100010]; void extend_Euclid(int a, int b, int &x, int &y) { if(b == 0) { x = 1; y = 0; return; } extend_Euclid(b, a % b, x, y); int tmp = x; x = y; y = tmp - (a / b) * y; } int main() { int x,y,z,i,t; while(~scanf("%d",&x)) { scanf("%s",a); y=strlen(a); mul[0]=1; mul[1]=a[0]-28; for(i=1;i