Tak z _FIXED_ by Mark Byers

a={}
def _(*b):c,d,e=b;f=a[b]=a.get(b,(c<=d)*e)or _(_(c-5,d,e),_(d-5,e,c),_(e-5,c,d));return f
while 1:print _(*map(int,raw_input().split()))

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

download

return top