#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int MOD2 = 15000007;
const long long int MAX = 9187201950435737471;
const int N = 100005;
const int M = 100005;
const int INF = 2;
const double EPS = 1e-9;
const long double PI = acos(-1);
long long int po(long long int x, long long int y) {
  x %= MOD;
  long long int ret = 1;
  while (y > 0) {
    if (y & 1) {
      ret = (ret * x) % MOD;
    }
    y = y >> 1ll;
    x = (x * x) % MOD;
  }
  return ret;
}
void solve(int T) {
  string s;
  cin >> s;
  int a, b;
  double h, m;
  a = (s[0] - '0') * 10 + (s[1] - '0');
  b = (s[3] - '0') * 10 + (s[4] - '0');
  a %= 12;
  h = a;
  m = b;
  double per = m / 60;
  h += per;
  double ansh = h * 360.0 / 12.0;
  double ansm = m * 360.0 / 60.0;
  cout << fixed << setprecision(12) << ansh << " " << ansm;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int T = 1;
  for (int i = 1; i <= T; i++) {
    solve(i);
  }
  return 0;
}
