#include <bits/stdc++.h>
using namespace std;
const int MAX = 1200;
const int oo = 0x3f3f3f3f;
const double PI = acos(-1.0);
const double eps = 1e-8;
template <typename T>
inline void checkmin(T& a, const T& b) {
  if (a > b) a = b;
}
template <typename T>
inline void checkmax(T& a, const T& b) {
  if (a < b) a = b;
}
int main() {
  int h, m;
  while (scanf("%d:%d", &h, &m) == 2) {
    h %= 12;
    m %= 60;
    printf("%.10f %.10f\n", h * 30.0 + m * 0.5, m * 6.0);
  }
  return 0;
}
