#include <bits/stdc++.h>
using namespace std;
int main() {
  string j;
  stringstream ss;
  double h, m;
  cout.precision(12);
  cin >> j;
  ss << j.substr(0, 2);
  ss >> h;
  ss.clear();
  ss << j.substr(3, 2);
  ss >> m;
  if (h >= 12) h -= 12;
  cout << double(360) / double(12) * (h + m / 60) << " " << 360 / 60 * m
       << endl;
  return 0;
}
