#include<math.h>

int main(void)
{
	double a, b, h, m,hx,hy,mx,my;
	scanf("%lf %lf %lf %lf",&a,&b,&h,&m);
	printf("%lf %lf\n", h, m);
	h = h * M_PI / 6;
	m = m * M_PI / 30;
	printf("%f %f\n", h,m);

	hx = cos(h)*a;
	hy = sin(h)*a;
	mx = cos(m)*b;
	my = sin(m)*b;

	printf("%lf %lf\n", hx, hy);

	a = hx - mx;
	b = hy - my;
	m = sqrt(a*a+b*b);

	printf("%f",m);

	return 0;
}