//このソースコードはpietで書かれたものをc++にコンパイルしたものです。決して闇の呪文ではありません。
const int PUSH = 1, POP = 2, ADD = 10, SUB = 11, MULTI = 12, DIV = 20, MOD = 21, NOT = 22, GREAT = 30, POINT = 31, SWITCH = 32, DUP = 40, ROLL = 41, INN = 42, INC = 50, OUTN = 51, OUTC = 52;
#include <cstdio>
#include <vector>
#include <stack>
#include <iostream>
#include <string>
using namespace std;
typedef long long ll;
struct cal {
	int process;
	int next;
	cal(int p, int n) {
		process = p;next = n;
	}
	bool operator >(const cal &b) const { return process > b.process; }
};
int main() {
	vector<vector<vector<cal>>> proceed(81, vector<vector<cal>>(4, vector<cal>(2, cal(0, 0))));
	proceed[0][0][0] = cal(1, 1);proceed[0][0][1] = cal(1, 1);proceed[0][1][0] = cal(-2, -1);proceed[0][1][1] = cal(-2, -1);proceed[0][2][0] = cal(-1, -1);proceed[0][2][1] = cal(-1, -1);proceed[0][3][0] = cal(-1, -1);proceed[0][3][1] = cal(-1, -1);proceed[1][0][0] = cal(22, 2);proceed[1][0][1] = cal(22, 2);proceed[1][1][0] = cal(-2, -1);proceed[1][1][1] = cal(-2, -1);proceed[1][2][0] = cal(2, 0);proceed[1][2][1] = cal(2, 0);proceed[1][3][0] = cal(-1, -1);proceed[1][3][1] = cal(-1, -1);proceed[2][0][0] = cal(42, 3);proceed[2][0][1] = cal(42, 3);proceed[2][1][0] = cal(-2, -1);proceed[2][1][1] = cal(-2, -1);proceed[2][2][0] = cal(41, 1);proceed[2][2][1] = cal(41, 1);proceed[2][3][0] = cal(-1, -1);proceed[2][3][1] = cal(-1, -1);proceed[3][0][0] = cal(40, 4);proceed[3][0][1] = cal(40, 4);proceed[3][1][0] = cal(-2, 42);proceed[3][1][1] = cal(-2, 42);proceed[3][2][0] = cal(21, 2);proceed[3][2][1] = cal(21, 2);proceed[3][3][0] = cal(-1, -1);proceed[3][3][1] = cal(-1, -1);proceed[4][0][0] = cal(22, 5);proceed[4][0][1] = cal(22, 5);proceed[4][1][0] = cal(-2, 53);proceed[4][1][1] = cal(-2, 53);proceed[4][2][0] = cal(20, 3);proceed[4][2][1] = cal(20, 3);proceed[4][3][0] = cal(-1, -1);proceed[4][3][1] = cal(-1, -1);proceed[5][0][0] = cal(22, 6);proceed[5][0][1] = cal(22, 6);proceed[5][1][0] = cal(-2, 54);proceed[5][1][1] = cal(-2, 54);proceed[5][2][0] = cal(41, 4);proceed[5][2][1] = cal(41, 4);proceed[5][3][0] = cal(-1, -1);proceed[5][3][1] = cal(-1, -1);proceed[6][0][0] = cal(31, 7);proceed[6][0][1] = cal(31, 7);proceed[6][1][0] = cal(-2, -1);proceed[6][1][1] = cal(-2, -1);proceed[6][2][0] = cal(41, 5);proceed[6][2][1] = cal(41, 5);proceed[6][3][0] = cal(-1, -1);proceed[6][3][1] = cal(-1, -1);proceed[7][0][0] = cal(2, 8);proceed[7][0][1] = cal(2, 8);proceed[7][1][0] = cal(1, 36);proceed[7][1][1] = cal(1, 36);proceed[7][2][0] = cal(32, 6);proceed[7][2][1] = cal(32, 6);proceed[7][3][0] = cal(-1, -1);proceed[7][3][1] = cal(-1, -1);proceed[8][0][0] = cal(22, 9);proceed[8][0][1] = cal(22, 9);proceed[8][1][0] = cal(-2, 37);proceed[8][1][1] = cal(-2, 37);proceed[8][2][0] = cal(1, 7);proceed[8][2][1] = cal(1, 7);proceed[8][3][0] = cal(-1, -1);proceed[8][3][1] = cal(-1, -1);proceed[9][0][0] = cal(-2, 10);proceed[9][0][1] = cal(-2, 10);proceed[9][1][0] = cal(-2, 44);proceed[9][1][1] = cal(-2, 44);proceed[9][2][0] = cal(41, 8);proceed[9][2][1] = cal(41, 8);proceed[9][3][0] = cal(-1, -1);proceed[9][3][1] = cal(-1, -1);proceed[10][0][0] = cal(32, 11);proceed[10][0][1] = cal(-1, -1);proceed[10][1][0] = cal(-2, 44);proceed[10][1][1] = cal(-2, 44);proceed[10][2][0] = cal(-2, 36);proceed[10][2][1] = cal(-2, 9);proceed[10][3][0] = cal(-1, -1);proceed[10][3][1] = cal(-1, -1);proceed[11][0][0] = cal(1, 12);proceed[11][0][1] = cal(1, 38);proceed[11][1][0] = cal(30, 44);proceed[11][1][1] = cal(30, 44);proceed[11][2][0] = cal(31, 10);proceed[11][2][1] = cal(31, 10);proceed[11][3][0] = cal(-1, -1);proceed[11][3][1] = cal(-1, -1);proceed[12][0][0] = cal(40, 13);proceed[12][0][1] = cal(40, 13);proceed[12][1][0] = cal(41, 16);proceed[12][1][1] = cal(41, 16);proceed[12][2][0] = cal(2, 11);proceed[12][2][1] = cal(2, 11);proceed[12][3][0] = cal(-1, -1);proceed[12][3][1] = cal(-1, -1);proceed[13][0][0] = cal(40, 14);proceed[13][0][1] = cal(40, 14);proceed[13][1][0] = cal(1, 16);proceed[13][1][1] = cal(1, 16);proceed[13][2][0] = cal(20, 12);proceed[13][2][1] = cal(20, 12);proceed[13][3][0] = cal(-1, -1);proceed[13][3][1] = cal(-1, -1);proceed[14][0][0] = cal(12, 15);proceed[14][0][1] = cal(12, 15);proceed[14][1][0] = cal(21, 16);proceed[14][1][1] = cal(21, 16);proceed[14][2][0] = cal(20, 13);proceed[14][2][1] = cal(20, 13);proceed[14][3][0] = cal(-1, -1);proceed[14][3][1] = cal(-1, -1);proceed[15][0][0] = cal(12, 16);proceed[15][0][1] = cal(12, 16);proceed[15][1][0] = cal(12, 16);proceed[15][1][1] = cal(12, 16);proceed[15][2][0] = cal(51, 14);proceed[15][2][1] = cal(51, 14);proceed[15][3][0] = cal(-1, -1);proceed[15][3][1] = cal(-1, -1);proceed[16][0][0] = cal(1, 17);proceed[16][0][1] = cal(-2, 21);proceed[16][1][0] = cal(-2, 45);proceed[16][1][1] = cal(22, 38);proceed[16][2][0] = cal(21, 11);proceed[16][2][1] = cal(21, 11);proceed[16][3][0] = cal(-1, -1);proceed[16][3][1] = cal(-1, -1);proceed[17][0][0] = cal(10, 18);proceed[17][0][1] = cal(10, 18);proceed[17][1][0] = cal(-2, 45);proceed[17][1][1] = cal(-2, 45);proceed[17][2][0] = cal(2, 16);proceed[17][2][1] = cal(2, 16);proceed[17][3][0] = cal(-1, -1);proceed[17][3][1] = cal(-1, -1);proceed[18][0][0] = cal(40, 19);proceed[18][0][1] = cal(40, 19);proceed[18][1][0] = cal(-2, 46);proceed[18][1][1] = cal(-2, 46);proceed[18][2][0] = cal(50, 17);proceed[18][2][1] = cal(50, 17);proceed[18][3][0] = cal(-1, -1);proceed[18][3][1] = cal(-1, -1);proceed[19][0][0] = cal(52, 20);proceed[19][0][1] = cal(52, 20);proceed[19][1][0] = cal(-2, 46);proceed[19][1][1] = cal(-2, 46);proceed[19][2][0] = cal(20, 18);proceed[19][2][1] = cal(20, 18);proceed[19][3][0] = cal(-1, -1);proceed[19][3][1] = cal(-1, -1);proceed[20][0][0] = cal(40, 21);proceed[20][0][1] = cal(40, 21);proceed[20][1][0] = cal(-2, 46);proceed[20][1][1] = cal(-2, 46);proceed[20][2][0] = cal(11, 19);proceed[20][2][1] = cal(11, 19);proceed[20][3][0] = cal(-1, -1);proceed[20][3][1] = cal(-1, -1);proceed[21][0][0] = cal(1, 22);proceed[21][0][1] = cal(21, 23);proceed[21][1][0] = cal(-2, 46);proceed[21][1][1] = cal(-2, 46);proceed[21][2][0] = cal(-2, 16);proceed[21][2][1] = cal(20, 20);proceed[21][3][0] = cal(-1, -1);proceed[21][3][1] = cal(-1, -1);proceed[22][0][0] = cal(20, 23);proceed[22][0][1] = cal(20, 23);proceed[22][1][0] = cal(20, 23);proceed[22][1][1] = cal(20, 23);proceed[22][2][0] = cal(2, 21);proceed[22][2][1] = cal(2, 21);proceed[22][3][0] = cal(-1, -1);proceed[22][3][1] = cal(-1, -1);proceed[23][0][0] = cal(1, 24);proceed[23][0][1] = cal(1, 24);proceed[23][1][0] = cal(-2, 73);proceed[23][1][1] = cal(-2, 71);proceed[23][2][0] = cal(42, 21);proceed[23][2][1] = cal(42, 21);proceed[23][3][0] = cal(-1, -1);proceed[23][3][1] = cal(-1, -1);proceed[24][0][0] = cal(10, 25);proceed[24][0][1] = cal(10, 25);proceed[24][1][0] = cal(52, 28);proceed[24][1][1] = cal(52, 28);proceed[24][2][0] = cal(2, 23);proceed[24][2][1] = cal(2, 23);proceed[24][3][0] = cal(-1, -1);proceed[24][3][1] = cal(-1, -1);proceed[25][0][0] = cal(10, 26);proceed[25][0][1] = cal(10, 26);proceed[25][1][0] = cal(42, 28);proceed[25][1][1] = cal(42, 28);proceed[25][2][0] = cal(50, 24);proceed[25][2][1] = cal(50, 24);proceed[25][3][0] = cal(-1, -1);proceed[25][3][1] = cal(-1, -1);proceed[26][0][0] = cal(40, 27);proceed[26][0][1] = cal(40, 27);proceed[26][1][0] = cal(32, 28);proceed[26][1][1] = cal(32, 28);proceed[26][2][0] = cal(50, 25);proceed[26][2][1] = cal(50, 25);proceed[26][3][0] = cal(-1, -1);proceed[26][3][1] = cal(-1, -1);proceed[27][0][0] = cal(52, 28);proceed[27][0][1] = cal(52, 28);proceed[27][1][0] = cal(52, 28);proceed[27][1][1] = cal(52, 28);proceed[27][2][0] = cal(20, 26);proceed[27][2][1] = cal(20, 26);proceed[27][3][0] = cal(-1, -1);proceed[27][3][1] = cal(-1, -1);proceed[28][0][0] = cal(1, 29);proceed[28][0][1] = cal(-2, 32);proceed[28][1][0] = cal(-2, 77);proceed[28][1][1] = cal(-2, 47);proceed[28][2][0] = cal(-2, 23);proceed[28][2][1] = cal(-2, 23);proceed[28][3][0] = cal(-1, -1);proceed[28][3][1] = cal(-1, -1);proceed[29][0][0] = cal(10, 30);proceed[29][0][1] = cal(10, 30);proceed[29][1][0] = cal(-2, 78);proceed[29][1][1] = cal(-2, 78);proceed[29][2][0] = cal(2, 28);proceed[29][2][1] = cal(2, 28);proceed[29][3][0] = cal(-1, -1);proceed[29][3][1] = cal(-1, -1);proceed[30][0][0] = cal(40, 31);proceed[30][0][1] = cal(40, 31);proceed[30][1][0] = cal(-2, -1);proceed[30][1][1] = cal(-2, -1);proceed[30][2][0] = cal(50, 29);proceed[30][2][1] = cal(50, 29);proceed[30][3][0] = cal(-1, -1);proceed[30][3][1] = cal(-1, -1);proceed[31][0][0] = cal(52, 32);proceed[31][0][1] = cal(52, 32);proceed[31][1][0] = cal(52, 32);proceed[31][1][1] = cal(52, 32);proceed[31][2][0] = cal(20, 30);proceed[31][2][1] = cal(20, 30);proceed[31][3][0] = cal(-1, -1);proceed[31][3][1] = cal(-1, -1);proceed[32][0][0] = cal(1, 33);proceed[32][0][1] = cal(-1, -1);proceed[32][1][0] = cal(-2, -1);proceed[32][1][1] = cal(-2, -1);proceed[32][2][0] = cal(-2, 28);proceed[32][2][1] = cal(-2, 28);proceed[32][3][0] = cal(-1, -1);proceed[32][3][1] = cal(-1, -1);proceed[33][0][0] = cal(11, 34);proceed[33][0][1] = cal(11, 34);proceed[33][1][0] = cal(-1, -1);proceed[33][1][1] = cal(-1, -1);proceed[33][2][0] = cal(2, 32);proceed[33][2][1] = cal(2, 32);proceed[33][3][0] = cal(-1, -1);proceed[33][3][1] = cal(-1, -1);proceed[34][0][0] = cal(52, 35);proceed[34][0][1] = cal(52, 35);proceed[34][1][0] = cal(52, 35);proceed[34][1][1] = cal(52, 35);proceed[34][2][0] = cal(52, 33);proceed[34][2][1] = cal(52, 33);proceed[34][3][0] = cal(-1, -1);proceed[34][3][1] = cal(-1, -1);proceed[35][0][0] = cal(-1, -1);proceed[35][0][1] = cal(-1, -1);proceed[35][1][0] = cal(-1, -1);proceed[35][1][1] = cal(-1, -1);proceed[35][2][0] = cal(-1, -1);proceed[35][2][1] = cal(-1, -1);proceed[35][3][0] = cal(-1, -1);proceed[35][3][1] = cal(-1, -1);proceed[36][0][0] = cal(-2, 10);proceed[36][0][1] = cal(-2, 10);proceed[36][1][0] = cal(11, 37);proceed[36][1][1] = cal(11, 37);proceed[36][2][0] = cal(-2, -1);proceed[36][2][1] = cal(-2, -1);proceed[36][3][0] = cal(2, 7);proceed[36][3][1] = cal(2, 7);proceed[37][0][0] = cal(-2, 11);proceed[37][0][1] = cal(-2, 11);proceed[37][1][0] = cal(1, 43);proceed[37][1][1] = cal(-1, -1);proceed[37][2][0] = cal(-2, -1);proceed[37][2][1] = cal(-2, -1);proceed[37][3][0] = cal(52, 36);proceed[37][3][1] = cal(-2, 8);proceed[38][0][0] = cal(40, 39);proceed[38][0][1] = cal(40, 39);proceed[38][1][0] = cal(-2, -1);proceed[38][1][1] = cal(-2, -1);proceed[38][2][0] = cal(2, 11);proceed[38][2][1] = cal(2, 11);proceed[38][3][0] = cal(41, 16);proceed[38][3][1] = cal(41, 16);proceed[39][0][0] = cal(40, 40);proceed[39][0][1] = cal(40, 40);proceed[39][1][0] = cal(-2, -1);proceed[39][1][1] = cal(-2, -1);proceed[39][2][0] = cal(20, 38);proceed[39][2][1] = cal(20, 38);proceed[39][3][0] = cal(1, 16);proceed[39][3][1] = cal(1, 16);proceed[40][0][0] = cal(12, 41);proceed[40][0][1] = cal(12, 41);proceed[40][1][0] = cal(-2, -1);proceed[40][1][1] = cal(-2, -1);proceed[40][2][0] = cal(20, 39);proceed[40][2][1] = cal(20, 39);proceed[40][3][0] = cal(21, 16);proceed[40][3][1] = cal(21, 16);proceed[41][0][0] = cal(-2, -1);proceed[41][0][1] = cal(12, 45);proceed[41][1][0] = cal(12, 45);proceed[41][1][1] = cal(12, 45);proceed[41][2][0] = cal(-2, 44);proceed[41][2][1] = cal(51, 40);proceed[41][3][0] = cal(12, 16);proceed[41][3][1] = cal(12, 16);proceed[42][0][0] = cal(-2, -1);proceed[42][0][1] = cal(-2, -1);proceed[42][1][0] = cal(22, 48);proceed[42][1][1] = cal(22, 48);proceed[42][2][0] = cal(-2, -1);proceed[42][2][1] = cal(-2, -1);proceed[42][3][0] = cal(-2, 3);proceed[42][3][1] = cal(-2, 3);proceed[43][0][0] = cal(-2, 44);proceed[43][0][1] = cal(-2, 44);proceed[43][1][0] = cal(1, 49);proceed[43][1][1] = cal(1, 49);proceed[43][2][0] = cal(-1, -1);proceed[43][2][1] = cal(-1, -1);proceed[43][3][0] = cal(2, 37);proceed[43][3][1] = cal(2, 37);proceed[44][0][0] = cal(-2, 41);proceed[44][0][1] = cal(-2, 45);proceed[44][1][0] = cal(1, 57);proceed[44][1][1] = cal(40, 55);proceed[44][2][0] = cal(-2, 52);proceed[44][2][1] = cal(-2, 52);proceed[44][3][0] = cal(-2, 10);proceed[44][3][1] = cal(30, 11);proceed[45][0][0] = cal(-2, 46);proceed[45][0][1] = cal(1, 68);proceed[45][1][0] = cal(-1, -1);proceed[45][1][1] = cal(-1, -1);proceed[45][2][0] = cal(-2, 67);proceed[45][2][1] = cal(-2, 44);proceed[45][3][0] = cal(-2, 16);proceed[45][3][1] = cal(-2, 17);proceed[46][0][0] = cal(-2, 47);proceed[46][0][1] = cal(1, 71);proceed[46][1][0] = cal(-1, -1);proceed[46][1][1] = cal(-1, -1);proceed[46][2][0] = cal(20, 45);proceed[46][2][1] = cal(20, 45);proceed[46][3][0] = cal(-2, 19);proceed[46][3][1] = cal(-2, 21);proceed[47][0][0] = cal(-2, -1);proceed[47][0][1] = cal(1, 75);proceed[47][1][0] = cal(-1, -1);proceed[47][1][1] = cal(-1, -1);proceed[47][2][0] = cal(-2, 46);proceed[47][2][1] = cal(-2, 46);proceed[47][3][0] = cal(-2, 23);proceed[47][3][1] = cal(-2, 28);proceed[48][0][0] = cal(-2, 49);proceed[48][0][1] = cal(-2, 49);proceed[48][1][0] = cal(2, 50);proceed[48][1][1] = cal(2, 50);proceed[48][2][0] = cal(-2, -1);proceed[48][2][1] = cal(-2, -1);proceed[48][3][0] = cal(41, 42);proceed[48][3][1] = cal(41, 42);proceed[49][0][0] = cal(31, 44);proceed[49][0][1] = cal(31, 44);proceed[49][1][0] = cal(41, 51);proceed[49][1][1] = cal(41, 51);proceed[49][2][0] = cal(-2, 48);proceed[49][2][1] = cal(-2, 48);proceed[49][3][0] = cal(2, 43);proceed[49][3][1] = cal(2, 43);proceed[50][0][0] = cal(-2, 51);proceed[50][0][1] = cal(-2, 51);proceed[50][1][0] = cal(2, 52);proceed[50][1][1] = cal(2, 52);proceed[50][2][0] = cal(-1, -1);proceed[50][2][1] = cal(-1, -1);proceed[50][3][0] = cal(1, 48);proceed[50][3][1] = cal(1, 48);proceed[51][0][0] = cal(50, 44);proceed[51][0][1] = cal(50, 44);proceed[51][1][0] = cal(50, 44);proceed[51][1][1] = cal(50, 44);proceed[51][2][0] = cal(-2, 50);proceed[51][2][1] = cal(-2, 50);proceed[51][3][0] = cal(22, 49);proceed[51][3][1] = cal(22, 49);proceed[52][0][0] = cal(-2, 44);proceed[52][0][1] = cal(50, 53);proceed[52][1][0] = cal(-2, 61);proceed[52][1][1] = cal(-2, 61);proceed[52][2][0] = cal(-1, -1);proceed[52][2][1] = cal(-1, -1);proceed[52][3][0] = cal(1, 50);proceed[52][3][1] = cal(1, 50);proceed[53][0][0] = cal(2, 54);proceed[53][0][1] = cal(2, 54);proceed[53][1][0] = cal(-2, -1);proceed[53][1][1] = cal(-2, -1);proceed[53][2][0] = cal(10, 52);proceed[53][2][1] = cal(10, 52);proceed[53][3][0] = cal(-2, 4);proceed[53][3][1] = cal(-2, 4);proceed[54][0][0] = cal(-2, 55);proceed[54][0][1] = cal(-2, 55);proceed[54][1][0] = cal(-2, -1);proceed[54][1][1] = cal(-2, -1);proceed[54][2][0] = cal(1, 53);proceed[54][2][1] = cal(1, 53);proceed[54][3][0] = cal(-2, 5);proceed[54][3][1] = cal(-2, 5);proceed[55][0][0] = cal(-2, 56);proceed[55][0][1] = cal(31, 62);proceed[55][1][0] = cal(-1, -1);proceed[55][1][1] = cal(-1, -1);proceed[55][2][0] = cal(-2, 61);proceed[55][2][1] = cal(-2, 54);proceed[55][3][0] = cal(20, 44);proceed[55][3][1] = cal(20, 44);proceed[56][0][0] = cal(2, 57);proceed[56][0][1] = cal(-2, 60);proceed[56][1][0] = cal(50, 63);proceed[56][1][1] = cal(50, 63);proceed[56][2][0] = cal(-2, 55);proceed[56][2][1] = cal(-2, 55);proceed[56][3][0] = cal(1, 44);proceed[56][3][1] = cal(1, 44);proceed[57][0][0] = cal(-2, 45);proceed[57][0][1] = cal(-2, 45);proceed[57][1][0] = cal(1, 60);proceed[57][1][1] = cal(-2, 64);proceed[57][2][0] = cal(1, 56);proceed[57][2][1] = cal(1, 56);proceed[57][3][0] = cal(2, 44);proceed[57][3][1] = cal(2, 44);proceed[58][0][0] = cal(-2, -1);proceed[58][0][1] = cal(1, 77);proceed[58][1][0] = cal(-1, -1);proceed[58][1][1] = cal(-1, -1);proceed[58][2][0] = cal(11, 76);proceed[58][2][1] = cal(-2, 47);proceed[58][3][0] = cal(-2, 28);proceed[58][3][1] = cal(-2, 28);proceed[59][0][0] = cal(-1, -1);proceed[59][0][1] = cal(-1, -1);proceed[59][1][0] = cal(-1, -1);proceed[59][1][1] = cal(-1, -1);proceed[59][2][0] = cal(-1, -1);proceed[59][2][1] = cal(-1, -1);proceed[59][3][0] = cal(-1, -1);proceed[59][3][1] = cal(-1, -1);proceed[60][0][0] = cal(-2, 45);proceed[60][0][1] = cal(-2, 45);proceed[60][1][0] = cal(12, 67);proceed[60][1][1] = cal(12, 67);proceed[60][2][0] = cal(-2, 56);proceed[60][2][1] = cal(-2, 56);proceed[60][3][0] = cal(2, 57);proceed[60][3][1] = cal(2, 57);proceed[61][0][0] = cal(-2, 55);proceed[61][0][1] = cal(-2, 55);proceed[61][1][0] = cal(-1, -1);proceed[61][1][1] = cal(-1, -1);proceed[61][2][0] = cal(-1, -1);proceed[61][2][1] = cal(-1, -1);proceed[61][3][0] = cal(-2, 52);proceed[61][3][1] = cal(-2, 52);proceed[62][0][0] = cal(41, 63);proceed[62][0][1] = cal(41, 63);proceed[62][1][0] = cal(-1, -1);proceed[62][1][1] = cal(-1, -1);proceed[62][2][0] = cal(32, 55);proceed[62][2][1] = cal(32, 55);proceed[62][3][0] = cal(-2, 44);proceed[62][3][1] = cal(-2, 44);proceed[63][0][0] = cal(41, 64);proceed[63][0][1] = cal(41, 64);proceed[63][1][0] = cal(-1, -1);proceed[63][1][1] = cal(-1, -1);proceed[63][2][0] = cal(22, 62);proceed[63][2][1] = cal(22, 62);proceed[63][3][0] = cal(10, 56);proceed[63][3][1] = cal(10, 56);proceed[64][0][0] = cal(52, 65);proceed[64][0][1] = cal(52, 65);proceed[64][1][0] = cal(-1, -1);proceed[64][1][1] = cal(-1, -1);proceed[64][2][0] = cal(22, 63);proceed[64][2][1] = cal(22, 63);proceed[64][3][0] = cal(-2, 57);proceed[64][3][1] = cal(-2, 57);proceed[65][0][0] = cal(50, 66);proceed[65][0][1] = cal(50, 66);proceed[65][1][0] = cal(-1, -1);proceed[65][1][1] = cal(-1, -1);proceed[65][2][0] = cal(11, 64);proceed[65][2][1] = cal(11, 64);proceed[65][3][0] = cal(-2, 57);proceed[65][3][1] = cal(-2, 57);proceed[66][0][0] = cal(2, 67);proceed[66][0][1] = cal(2, 67);proceed[66][1][0] = cal(-1, -1);proceed[66][1][1] = cal(-1, -1);proceed[66][2][0] = cal(10, 65);proceed[66][2][1] = cal(10, 65);proceed[66][3][0] = cal(-2, 57);proceed[66][3][1] = cal(-2, 57);proceed[67][0][0] = cal(-2, 45);proceed[67][0][1] = cal(-2, 45);proceed[67][1][0] = cal(-1, -1);proceed[67][1][1] = cal(-1, -1);proceed[67][2][0] = cal(1, 66);proceed[67][2][1] = cal(1, 66);proceed[67][3][0] = cal(51, 60);proceed[67][3][1] = cal(51, 60);proceed[68][0][0] = cal(10, 69);proceed[68][0][1] = cal(10, 69);proceed[68][1][0] = cal(-1, -1);proceed[68][1][1] = cal(-1, -1);proceed[68][2][0] = cal(2, 45);proceed[68][2][1] = cal(2, 45);proceed[68][3][0] = cal(42, 46);proceed[68][3][1] = cal(42, 46);proceed[69][0][0] = cal(40, 70);proceed[69][0][1] = cal(40, 70);proceed[69][1][0] = cal(-1, -1);proceed[69][1][1] = cal(-1, -1);proceed[69][2][0] = cal(50, 68);proceed[69][2][1] = cal(50, 68);proceed[69][3][0] = cal(32, 46);proceed[69][3][1] = cal(32, 46);proceed[70][0][0] = cal(52, 46);proceed[70][0][1] = cal(52, 46);proceed[70][1][0] = cal(-1, -1);proceed[70][1][1] = cal(-1, -1);proceed[70][2][0] = cal(20, 69);proceed[70][2][1] = cal(20, 69);proceed[70][3][0] = cal(52, 46);proceed[70][3][1] = cal(52, 46);proceed[71][0][0] = cal(10, 72);proceed[71][0][1] = cal(10, 72);proceed[71][1][0] = cal(-1, -1);proceed[71][1][1] = cal(-1, -1);proceed[71][2][0] = cal(2, 46);proceed[71][2][1] = cal(2, 46);proceed[71][3][0] = cal(-2, 23);proceed[71][3][1] = cal(-2, 23);proceed[72][0][0] = cal(40, 73);proceed[72][0][1] = cal(40, 73);proceed[72][1][0] = cal(-1, -1);proceed[72][1][1] = cal(-1, -1);proceed[72][2][0] = cal(50, 71);proceed[72][2][1] = cal(50, 71);proceed[72][3][0] = cal(-2, 23);proceed[72][3][1] = cal(-2, 23);proceed[73][0][0] = cal(52, 74);proceed[73][0][1] = cal(52, 74);proceed[73][1][0] = cal(-1, -1);proceed[73][1][1] = cal(-1, -1);proceed[73][2][0] = cal(20, 72);proceed[73][2][1] = cal(20, 72);proceed[73][3][0] = cal(-2, 23);proceed[73][3][1] = cal(-2, 23);proceed[74][0][0] = cal(40, 47);proceed[74][0][1] = cal(40, 47);proceed[74][1][0] = cal(-1, -1);proceed[74][1][1] = cal(-1, -1);proceed[74][2][0] = cal(11, 73);proceed[74][2][1] = cal(11, 73);proceed[74][3][0] = cal(-2, 47);proceed[74][3][1] = cal(-2, 47);proceed[75][0][0] = cal(10, 76);proceed[75][0][1] = cal(10, 76);proceed[75][1][0] = cal(-1, -1);proceed[75][1][1] = cal(-1, -1);proceed[75][2][0] = cal(2, 47);proceed[75][2][1] = cal(2, 47);proceed[75][3][0] = cal(-2, 28);proceed[75][3][1] = cal(-2, 28);proceed[76][0][0] = cal(52, 58);proceed[76][0][1] = cal(52, 58);proceed[76][1][0] = cal(-1, -1);proceed[76][1][1] = cal(-1, -1);proceed[76][2][0] = cal(50, 75);proceed[76][2][1] = cal(50, 75);proceed[76][3][0] = cal(-2, 28);proceed[76][3][1] = cal(-2, 28);proceed[77][0][0] = cal(11, 78);proceed[77][0][1] = cal(11, 78);proceed[77][1][0] = cal(-1, -1);proceed[77][1][1] = cal(-1, -1);proceed[77][2][0] = cal(2, 58);proceed[77][2][1] = cal(2, 58);proceed[77][3][0] = cal(-2, 28);proceed[77][3][1] = cal(-2, 28);proceed[78][0][0] = cal(40, 79);proceed[78][0][1] = cal(40, 79);proceed[78][1][0] = cal(-1, -1);proceed[78][1][1] = cal(-1, -1);proceed[78][2][0] = cal(52, 77);proceed[78][2][1] = cal(52, 77);proceed[78][3][0] = cal(-2, 29);proceed[78][3][1] = cal(-2, 29);proceed[79][0][0] = cal(52, 80);proceed[79][0][1] = cal(52, 80);proceed[79][1][0] = cal(-1, -1);proceed[79][1][1] = cal(-1, -1);proceed[79][2][0] = cal(20, 78);proceed[79][2][1] = cal(20, 78);proceed[79][3][0] = cal(-1, -1);proceed[79][3][1] = cal(-1, -1);proceed[80][0][0] = cal(52, 59);proceed[80][0][1] = cal(52, 59);proceed[80][1][0] = cal(-1, -1);proceed[80][1][1] = cal(-1, -1);proceed[80][2][0] = cal(11, 79);proceed[80][2][1] = cal(11, 79);proceed[80][3][0] = cal(52, 59);proceed[80][3][1] = cal(52, 59);
	vector<int> codelblock;
	codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(2);codelblock.push_back(4);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(6);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(2);codelblock.push_back(1);codelblock.push_back(6);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(6);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(3);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(3);codelblock.push_back(1);codelblock.push_back(2);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(2);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(22);codelblock.push_back(20);codelblock.push_back(20);codelblock.push_back(10);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(2);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(3);codelblock.push_back(2);codelblock.push_back(4);codelblock.push_back(3);codelblock.push_back(4);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);codelblock.push_back(1);

	stack<ll> st;
	int nowgroup = 0;
	int dp = 0;
	int cc = 0;
	int endcount = 0;
	while (endcount<8) {
		if (proceed[nowgroup][dp][cc].process == -1 || proceed[nowgroup][dp][cc].next == -1) {
			if (endcount % 2 == 0)
				cc = (cc + 1) % 2;
			else
				dp = (dp + 1) % 4;
			endcount++;
		}
		else {
			bool flag = true;
			endcount = 0;
			if (proceed[nowgroup][dp][cc].process == PUSH)
				st.push(codelblock[nowgroup]);
			else if (proceed[nowgroup][dp][cc].process == POP)
				st.pop();
			else if (proceed[nowgroup][dp][cc].process == ADD) {
				ll a = st.top();st.pop();
				ll b = st.top();st.pop();
				st.push(b + a);
			}
			else if (proceed[nowgroup][dp][cc].process == SUB) {
				ll a = st.top();st.pop();
				ll b = st.top();st.pop();
				st.push(b - a);
			}
			else if (proceed[nowgroup][dp][cc].process == MULTI) {
				ll a = st.top();st.pop();
				ll b = st.top();st.pop();
				st.push(b*a);
			}
			else if (proceed[nowgroup][dp][cc].process == DIV) {
				ll a = st.top();st.pop();
				ll b = st.top();st.pop();
				st.push(b / a);
			}
			else if (proceed[nowgroup][dp][cc].process == MOD) {
				ll a = st.top();st.pop();
				ll b = st.top();st.pop();
				st.push(b%a);
			}
			else if (proceed[nowgroup][dp][cc].process == NOT) {
				ll a = st.top();st.pop();
				if (a != 0) st.push(0);
				else st.push(1);
			}
			else if (proceed[nowgroup][dp][cc].process == GREAT) {
				ll a = st.top();st.pop();
				ll b = st.top();st.pop();
				st.push(a<b);
			}
			else if (proceed[nowgroup][dp][cc].process == POINT) {
				ll a = st.top();st.pop();
				nowgroup = proceed[nowgroup][dp][cc].next;
				dp = (dp + a % 4) % 4;
				flag = false;
			}
			else if (proceed[nowgroup][dp][cc].process == SWITCH) {
				ll a = st.top();st.pop();
				nowgroup = proceed[nowgroup][dp][cc].next;
				cc = (cc + a % 2) % 2;
				flag = false;
			}
			else if (proceed[nowgroup][dp][cc].process == DUP) {
				ll a = st.top();
				st.push(a);
			}
			else if (proceed[nowgroup][dp][cc].process == ROLL) {
				ll b = st.top();st.pop();
				ll a = st.top();st.pop();
				vector<ll> temp(a);
				for (int i = a - 1;i >= 0;i--) {
					temp[i] = st.top();
					st.pop();
				}
				for (int i = 0;i<a;i++)
					st.push(temp[(i - b + a) % a]);
			}
			else if (proceed[nowgroup][dp][cc].process == INN) {
				ll a;
				cin >> a;
				st.push(a);
			}
			else if (proceed[nowgroup][dp][cc].process == INC) {
				char c;
				cin >> c;
				st.push(c);
			}
			else if (proceed[nowgroup][dp][cc].process == OUTN) {
				ll a = st.top();
				st.pop();
				cout << a;
			}
			else if (proceed[nowgroup][dp][cc].process == OUTC) {
				char a = st.top();
				st.pop();
				cout << a;
			}
			if (flag)
				nowgroup = proceed[nowgroup][dp][cc].next;
		}
	}
	return 0;
}


Measured memory_bytes: 256