#include <bits/stdc++.h>
using namespace std;
int main() {
  long double h, m, w1 = 0, w2 = 0;
  scanf("%lf:%lf", &h, &m);
  h = int(h) % 12;
  w2 = (360 / 60) * m;
  w1 = (30 * h) + 0.5 * m;
  cout << w1 << ' ' << w2;
  return 0;
}
