import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;

public class Main {
	
	 static int INF=1<<28;
	//int x,y;
	//static int sum=0;
	 
	public static void main(String[] args)throws Exception{
	//	Scanner sc =new Scanner(new File("input.txt"));
		Scanner sc =new Scanner(System.in);
    //  File file = new File("output.txt");
	//	PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(file)));
		sc.useDelimiter("(\\s)+|[,]");
	//	ArrayList<Integer> lis = new ArrayList<Integer>();
    //  for(int i=0;i<;i++)
	
	while(sc.hasNext()){
		
	    int n=ni(sc);
        int x=n/36,y=n%36;
	    
        if(y%3==0){y=y/3; if(y==12){x++;y=0;}}
        else {
           y=y/3+1;	
          if(y==12){x++;	
        	y=0;}
        }
        
       System.out.println(x+" "+y);
	  	
	  	
	    }
	 }
	
	
	
	static void db(Object... os){
	         System.err.println(Arrays.deepToString(os));
	 
	}

	static int ni(Scanner in){
		return in.nextInt();  
	}
		
}

