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