#include <bits/stdc++.h>
using namespace std;
int main() {
  int minutes;
  int hours;
  float hoursAngle;
  float minutesAngle;
  char c;
  cin >> hours >> c >> minutes;
  hours %= 12;
  minutesAngle = minutes * 6;
  hoursAngle = ((((float)minutes) / 60) + hours) * 30;
  cout << hoursAngle << " " << minutesAngle << std::endl;
  return 0;
}
