#include <bits/stdc++.h>
using namespace std;
int main() {
  int cm;
  cin >> cm;
  int ft = 36;
  int inch = 3;
  int a, b;
  if ((cm + 1) % ft == 0) {
    a = (cm + 1) / ft;
    b = 0;
  } else if ((cm + 2) % ft == 0) {
    a = (cm + 2) / ft;
    b = 1;
  } else {
    a = cm / ft;
    cm = cm - (a * ft);
    int rem = cm % inch;
    b = cm / inch;
    if (rem == 2) {
      b = b + 1;
    }
  }
  cout << a << " " << b;
}
