#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int hr = s[0] - '0';
  hr = hr * 10 + s[1] - '0';
  if (hr >= 12) hr -= 12;
  int min = s[3] - '0';
  min = min * 10 + s[4] - '0';
  double b = min * 6;
  double a = ((double)hr + (double)min / 60) * 30;
  printf("%.9lf %.9lf", a, b);
}
