asm("mark\soutchar;outchar;push\s0;return"); asm("mark\soutnum;outnum;push\s0;return"); asm("mark\sreadchar;push\s0;dup;readchar;retrieve;return"); asm("mark\sreadnum;push\s0;dup;readnum;retrieve;return"); asm("mark\snextInt;push\s0;mark\snextIntloop;push\s0;dup;readchar;retrieve;push\s48;sub;dup;jneg\snextIntend;dup;push\s9;swap;sub;jneg\snextIntend;swap;push\s10;mul;add;jump\snextIntloop;mark\snextIntend;disc;return"); var n; var m; var i2; var target = 1; def main() { n <== nextInt(); m <== nextInt(); for(i2 <== 0; *i2 < *m; i2 <== *i2 + 1) { asm("call\snextInt"); } for(i2 <== 0; *i2 < *m; i2 <== *i2 + 1) { asm(".push\n.name\sp"); if(*target > p) { continue; } if (*target == 1) { target <== p; }else{ target <== *target - 1; } } outnum(*target); outchar('\n'); }