main(b,p){while(++b<37)puts((l64a(p)-'\x16\x85\0'?:main)(atoi(),p-1,b,gets()));}