#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, m;
  while (scanf("%d:%d", &h, &m) != EOF) {
    if (h >= 12) {
      h -= 12;
    }
    double y = 6.0 * m;
    double x = 30.0 * h + 0.5 * m;
    printf("%f %f\n", x, y);
  }
  return 0;
}
