#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long MAX = 1e5 + 7;
const long long inf = 1e18 + 5;
long long fpow(long long n, long long m) {
  long long res = 1;
  while (m > 0) {
    if (m & 1) {
      res *= n;
    }
    m /= 2;
    n *= n;
  }
  return res;
}
const long long nax = 1e5 + 5;
void solve() {
  string s;
  cin >> s;
  long long a, b, temp;
  a = (s[0] - '0') * 10 + (s[1] - '0');
  b = (s[3] - '0') * 10 + (s[4] - '0');
  double hr, min;
  hr = ((double)(a % 12) / 12) * 360;
  min = ((double)(b % 60) / 60) * 360;
  hr += ((double)(b % 60) / 60) * 30;
  cout << setprecision(10) << hr << " " << min << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
