
import java.util.*;


public class A
{
   public static void main(String[] args)
   {
      new A(new Scanner(System.in));
   }

   public A(Scanner in)
   {
      int n = in.nextInt()+1;
      int feet = n/36;
      int inches = n%36;
      inches /= 3;
      System.out.printf("%d %d%n", feet, inches);
   }
}
