#include <stdio.h>
#include <math.h>
#define PI 3.141592653589793

int main(void) {
	int A, B, H, M;
	if(scanf("%d %d %d %d", &A, &B, &H, &M) == -1){
      return -1;
    }

	double argA, argB, arg;
	double C;
	double rad;

	argA = ((double)H / 12) * 360;
	argB = ((double)M / 60) * 360;
	
	
	printf("%lf %lf\n", argA, argB);
	if (argA < argB) {
		if (argB - argA > 180) {
			rad = (argB - argA - 180) * PI / 180;
			C = sqrt((double)A * (double)A + (double)B * (double)B - (2 * (double)A * (double)B * cos(rad)));
		}
		else {
			rad = (argB - argA) * PI / 180;
			C = sqrt((double)A * (double)A + (double)B * (double)B - (2 * (double)A * (double)B * cos(rad)));
		}
		
	}
	else {
		if (argA - argB > 180) {
			rad = (argA - argB - 180) * PI / 180;
			C = sqrt((double)A * (double)A + (double)B * (double)B - (2 * (double)A * (double)B * cos(rad)));
		}
		else {
			rad = (argA - argB) * PI / 180;
			C = sqrt((double)A * (double)A + (double)B * (double)B - (2 * (double)A * (double)B * cos(rad)));
		}
	}

	printf("%lf\n", C);
	

	return 0;
}