Tak z _FIXED_ by hallvabo

def f(x,y,z,t={}):a=x,y,z;v=t[a]=t.get(a)or x>y and f(f(x-5,y,z),f(y-5,z,x),f(z-5,x,y))or z;return v
while 1:print f(*map(int,raw_input().split()))

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

download

return top