#include <stdio.h>
//时针一小时走30度
double hour_per_hour_angle = 30.0;
//先算出时针和分钟 一分钟内 分别走多少度数
//时针一分钟走0.5度
double hour_per_minite_angle = 0.5; //360/12/60
//分针一分钟走 6 度
double minite_per_minite_angle = 6.0; //360/12/5
int main()
{
int hour, minite;
while(scanf("%d:%d", &hour, &minite))
{
double hour_angle = (hour * hour_per_hour_angle + minite * hour_per_minite_angle);
double minite_angle = (minite * minite_per_minite_angle);
double angle = hour_angle - minite_angle;
printf("%f, %f, %f\n",hour_angle, minite_angle, angle);
printf("%.1f\n", fabs(angle));
}
return 0;
}