#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, m;
  scanf("%d:%d", &h, &m);
  if (h >= 12) h -= 12;
  double ans = 30 * h + ((double)m) / 2;
  cout << ans << " " << m * 6 << endl;
  return 0;
}
