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