#include <bits/stdc++.h>
int n, feet, inch;
double cmp, base1 = 36, base2 = 3, tmp;
int main() {
  while (scanf("%d", &n) != EOF) {
    printf("%d %d\n", (n + 1) / 36, (n + 1) % 36 / 3);
  }
  return 0;
}
