#include <bits/stdc++.h>
using namespace std;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int main() {
  int n;
  cin >> n;
  cout << n / 36 << " " << ((n % 36 + 1) / 3) << endl;
  return 0;
}
