#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, m;
  double x, y;
  char a;
  cin >> h >> a >> m;
  if (h >= 12) h -= 12;
  y = 6.0 * m;
  x = 30.0 * h + m / 2.0;
  cout << x << " " << y << endl;
}
