#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const int dx[] = {1, 0, -1, 0, -1, -1, 1, 1};
const int dy[] = {0, 1, 0, -1, -1, 1, -1, 1};
const int OO = INT_MAX;
int main() {
  char time[6];
  cin >> time;
  int h, m;
  sscanf(time, "%d:%d", &h, &m);
  double hourAngle = 6.0 * ((h % 12) * 5 + (double)(m / 12.0));
  double minuteAngle = m * 6.0;
  printf("%.12lf %.12lf\n", hourAngle, minuteAngle);
  return 0;
}
