#include<stdio.h>
#include<math.h>
#include<stdlib.h>

#define pi  3.141592653589793238462643

int main(){
  double a, b, h, m;
  double atheta, btheta, abtheta;
  double ans;
  scanf("%lf%lf%lf%lf",&a,&b,&h,&m);
  btheta = (m/60)*360;
  atheta = ((h/12) + (m/(60*12)) )*360;
  printf("%lf %lf\n",atheta,btheta);
  
  if(fabs(atheta - btheta) > 180) {
    abtheta = 360 - fabs(atheta - btheta);
  }else {
    abtheta = fabs(atheta - btheta);
  }
  
  printf("%lf\n",abtheta);
  
  ans = sqrt( a*a + b*b - 2*a*b*cosl(abtheta*pi/180));
  printf("%.10lf\n",ans);
  
  return 0;
}