#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long hh, mm;
  double hh1, mm1;
  char c;
  cin >> hh >> c >> mm;
  hh1 = ((hh % 12) * 60 + mm) * 0.5;
  mm1 = mm * 6;
  cout << hh1 << " " << mm1;
  return 0;
}
