#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, m, p;
  double x, y;
  scanf("%d:%d", &h, &m);
  if (h > 11) h = h % 12;
  p = h * 30;
  x = p + (double)m / 2;
  y = 6.0 * m;
  printf("%lf %lf", x, y);
}
