#include <bits/stdc++.h>
const int inf = (int)1e9;
const int mod = (int)1e9 + 7;
const long long infll = (long long)1e18;
const long double eps = 1e-9;
using namespace std;
long double get_area_2(pair<long double, long double> a,
                       pair<long double, long double> b,
                       pair<long double, long double> c) {
  return ((b.first - a.first) * (c.second - a.second) -
          (c.first - a.first) * (b.second - a.second));
}
void solve() {
  int h, m;
  scanf("%d:%d", &h, &m);
  h %= 12;
  long double ha = (long double)0.5 * (long double)(h * 60 + m);
  long double ma = ((360 / 60) * m);
  printf("%Lf %Lf", ha, ma);
}
int main(const int argc, const char** argv) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
