#include <bits/stdc++.h>
int x, y;
char ch[10];
double resx, resy;
int main() {
  scanf("%s", &ch);
  x = (ch[0] - '0') * 10 + ch[1] - '0';
  y = (ch[3] - '0') * 10 + ch[4] - '0';
  if (x >= 12) x -= 12;
  resx = x * 30 + 30 * (double)(y) / (double)(60);
  resy = y * 6;
  printf("%.9lf %.9lf\n", resx, resy);
  return 0;
}
