#include <bits/stdc++.h>
int main() {
  int h, m;
  scanf("%d:%d", &h, &m);
  double x, y;
  if (h == 12 && m == 0)
    printf("0 0\n");
  else {
    x = (30 * (h % 12)) + (m / 2.0);
    y = 6 * m;
    if (m % 2 == 0)
      printf("%.0lf %.0lf\n", x, y);
    else
      printf("%.1lf %.0lf\n", x, y);
  }
  return 0;
}
