#include <bits/stdc++.h>
using namespace std;
bool p[51];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  int m = 0, h = 0;
  double x = 0, y = 0;
  h = (s[0] - '0') * 10, h += (s[1] - '0');
  m = (s[3] - '0') * 10, m += (s[4] - '0');
  x = m * 6.0, h %= 12, y = ((m * 30.0) / 60.0) + (h * 30.0);
  cout << fixed << setprecision(9) << y << " " << x;
  return 0;
}
