#include <bits/stdc++.h>
using namespace std;
int main() {
  float minuteAngle = 360 / 12;
  int HH, MM;
  char c;
  cin >> HH >> c >> MM;
  float hd = HH % 12;
  cout << (hd * minuteAngle) + (float)(MM) / 2 << " " << MM * 6 << endl;
  return 0;
}
