#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  if ((n % 36) % 3 == 2)
    cout << n / 36 << " " << (n % 36) / 3 + 1 << endl;
  else
    cout << n / 36 << " " << (n % 36) / 3 << endl;
  return 0;
}
