#include <bits/stdc++.h>
using namespace std;
double PI = 3.14159;
int dX[] = {1, -1, 0, 0};
int dY[] = {0, 0, 1, -1};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  double h, m, angle_h = 0, angle_m = 0;
  char c;
  cin >> h >> c >> m;
  h = fmod(h, 12);
  angle_h = (h + m / 60) * 5;
  angle_h *= 6.0;
  angle_m = m * 6;
  cout << fixed << setprecision(9) << angle_h << " " << angle_m << "\n";
}
