#include <bits/stdc++.h>
using namespace std;
const int inf = ~0U >> 1;
template <class T>
bool get_max(T& a, T& b) {
  return b > a ? a = b, 1 : 0;
}
template <class T>
bool get_min(T& a, T& b) {
  return b < a ? a = b, 1 : 0;
}
int h, m;
int main() {
  while (scanf("%d:%d", &h, &m) != EOF) {
    if (h == 0)
      h = 12;
    else if (h > 12)
      h = h - 12;
    if (h == 12) h = 0;
    double a = h * 30.0 + m / 60.0 * 30.0;
    double b = m * 6.0;
    printf("%lf %lf\n", a, b);
  }
  return 0;
}
