#include <bits/stdc++.h>
using namespace std;
const int MaxN = int(2e5);
const long double pi = 3.1415926535897932384626433832795;
int n;
int main() {
  while (scanf("%d", &n) >= 1) {
    int a = n / 36;
    int b = (n - (n / 36) * 36) / 3 + ((n - (n / 36) * 36) % 3 == 2);
    if (b == 12) b = 0, a++;
    printf("%d %d\n", a, b);
  }
  return 0;
}
