#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  string s;
  cin >> s;
  long double h = 10 * (s[0] - '0') + s[1] - '0';
  long double m = 10 * (s[3] - '0') + s[4] - '0';
  m = fmod(m, 60);
  h = fmod(h, 12);
  cout << fixed << setprecision(9);
  cout << (h + m / 60) / 12 * 360 << " " << m / 60 * 360 << "\n";
  return 0;
}
