#include <bits/stdc++.h>
using namespace std;
const int N = 25;
int main(int argc, char *argv[]) {
  int n;
  cin >> n;
  int a = (n + 18) / 36;
  int b = (n - a * 36 + 1) / 3;
  if (b <= 0) {
    --a;
    b = (n - a * 36 + 1) / 3;
  }
  cout << a << " " << b << endl;
  return 0;
}
