import java.util.*;
// warm-up
// Simple problem with tight bound checks
public class MeasuringLengthsInBaden {

	static final int FEET=36;
	static final int INCHES=3;

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int f=0, i=0;
		f=n/FEET; n-=(f*FEET); 
		i=n/INCHES; 
		if (i>0) i+=(n==(i*INCHES)) ? 0 : (n%(i*INCHES))==1 ? 0 : 1;
		else i=(n%INCHES)==1 ? 0 : 1;
		System.out.println(f+" "+i);
		sc.close();	
	}

	public static void main(String args[]) {
		solve();
	}

}
