#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int a, b;
  a = (s[0] - 48) * 10 + (s[1] - 48);
  b = (s[3] - 48) * 10 + (s[4] - 48);
  float c, d;
  c = (float)a * 30 + (float)b * 0.5;
  d = (float)b * 6;
  if ((a == 12) || (c >= 360)) c = c - 360;
  cout << c << " " << d;
  return 0;
}
