#include <bits/stdc++.h>
using namespace std;
int main() {
  double ans_hour, ans_min;
  string a;
  cin >> a;
  double hour = (a[0] - 48) * 10 + (a[1] - 48);
  double min = (a[3] - 48) * 10 + (a[4] - 48);
  double hours_1 = (min / 60) * 30;
  if (hour >= 12) {
    hour = hour - 12;
  }
  ans_hour = hour * 30 + hours_1;
  ans_min = min * 6;
  cout << ans_hour << " " << ans_min;
  return 0;
}
