#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  getline(cin, s);
  float h = (int(s[0]) - 48) * 10 + (int(s[1]) - 48),
        m = (int(s[3]) - 48) * 10 + (int(s[4]) - 48);
  float a = (h + m / 60) * 30, b = m * 6;
  if (a >= 360) a = a - 360;
  if (b >= 360) b = b - 360;
  cout << setprecision(10) << fixed << a << " " << b << endl;
  return 0;
}
