import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Solution {

	void solve() throws IOException {
		int n = nextInt();
		int inch = 3, foot = 36, f;
		f = n / foot;
		n %= foot;
		int ost = n % inch;
		n /= inch;
		if (ost == 2)
			n++;
		if (n >= 12) {
			f++;
			n -= 12;
		}
		out.print(f + " " + n);
	}

	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;

	String next() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			String s = br.readLine();
			if (s == null) {
				return "-1";
			}
			st = new StringTokenizer(s);
		}
		return st.nextToken();
	}

	int nextInt() throws IOException {
		return Integer.parseInt(next());
	}

	void run() throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(new OutputStreamWriter(System.out));
		solve();
		br.close();
		out.close();
	}

	public static void main(String[] args) throws IOException {
		new Solution().run();
	}

}
