import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        if ((n + 1) % 36 == 0)
            n++;
        int f = n / 36;
        n %= 36;
        int inch = n / 3;
        n %= 3;
        if (n > 1)
            inch++;
        System.out.println(f + " " + inch);
    }
}
