#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, h, M;
  scanf("%d:%d", &h, &m);
  double H;
  if (h >= 12) h = h - 12;
  M = m * 6;
  H = h * 30 + double(m) / 2.00;
  cout << H << " " << M << endl;
  return 0;
}
