#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, m, H, M, ans;
  char ch;
  cin >> h >> ch >> m;
  H = (60 * h) + m;
  M = 6 * m;
  if (H / 2 == 360)
    ans = 0;
  else if (H / 2 > 360)
    ans = H / 2 - 360;
  else
    ans = H / 2;
  if (H % 2 == 0)
    cout << ans << " " << M << endl;
  else
    cout << ans << ".5 " << M << endl;
  return 0;
}
