#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a, b;
  while (~scanf("%d", &n)) {
    a = b = 0;
    a = (n + 1) / 36;
    b = (n - (a * 36) + 1) / 3;
    printf("%d %d\n", a, b);
  }
  return 0;
}
