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