#include <bits/stdc++.h>
using namespace std;
char second[200];
int main() {
  gets(second);
  int h = 10 * (second[0] - '0') + (second[1] - '0');
  int m = 10 * (second[3] - '0') + (second[4] - '0');
  h %= 12;
  double x = 30 * h + m / 2.0, y = 6 * m;
  printf("%.9lf %.9lf", x, y);
  return 0;
}
