Problem: <image>

Input

The input contains two integers a1, a2 (0 ≤ ai ≤ 32), separated by a single space.

Output

Output a single integer.

Examples

Input

1 1


Output

0


Input

3 7


Output

0


Input

13 10


Output

1

Solution (in JAVA):

Solution:

import java.util.*;
import java.lang.*;
import java.io.*;

public class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		int[][] mat = {
        	{1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,0,0,1,0,1,0,0,1,1,1,1,1,1,1} , // tableau [0] de int
        	{1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,0,0,0,1,0,0,0,0,0,1} ,// tableau [1] de int
        	{1,0,1,1,1,0,1,0,0,1,1,0,1,1,0,0,0,0,0,1,1,0,1,0,0,0,1,0,1,1,1,0,1} , //2
        	{1,0,1,1,1,0,1,0,1,0,1,1,0,0,1,0,0,1,1,1,1,1,0,1,0,0,1,0,1,1,1,0,1} , //3
        	{1,0,1,1,1,0,1,0,1,1,0,0,0,1,1,0,0,0,1,1,1,1,0,0,1,0,1,0,1,1,1,0,1} , //4
        	{1,0,0,0,0,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,0,0,0,0,0,1} , //5
        	{1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1} , //6 
        	{0,0,0,0,0,0,0,0,1,1,1,1,1,0,1,1,1,1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0} , //7
			{1,0,0,0,1,0,1,1,1,1,0,0,1,0,0,0,0,1,0,1,1,1,1,0,1,1,1,1,1,1,0,0,1} , //8
			{1,1,0,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,0,0,0,0,1,0,0,0,1,0,1,1,0,0} , //9
			{0,1,1,1,0,0,1,1,1,0,1,0,0,0,0,1,0,1,0,0,0,1,1,1,0,1,0,0,0,1,0,1,0} ,  //10
			{0,1,1,1,1,0,0,0,0,1,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,0,1,1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,1,0} ,//25
			{1,1,1,1,1,1,1,0,1,0,0,0,1,0,1,1,1,1,0,0,0,1,1,0,1,0,1,0,1,1,0,1,0} ,//26
			{1,0,0,0,0,0,1,0,0,1,1,1,0,1,0,1,0,1,1,1,1,1,0,0,1,0,0,0,1,1,0,1,1} ,//27
			{1,0,1,1,1,0,1,0,1,0,0,1,0,1,0,0,0,0,1,0,1,0,0,0,1,1,1,1,1,1,0,0,0} ,//28
			{1,0,1,1,1,0,1,0,0,0,1,1,0,1,0,0,1,0,0,1,0,1,1,1,1,1,1,0,1,1,0,1,0} ,//29
			{1,0,1,1,1,0,1,0,0,1,0,0,0,1,1,0,1,1,1,1,0,1,1,0,1,0,1,1,1,0,0,0,0} ,//30
			{1,0,0,0,0,0,1,0,0,1,1,0,0,1,1,0,0,1,1,1,1,1,0,0,1,1,1,1,0,0,0,0,0} ,//31
			{1,1,1,1,1,1,1,0,1,1,0,1,0,0,0,1,0,1,0,0,1,1,0,1,1,1,0,0,1,0,0,0,1}  //32
    	};
    	
    	Scanner in = new Scanner(System.in);
    	int x = in.nextInt();
    	int y = in.nextInt();
    	
    	System.out.print(mat[x][y]);
    	
	}
}