#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[6];
  int h, m;
  float x, y;
  cin >> a;
  h = (a[0] - '0') * 10 + a[1] - '0';
  m = (a[3] - '0') * 10 + a[4] - '0';
  h = (h * 30) % 360;
  printf("%d", h + m / 2);
  if (m % 2) {
    printf(".5");
  }
  m = 6 * m;
  printf(" %d\n", m);
  return 0;
}
