#include <bits/stdc++.h>
using namespace std;
const int oo = (int)1e9;
const double PI = 2 * acos(0.0);
const double eps = 1e-9;
int main() {
  ios_base::sync_with_stdio(false);
  double h, m;
  char c;
  cin >> h >> c >> m;
  h = int(h) % 12;
  double ha, ma;
  ha = 360 * (h + m / 60.0) / 12;
  ma = 360 * m / 60.0;
  cout << ha << " " << ma << endl;
  return 0;
}
