#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, m;
  scanf("%d:%d", &h, &m);
  double dm = (m) / 60.0, dh = (h % 12 + dm) / 12;
  cout << 360 * (dh) << ' ' << 360 * (dm) << endl;
  return 0;
}
