#include <bits/stdc++.h>
using namespace std;
double func(int m) { return 360 * m / (double)12.0; }
int main() {
  string s;
  int m, n;
  cin >> s;
  m = (s[0] - '0') * 10 + s[1] - '0';
  n = (s[3] - '0') * 10 + s[4] - '0';
  cout << 360 * ((m % 12) + (n % 60) / 60.0) / (double)12.0 << " "
       << 360 * (n % 60) / (double)60.0 << endl;
  return 0;
}
