#include<stdio.h>
#include<math.h>
#define PI 3.1415926
int main() {
double x, y, z, hc, ac;
scanf("%lf %lf %lf", &x, &y, &z);
x = x * PI / 180;
y = y * PI / 180;
z = z * PI / 180;
hc = asin(sin(x) * sin(y) + cos(x) * cos(y) * cos(z));
double temp = cos(x) * tan(y) / (2 * sin(2 / z) * cos(2 / z)) - sin(x) / tan(z);
ac = atan(1 / temp);
hc = hc * 180 / PI;
ac = ac * 180 / PI;
printf("%f %f", hc, ac);
return 0;
}