#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
bool cmp(pair<string, int> a, pair<string, int> b) {
  return a.second > b.second;
}
int main() {
  int h, m;
  scanf("%d:%d", &h, &m);
  double a, b;
  b = 6 * m;
  double x;
  x = h % 12;
  x = 30 * x;
  x += 30 / (360 / b);
  printf("%.8lf %lf", x, b);
  return 0;
}
