#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(20);
  string s;
  cin >> s;
  double x = 10 * (s[0] - '0') + s[1] - '0';
  double y = 10 * (s[3] - '0') + s[4] - '0';
  if (x < 12) {
    cout << fixed << x * 30 + y / 2 << " " << 6 * y << setprecision(10) << " ";
  } else {
    cout << fixed << (x - 12) * 30 + y / 2 << " " << 6 * y << setprecision(10)
         << " ";
  }
}
