#include <bits/stdc++.h>
using namespace std;
const int mx = (int)2e5 + 6;
int main() {
  int n;
  cin >> n;
  int f = n / 36;
  int i = ceil((n % 36) / 3.0);
  cout << f << " " << i << endl;
  return 0;
}
