#include <bits/stdc++.h>
using namespace std;
using LL = long long;
const double pi = acos(-1.0), eps = 1e-9;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int h, m;
  scanf("%d:%d", &h, &m);
  if (h >= 12) h -= 12;
  double ang = 360 / 12;
  double ang1 = 360 / 12. / 60;
  double ang2 = 360 / 60;
  cout << fixed << h * ang + ang1 * m << ' ' << m * ang2 << '\n';
}
