#include <bits/stdc++.h>
using namespace std;
int H, M;
inline void EXEC() {
  scanf("%d:%d", &H, &M);
  H %= 12;
  cout << H * 30 + M / 2;
  if (M % 2) cout << ".5";
  cout << " " << M * 6 << endl;
}
int main() {
  EXEC();
  return 0;
}
