Tak z _FIXED_ by zetamatta

c={}
def f(x,y,z):r=c[x,y,z]=c.get((x,y,z))or f(f(x-5,y,z),f(y-5,z,x),f(z-5,x,y))if x>y else z;return r
while 1:print f(*[int(e)for e in raw_input().split()])

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

download

return top