#include <bits/stdc++.h>
using namespace std;
const int N = 2002;
int main() {
  int h, m;
  char c1, c2, c3, c4;
  double r1, r2;
  cin >> c1 >> c2 >> c3 >> c3 >> c4;
  h = (c1 - '0') * 10 + (c2 - '0');
  m = (c3 - '0') * 10 + (c4 - '0');
  h %= 12;
  double hh = h + double(m) / 60;
  r1 = hh / 12.0 * 360;
  r2 = double(m) / 60.0 * 360;
  printf("%0.10f %0.10f\n", r1, r2);
}
