Tetration Mod by rotary-o

while(0<1)println{val a=readLine split' '
var i,j=0
def f(m:Int){var n,o=m
2 to'\xe3\x8d\xbf'map{k=>if(o%k<1)n-=n/k
while(o%k<1)o/=k}
n-=n/o%n
if(i<0){i+=1
f(n)
o=j+n}
i-=1
j=BigInt(a(0))modPow(o,m)toInt}
while(j!={f(a(1)toInt)
j})0
~i+" "+j}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

To protect the system from spam, please input your favorite sport (hint: I believe its name must start with 'g', case insensitive)

download

return to the top page