function f(x,y,z){return(r=t[x,y,z])?r:t[x,y,z]=x>y?f(f(x-5,y,z),f(y-5,z,x),f(z-5,x,y)):z}$0=f($1,$2,$3)