#include <bits/stdc++.h>
int main() {
  int hh, mm;
  scanf("%d:%d", &hh, &mm);
  double h = 0, m = 0;
  m += (360 / 60) * (mm);
  h += (360 / 12) * (hh % 12);
  h += (mm / 60.0) * (1.0 / 12) * (360);
  printf("%.15f %.15f\n", h, m);
  return 0;
}
