#include <bits/stdc++.h>
using namespace std;
int main() {
  char a1, a2, b1, b2, d;
  cin >> a1 >> a2 >> d >> b1 >> b2;
  double h = (a1 - '0') * 10 + (a2 - '0'), m = (b1 - '0') * 10 + (b2 - '0');
  if (h >= 12) h -= 12;
  double az = m / 2;
  cout << 30 * h + az << " " << 6 * m << endl;
  return 0;
}
