#include <bits/stdc++.h>
using namespace std;
int main() {
  double h, m;
  char c;
  cin >> h >> c >> m;
  h = int(h) % 12;
  double a, b;
  a = 6 * m;
  b = 30 * h + (m / 2);
  printf("%f00 %f00\n", b, a);
}
