#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
  scanf("%d:%d", &n, &m);
  if (n >= 12) n -= 12;
  double a1, a2;
  a2 = m * 6;
  a1 = (n + m / 60.0) / 12 * 360;
  cout << a1 << " " << a2 << endl;
}
