#include <bits/stdc++.h>
using namespace std;
const int NIL = -1;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  double hour, minute;
  char colon;
  cin >> hour >> colon >> minute;
  if (hour >= 12) hour -= 12;
  double hturn = (hour * 30) + (minute * 0.5);
  double mturn = minute * 6;
  cout << hturn << " " << mturn;
  return 0;
}
