#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, h, min;
  char delim;
  cin >> h >> delim >> min;
  h %= 12;
  cout << 360.0 * h / 12 + 30.0 * min / 60 << " " << 360.0 * min / 60 << endl;
  return 0;
}
