#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, m;
  double x, y;
  scanf("%d:%d", &h, &m);
  h %= 12;
  x = (h * 60.0 + m) / (12.0 * 60) * 360.0;
  y = m / 60.0 * 360;
  printf("%.9lf %.9lf", x, y);
  return 0;
}
