#include <bits/stdc++.h>
int main() {
  int n, f, i, r, b;
  while (scanf("%d", &n) == 1) {
    b = 0;
    if (n == 0) break;
    if (n % 3 == 2) b = 1;
    i = (n / 3) + b;
    f = i / 12;
    r = i % 12;
    printf("%d %d\n", f, r);
  }
  return 0;
}
