#include <bits/stdc++.h>
using namespace std;
void readInputData();
void run();
int main(int argc, char** argv) {
  ios_base::sync_with_stdio(false);
  readInputData();
  run();
  return 0;
}
int hh;
int mm;
string line;
int str2int(const string& s) {
  int n = 0;
  for (int i = 0; i < s.size(); ++i)
    if (isdigit(s[i])) {
      n = n * 10 + (s[i] - '0');
    }
  return n;
}
void readInputData() {
  getline(cin, line);
  hh = str2int(line.substr(0, 2));
  mm = str2int(line.substr(3, 2));
}
void run() {
  if (hh > 12) hh -= 12;
  hh %= 12;
  double h = hh + mm / 60.0;
  double m = mm / 5.0;
  double alpha1 = h * 30;
  double alpha2 = m * 30;
  cout.precision(9);
  cout << fixed << alpha1 << ' ' << alpha2 << endl;
}
