#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, m;
  double dh = 0, dm = 0;
  scanf("%d:%d", &h, &m);
  h %= 12;
  dm = (m / 5.) * 30.;
  dh = h * 30. + (m / 2.);
  cout << fixed << setprecision(10);
  cout << dh << " " << dm << "\n";
  return 0;
}
