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