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.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.StringTokenizer;

public class Solver {

	public static void main(String[] Args) throws NumberFormatException,
			IOException {
		new Solver().Run();
	}

	PrintWriter pw;
	StringTokenizer Stok;
	BufferedReader br;

	public String nextToken() throws IOException {
		while (Stok == null || !Stok.hasMoreTokens()) {
			Stok = new StringTokenizer(br.readLine());
		}
		return Stok.nextToken();
	}

	public int nextInt() throws NumberFormatException, IOException {
		return Integer.parseInt(nextToken());
	}

	public double nextDouble() throws NumberFormatException, IOException {
		return Double.parseDouble(nextToken());
	}

	public long nextLong() throws NumberFormatException, IOException {
		return Long.parseLong(nextToken());
	}

	public void Run() throws NumberFormatException, IOException {
		//br = new BufferedReader(new FileReader("input.txt"));
		//pw = new PrintWriter("output.txt");
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(new OutputStreamWriter(System.out));
		char[][] qr = {{'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',},
				{'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',},
				{'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',},
				{'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',},
				{'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',},
				{'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',},
				{'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',},
				{'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',},
				{'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',},
				{'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',},
				{'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',},
				{'0','1','1','1','1','0','0','0','0','1','1','0','0','0','1','1','1','1','1','1','0','1','0','1','1','0','0','0','0','0','0','1','1',},
				{'1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','0','0','0','1','1','1','0','0','1','0','0','1','0','1','1','0','0','0',},
				{'1','1','1','0','0','0','0','1','0','1','1','1','0','1','0','0','1','1','0','1','0','0','1','1','0','1','0','1','0','0','1','0','0',},
				{'1','0','1','0','1','0','1','0','0','0','1','0','1','1','0','0','1','0','1','1','0','1','0','1','0','1','0','0','0','0','0','1','0',},
				{'1','0','1','1','0','0','0','0','0','1','0','1','0','1','0','0','0','1','1','1','1','1','0','1','0','0','0','0','0','0','0','0','0',},
				{'0','0','0','0','1','0','1','0','0','0','1','1','0','0','1','1','0','1','0','0','0','1','1','1','1','0','1','0','1','1','0','1','0',},
				{'1','0','1','0','0','1','0','0','1','1','1','1','1','0','1','1','1','1','0','0','0','1','0','1','0','1','0','0','0','1','1','1','0',},
				{'1','0','1','1','0','1','1','1','1','1','1','1','0','0','0','1','0','0','1','0','0','0','0','1','1','1','0','0','0','1','0','0','0',},
				{'0','0','0','0','1','0','0','1','1','0','0','0','1','0','0','1','1','0','0','0','0','0','1','1','0','1','0','0','0','0','0','1','0',},
				{'0','0','1','1','0','1','1','0','1','0','0','1','1','0','1','1','1','0','0','1','0','0','1','0','0','1','1','0','1','1','0','0','0',},
				{'0','1','1','1','0','1','0','1','1','0','1','0','0','0','1','0','0','0','1','1','1','1','0','1','0','1','0','1','0','0','1','1','0',},
				{'1','1','1','0','1','0','1','0','0','1','1','0','0','1','1','1','0','1','0','0','1','1','0','1','0','0','0','0','0','1','1','1','0',},
				{'1','1','0','0','0','1','0','1','0','0','1','0','1','0','1','1','1','1','0','0','0','1','0','1','1','1','1','1','1','1','0','0','0',},
				{'0','0','1','0','0','0','1','1','1','0','1','1','1','0','0','0','0','1','0','1','0','1','1','0','1','1','1','1','1','0','0','0','0',},
				{'0','0','0','0','0','0','0','0','1','1','1','0','0','1','0','1','1','0','1','0','0','0','1','0','1','0','0','0','1','0','1','1','0',},
				{'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',},
				{'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',},
				{'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',},
				{'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',},
				{'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',},
				{'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',},
				{'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'}};
		int i = nextInt(),j = nextInt();
		pw.print(qr[i][j]);
		pw.flush();
		pw.close();
	}

}