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