#include <bits/stdc++.h>
int main() {
  int n, k;
  int inch = 3, f = 12 * inch;
  scanf("%d", &n);
  printf("%d", n / f);
  k = (n % f) / inch;
  if ((n % f) % inch == 2) k++;
  printf(" %d", k);
  return 0;
}
