#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const long long inf18 = 1e18 + 7;
const int N = 1e5 + 5;
int main() {
  int n, m, k, l, p;
  scanf("%d:%d", &n, &m);
  n %= 12;
  long double x = 0, y = 0;
  long double one = 6;
  if (m) {
    y += (m)*6;
  }
  x += (n)*30;
  long double mm = m;
  long double dop = mm / 12;
  x += dop * 6;
  cout << x << " " << y;
}
