#include <bits/stdc++.h>
using namespace std;
long long int modexp(long long int a, long long int n) {
  long long int r = 1;
  while (n) {
    if (n & 1) r = (r * a) % 1000000007;
    a = (a * a) % 1000000007;
    n >>= 1;
  }
  return r;
}
bool compare(pair<long long int, long long int> p,
             pair<long long int, long long int> q) {
  if (p.first < q.first)
    return true;
  else if (p.first == q.first) {
    if (p.second < q.second) return true;
    return false;
  }
  return false;
}
long long int stoi(string s) {
  long long int ans = 0;
  long long int t = 1;
  for (int i = s.size() - 1; i >= 0; i--) ans += (s[i] - '0') * t, t *= 10;
  return ans;
}
string itos(long long int x) {
  string ans = "";
  while (x > 0) {
    long long int r = x % 10;
    ans += (char)r;
    x = x / 10;
  }
  return ans;
}
long long int w[1000000];
long long int ans[1000000];
long long int get(long long int x) {
  if (x == w[x]) return x;
  return w[x] = get(w[x]);
}
void merge(long long int a, long long int b) {
  a = get(a);
  b = get(b);
  if (a == b) return;
  ans[a] += ans[b];
  w[b] = a;
}
void solve() {
  string s, s1, s2;
  cin >> s;
  long long int h, m;
  h = s[0] - '0';
  h = h * 10 + s[1] - '0';
  m = s[3] - '0';
  m = m * 10 + s[4] - '0';
  if (h >= 12) h -= 12;
  float x = 30 * h + (0.5 * m / 1.0);
  float y = m * 6;
  cout << x << ' ' << y << endl;
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
