#include <bits/stdc++.h>
int main(void) {
  int h, m;
  double hdeg, mdeg;
  char ch[10];
  while (gets(ch)) {
    sscanf(ch, "%d:%d", &h, &m);
    h %= 12;
    mdeg = 6 * m;
    hdeg = 30 * h + 0.5 * m;
    if (30 * h + 0.5 * m == 360)
      printf("0 0\n");
    else
      printf("%.6g %.6g\n", hdeg, mdeg);
  }
  return 0;
}
