#include <bits/stdc++.h>
int main() {
  int i, j, k, a, b, c, d;
  char e;
  float sum1, sum2, sum3;
  scanf("%d%c%d", &a, &e, &d);
  sum1 = ((a * 60 + d) % 720) * 1.0;
  sum2 = (d % 60) * 1.0;
  sum1 = sum1 * 360 / 720;
  sum2 = sum2 * 360 / 60;
  printf("%f %f", sum1, sum2);
  return 0;
}
