(function(){ async function t(t,e){ e("Kokkeli v0.1"); const i=await t();if("ping"==i||"2019-kuurupiilo"!=i)return;const n=(await t()).split(" ").map(t=>+t),o=n[0],s=n[1],r=[],a=[];for(let t=3;t(a-t.x)*(a-t.x)+(h-t.y)*(h-t.y)<(t.r-32)*(t.r-32))?e=i:(o={x:a,y:h},s=i)}return o}function u(t){return t*t}function l(t,e){return t*t+e*e}function y(t,e,i){return function(t,e,i,n,o,s,r){const a=t-n,h=e-o,c=t-s,y=e-r,f=s-n,k=r-o;if(a*f+h*k>=f*f+k*k)return c*c+y*y<=i*i;if(c*-f+y*-k>=f*f+k*k)return a*a+h*h<=i*i;const p=r-o,d=n-s;return u(p*t+d*e+(s*o-r*n))<=u(i)*l(p,d)}(t.x,t.y,t.r,e.x,e.y,i.x,i.y)}function f(t,e,i){return function(t,e,i){let n=0;for(let o=0;o<360;o+=10)c(t,e,o),n+=r.some(e=>y(e,t,i))?0:1;return n}(t,e,i)+(n=t,o=i,l(2200,2200)/l(n.x-o.x,n.y-o.y));var n,o}if(h.kohde=a[3],a.forEach(t=>t.etsijä==h.etsijä&&(t.nopeus*=.9)),!h.etsijä)for(let i=0;i<100;++i){const i=await t();if(!i||"0"==i)return;e("-800 300")}for(let i=h.etsijä?200:100;;++i){const n=await t();if(!n||"0"==n)break;const o=n.split(" ").map(t=>+t);for(let t=1;t80&&a.forEach(t=>t.piiloutuja&&t.elinaikaa80)h.x==h.kohdeX&&h.y==h.kohdeY&&(h.kohdeX=Math.trunc(1080*Math.cos(s+i%357*Math.PI/180)),h.kohdeY=Math.trunc(1080*Math.sin(s+i%357*Math.PI/180)));else if(!h.etsijä&&h.piilossa>50);else{let t,e;for(let i=0;i<360;i+=5){const n=h.etsijä?h.kohde.elinaikaa:h.elinaikaa,o=c(h,n,i),s=f,r=h.etsijä?s(h.kohde,n,o):-(s(a[0],n,o)+s(a[1],n,o)+s(a[2],n,o)+l(o.x,o.y)/l(110,110));(!e||r>t)&&(t=r,e=o)}h.kohdeX=e.x,h.kohdeY=e.y}if(e(h.kohdeX+" "+h.kohdeY),i%4800==4799)for(let t of r)t.r=Math.trunc(3*t.r/4),t.r<=8&&(t.r=0)}}return"undefined"==typeof window&&async function(){let e=!1,i=[],n=[];const o=t=>{try{process.exit(t)}catch(t){}try{quit(t)}catch(t){}},s=t=>{try{process.stdout.write(t+"\n")}catch(t){}try{print(t)}catch(t){}},r=t=>{n.length?n.shift()(t):i.push(t)},a=()=>{if(!e){try{r(readline())}catch(t){}return i.length?i.shift():new Promise(t=>n.push(t))}};try{require("readline").createInterface({input:process.stdin}).on("line",r).on("close",()=>e=!0)}catch(t){}try{await t(a,s),o(0)}catch(t){s("ERROR: "+t),console.error(t),o(1)}}(),t}())