double x,y;i;main(){for(gets(&x);i=~scanf("%lf%lf",&x,&y);printf("%.9f\n",x)){for(x=atan2(y,x)/atan(1)*45+180;x>51;x-=60);for(;i++<3;gets(&y));}}