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