#include <bits/stdc++.h>
using namespace std;
const int MAXSIZE = 100 + 10;
int main() {
  string s;
  float h, m;
  cin >> s;
  h = (int(s[0]) - 48) * 10 + int(s[1]) - 48;
  m = (int(s[3]) - 48) * 10 + int(s[4]) - 48;
  float ans1, ans2;
  ans2 = m * 6;
  if (h > 12) h -= 12;
  if (h == 12)
    ans1 = (m / 2);
  else
    ans1 = h * 30 + (m / 2);
  cout << ans1 << " " << ans2 << endl;
  return 0;
}
