#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[10];
  int m, h;
  scanf("%s", s);
  h = (s[0] - '0') * 10 + (s[1] - '0');
  m = (s[3] - '0') * 10 + (s[4] - '0');
  if (h > 12) h = h - 12;
  cout << (h * 30) % 360 + (m * 1.0) / 2 << " " << (m * 6) % 360;
  return 0;
}
