#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
std::pair<T, U> operator+(const std::pair<T, U>& l, const std::pair<T, U>& r) {
  return {l.first + r.first, l.second + r.second};
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  if (false) {
    freopen("B.in", "r", stdin);
    cerr << "Remember to switch INPUT_FILE off before submitting!" << endl
         << endl;
    freopen("B.out", "w", stdout);
  }
  if (false) {
    cerr << "Remember to switch DEBUGING off before submitting!" << endl
         << endl;
  }
  {
    long long hour, minute;
    char ch;
    cin >> hour >> ch >> minute;
    hour %= 12;
    long double h = hour * 360.0L / 12.0L;
    long double m = minute * 360.0L / 60.0L;
    h += minute * 30.0L / 60.0L;
    cout << h << ' ' << m << endl;
  }
  if (false) {
    system("gnome-open B.in");
    system("gnome-open B.correct");
    system("gnome-open B.out");
    fstream myAns("B.out");
    fstream correctAns("B.correct");
    string myLine, correctLine;
    long long lineIndex = 1;
    bool moreMyAns, moreCorrectAns;
    moreMyAns = (bool)getline(myAns, myLine);
    moreCorrectAns = (bool)getline(correctAns, correctLine);
    while (moreMyAns && moreCorrectAns) {
      cerr << lineIndex++ << "\t" << (myLine == correctLine ? "ok" : "WRONG")
           << endl;
      moreMyAns = (bool)getline(myAns, myLine);
      moreCorrectAns = (bool)getline(correctAns, correctLine);
    }
    if (moreMyAns) {
      cerr << "ERROR: My answer is too long! Excessive lines:" << endl;
      do {
        cerr << lineIndex++ << "\t" << myLine << endl;
      } while (getline(myAns, myLine));
    } else if (moreCorrectAns) {
      cerr << "ERROR: My answer is too short! Missing lines:" << endl;
      do {
        cerr << lineIndex++ << "\t" << correctLine << endl;
      } while (getline(correctAns, correctLine));
    }
    myAns.flush();
    myAns.close();
    correctAns.flush();
    correctAns.close();
  }
  return 0;
}
