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