#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  int p, q;
  p = n / 36;
  q = n % 36;
  int l = q % 3;
  if (l == 2) {
    if ((q / 3 + 1) == 12) {
      p++;
      q = -3;
    }
    printf("%d %d\n", p, (q / 3 + 1));
  } else if (q / 3 == 12) {
    p++;
    q = 0;
  }
  printf("%d %d\n", p, q / 3);
  return 0;
}
