#include <bits/stdc++.h>
using namespace std;
int main() {
  double h = 30, m = 0.5;
  string s;
  cin >> s;
  int a = (s[0] - '0') * 10 + (s[1] - '0'),
      b = (s[3] - '0') * 10 + (s[4] - '0');
  if (a >= 12) a -= 12;
  cout << (1.0 * a * h) + (b * 1.0 * m) << " " << b * 6 << endl;
}
