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 static java.lang.Double.parseDouble;
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.System.exit;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class B {
	
	static BufferedReader in;
	static PrintWriter out;
	static StringTokenizer tok;
	
	static final String DATA = "111111111111111111111111111111111111111111000000111111000000111111000000111111000000111111111111111111111111111111000000000000111111000000111111000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000111111000000111111000000111111000000111111111111111111111111111111000000000000111111000000111111000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000111111000000111111000000111111000000111111111111111111111111111111000000000000111111000000111111000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000111111000000111111000000111111000000111111111111111111111111111111000000000000111111000000111111000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000111111000000111111000000111111000000111111111111111111111111111111000000000000111111000000111111000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000111111000000111111000000111111000000111111111111111111111111111111000000000000111111000000111111000000000000111111111111111111111111111111111111111111111111000000000000000000000000000000111111000000000000000000000000000000000000000000000000000000000000111111000000111111000000111111111111000000000000000000111111000000000000000000000000000000111111111111000000000000000000000000000000111111000000000000000000000000000000000000000000000000000000000000111111000000111111000000111111111111000000000000000000111111000000000000000000000000000000111111111111000000000000000000000000000000111111000000000000000000000000000000000000000000000000000000000000111111000000111111000000111111111111000000000000000000111111000000000000000000000000000000111111111111000000000000000000000000000000111111000000000000000000000000000000000000000000000000000000000000111111000000111111000000111111111111000000000000000000111111000000000000000000000000000000111111111111000000000000000000000000000000111111000000000000000000000000000000000000000000000000000000000000111111000000111111000000111111111111000000000000000000111111000000000000000000000000000000111111111111000000000000000000000000000000111111000000000000000000000000000000000000000000000000000000000000111111000000111111000000111111111111000000000000000000111111000000000000000000000000000000111111111111000000111111111111111111000000111111000000000000111111111111000000111111111111000000000000000000000000000000111111111111000000111111000000000000000000111111000000111111111111111111000000111111111111000000111111111111111111000000111111000000000000111111111111000000111111111111000000000000000000000000000000111111111111000000111111000000000000000000111111000000111111111111111111000000111111111111000000111111111111111111000000111111000000000000111111111111000000111111111111000000000000000000000000000000111111111111000000111111000000000000000000111111000000111111111111111111000000111111111111000000111111111111111111000000111111000000000000111111111111000000111111111111000000000000000000000000000000111111111111000000111111000000000000000000111111000000111111111111111111000000111111111111000000111111111111111111000000111111000000000000111111111111000000111111111111000000000000000000000000000000111111111111000000111111000000000000000000111111000000111111111111111111000000111111111111000000111111111111111111000000111111000000000000111111111111000000111111111111000000000000000000000000000000111111111111000000111111000000000000000000111111000000111111111111111111000000111111111111000000111111111111111111000000111111000000111111000000111111111111000000000000111111000000000000111111111111111111111111111111000000111111000000000000111111000000111111111111111111000000111111111111000000111111111111111111000000111111000000111111000000111111111111000000000000111111000000000000111111111111111111111111111111000000111111000000000000111111000000111111111111111111000000111111111111000000111111111111111111000000111111000000111111000000111111111111000000000000111111000000000000111111111111111111111111111111000000111111000000000000111111000000111111111111111111000000111111111111000000111111111111111111000000111111000000111111000000111111111111000000000000111111000000000000111111111111111111111111111111000000111111000000000000111111000000111111111111111111000000111111111111000000111111111111111111000000111111000000111111000000111111111111000000000000111111000000000000111111111111111111111111111111000000111111000000000000111111000000111111111111111111000000111111111111000000111111111111111111000000111111000000111111000000111111111111000000000000111111000000000000111111111111111111111111111111000000111111000000000000111111000000111111111111111111000000111111111111000000111111111111111111000000111111000000111111111111000000000000000000111111111111000000000000000000111111111111111111111111000000000000111111000000111111000000111111111111111111000000111111111111000000111111111111111111000000111111000000111111111111000000000000000000111111111111000000000000000000111111111111111111111111000000000000111111000000111111000000111111111111111111000000111111111111000000111111111111111111000000111111000000111111111111000000000000000000111111111111000000000000000000111111111111111111111111000000000000111111000000111111000000111111111111111111000000111111111111000000111111111111111111000000111111000000111111111111000000000000000000111111111111000000000000000000111111111111111111111111000000000000111111000000111111000000111111111111111111000000111111111111000000111111111111111111000000111111000000111111111111000000000000000000111111111111000000000000000000111111111111111111111111000000000000111111000000111111000000111111111111111111000000111111111111000000111111111111111111000000111111000000111111111111000000000000000000111111111111000000000000000000111111111111111111111111000000000000111111000000111111000000111111111111111111000000111111111111000000000000000000000000000000111111000000111111000000111111000000111111000000111111000000111111111111000000111111000000000000000000000000111111000000111111000000000000000000000000000000111111111111000000000000000000000000000000111111000000111111000000111111000000111111000000111111000000111111111111000000111111000000000000000000000000111111000000111111000000000000000000000000000000111111111111000000000000000000000000000000111111000000111111000000111111000000111111000000111111000000111111111111000000111111000000000000000000000000111111000000111111000000000000000000000000000000111111111111000000000000000000000000000000111111000000111111000000111111000000111111000000111111000000111111111111000000111111000000000000000000000000111111000000111111000000000000000000000000000000111111111111000000000000000000000000000000111111000000111111000000111111000000111111000000111111000000111111111111000000111111000000000000000000000000111111000000111111000000000000000000000000000000111111111111000000000000000000000000000000111111000000111111000000111111000000111111000000111111000000111111111111000000111111000000000000000000000000111111000000111111000000000000000000000000000000111111111111111111111111111111111111111111111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000111111111111111111111111111111000000111111111111111111111111111111000000000000111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111000000111111111111111111111111111111000000000000111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111000000111111111111111111111111111111000000000000111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111000000111111111111111111111111111111000000000000111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111000000111111111111111111111111111111000000000000111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111000000111111111111111111111111111111000000000000111111111111111111111111000000000000000000000000000000000000000000000000111111000000000000000000111111000000111111111111111111111111000000000000111111000000000000000000000000111111000000111111111111111111111111000000111111111111111111111111111111111111000000000000111111111111000000000000000000111111000000111111111111111111111111000000000000111111000000000000000000000000111111000000111111111111111111111111000000111111111111111111111111111111111111000000000000111111111111000000000000000000111111000000111111111111111111111111000000000000111111000000000000000000000000111111000000111111111111111111111111000000111111111111111111111111111111111111000000000000111111111111000000000000000000111111000000111111111111111111111111000000000000111111000000000000000000000000111111000000111111111111111111111111000000111111111111111111111111111111111111000000000000111111111111000000000000000000111111000000111111111111111111111111000000000000111111000000000000000000000000111111000000111111111111111111111111000000111111111111111111111111111111111111000000000000111111111111000000000000000000111111000000111111111111111111111111000000000000111111000000000000000000000000111111000000111111111111111111111111000000111111111111111111111111111111111111000000000000111111111111111111000000111111111111111111000000000000111111111111111111111111111111111111111111111111000000000000111111000000000000000000000000111111000000000000000000111111000000111111111111000000000000111111111111000000111111111111111111000000000000111111111111111111111111111111111111111111111111000000000000111111000000000000000000000000111111000000000000000000111111000000111111111111000000000000111111111111000000111111111111111111000000000000111111111111111111111111111111111111111111111111000000000000111111000000000000000000000000111111000000000000000000111111000000111111111111000000000000111111111111000000111111111111111111000000000000111111111111111111111111111111111111111111111111000000000000111111000000000000000000000000111111000000000000000000111111000000111111111111000000000000111111111111000000111111111111111111000000000000111111111111111111111111111111111111111111111111000000000000111111000000000000000000000000111111000000000000000000111111000000111111111111000000000000111111111111000000111111111111111111000000000000111111111111111111111111111111111111111111111111000000000000111111000000000000000000000000111111000000000000000000111111000000111111111111000000000000000000111111111111111111000000000000111111111111111111000000111111000000000000000000000000111111000000111111000000000000000000111111111111111111000000111111000000000000000000111111000000111111000000000000111111111111111111000000000000111111111111111111000000111111000000000000000000000000111111000000111111000000000000000000111111111111111111000000111111000000000000000000111111000000111111000000000000111111111111111111000000000000111111111111111111000000111111000000000000000000000000111111000000111111000000000000000000111111111111111111000000111111000000000000000000111111000000111111000000000000111111111111111111000000000000111111111111111111000000111111000000000000000000000000111111000000111111000000000000000000111111111111111111000000111111000000000000000000111111000000111111000000000000111111111111111111000000000000111111111111111111000000111111000000000000000000000000111111000000111111000000000000000000111111111111111111000000111111000000000000000000111111000000111111000000000000111111111111111111000000000000111111111111111111000000111111000000000000000000000000111111000000111111000000000000000000111111111111111111000000111111000000000000000000111111000000111111000000000000111111111111111111111111000000000000000000000000111111111111000000000000000000111111111111111111111111111111111111000000111111000000111111111111000000000000000000000000000000000000111111111111000000111111111111111111111111000000000000000000000000111111111111000000000000000000111111111111111111111111111111111111000000111111000000111111111111000000000000000000000000000000000000111111111111000000111111111111111111111111000000000000000000000000111111111111000000000000000000111111111111111111111111111111111111000000111111000000111111111111000000000000000000000000000000000000111111111111000000111111111111111111111111000000000000000000000000111111111111000000000000000000111111111111111111111111111111111111000000111111000000111111111111000000000000000000000000000000000000111111111111000000111111111111111111111111000000000000000000000000111111111111000000000000000000111111111111111111111111111111111111000000111111000000111111111111000000000000000000000000000000000000111111111111000000111111111111111111111111000000000000000000000000111111111111000000000000000000111111111111111111111111111111111111000000111111000000111111111111000000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000111111111111111111000000000000111111000000000000111111000000111111111111000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000111111111111111111000000000000111111000000000000111111000000111111111111000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000111111111111111111000000000000111111000000000000111111000000111111111111000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000111111111111111111000000000000111111000000000000111111000000111111111111000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000111111111111111111000000000000111111000000000000111111000000111111111111000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000111111111111111111000000000000111111000000000000111111000000111111111111000000000000000000111111111111111111000000000000000000000000111111000000111111111111111111000000111111000000000000111111111111000000111111000000000000111111111111000000111111000000111111000000000000111111000000000000111111111111111111000000000000000000000000111111000000111111111111111111000000111111000000000000111111111111000000111111000000000000111111111111000000111111000000111111000000000000111111000000000000111111111111111111000000000000000000000000111111000000111111111111111111000000111111000000000000111111111111000000111111000000000000111111111111000000111111000000111111000000000000111111000000000000111111111111111111000000000000000000000000111111000000111111111111111111000000111111000000000000111111111111000000111111000000000000111111111111000000111111000000111111000000000000111111000000000000111111111111111111000000000000000000000000111111000000111111111111111111000000111111000000000000111111111111000000111111000000000000111111111111000000111111000000111111000000000000111111000000000000111111111111111111000000000000000000000000111111000000111111111111111111000000111111000000000000111111111111000000111111000000000000111111111111000000111111000000111111000000000000111111000000000000111111000000111111000000111111000000111111000000000000000000111111000000111111111111000000000000111111000000111111111111000000111111000000111111000000111111000000000000000000000000000000111111000000111111000000111111000000111111000000111111000000000000000000111111000000111111111111000000000000111111000000111111111111000000111111000000111111000000111111000000000000000000000000000000111111000000111111000000111111000000111111000000111111000000000000000000111111000000111111111111000000000000111111000000111111111111000000111111000000111111000000111111000000000000000000000000000000111111000000111111000000111111000000111111000000111111000000000000000000111111000000111111111111000000000000111111000000111111111111000000111111000000111111000000111111000000000000000000000000000000111111000000111111000000111111000000111111000000111111000000000000000000111111000000111111111111000000000000111111000000111111111111000000111111000000111111000000111111000000000000000000000000000000111111000000111111000000111111000000111111000000111111000000000000000000111111000000111111111111000000000000111111000000111111111111000000111111000000111111000000111111000000000000000000000000000000111111000000111111000000111111111111000000000000000000000000000000111111000000111111000000111111000000000000000000111111111111111111111111111111000000111111000000000000000000000000000000000000000000000000000000111111000000111111111111000000000000000000000000000000111111000000111111000000111111000000000000000000111111111111111111111111111111000000111111000000000000000000000000000000000000000000000000000000111111000000111111111111000000000000000000000000000000111111000000111111000000111111000000000000000000111111111111111111111111111111000000111111000000000000000000000000000000000000000000000000000000111111000000111111111111000000000000000000000000000000111111000000111111000000111111000000000000000000111111111111111111111111111111000000111111000000000000000000000000000000000000000000000000000000111111000000111111111111000000000000000000000000000000111111000000111111000000111111000000000000000000111111111111111111111111111111000000111111000000000000000000000000000000000000000000000000000000111111000000111111111111000000000000000000000000000000111111000000111111000000111111000000000000000000111111111111111111111111111111000000111111000000000000000000000000000000000000000000000000000000000000000000000000000000111111000000111111000000000000000000111111111111000000000000111111111111000000111111000000000000000000111111111111111111111111000000111111000000111111111111000000111111000000000000000000000000000000111111000000111111000000000000000000111111111111000000000000111111111111000000111111000000000000000000111111111111111111111111000000111111000000111111111111000000111111000000000000000000000000000000111111000000111111000000000000000000111111111111000000000000111111111111000000111111000000000000000000111111111111111111111111000000111111000000111111111111000000111111000000000000000000000000000000111111000000111111000000000000000000111111111111000000000000111111111111000000111111000000000000000000111111111111111111111111000000111111000000111111111111000000111111000000000000000000000000000000111111000000111111000000000000000000111111111111000000000000111111111111000000111111000000000000000000111111111111111111111111000000111111000000111111111111000000111111000000000000000000000000000000111111000000111111000000000000000000111111111111000000000000111111111111000000111111000000000000000000111111111111111111111111000000111111000000111111111111000000111111000000111111000000111111000000000000111111000000000000111111111111111111111111111111000000111111111111111111111111000000000000000000111111000000111111000000111111000000000000000000111111111111111111000000111111000000111111000000000000111111000000000000111111111111111111111111111111000000111111111111111111111111000000000000000000111111000000111111000000111111000000000000000000111111111111111111000000111111000000111111000000000000111111000000000000111111111111111111111111111111000000111111111111111111111111000000000000000000111111000000111111000000111111000000000000000000111111111111111111000000111111000000111111000000000000111111000000000000111111111111111111111111111111000000111111111111111111111111000000000000000000111111000000111111000000111111000000000000000000111111111111111111000000111111000000111111000000000000111111000000000000111111111111111111111111111111000000111111111111111111111111000000000000000000111111000000111111000000111111000000000000000000111111111111111111000000111111000000111111000000000000111111000000000000111111111111111111111111111111000000111111111111111111111111000000000000000000111111000000111111000000111111000000000000000000111111111111111111000000111111000000111111111111000000111111111111111111111111111111111111111111000000000000000000111111000000000000111111000000000000000000000000111111111111111111000000000000000000111111000000000000000000111111000000111111111111000000111111111111111111111111111111111111111111000000000000000000111111000000000000111111000000000000000000000000111111111111111111000000000000000000111111000000000000000000111111000000111111111111000000111111111111111111111111111111111111111111000000000000000000111111000000000000111111000000000000000000000000111111111111111111000000000000000000111111000000000000000000111111000000111111111111000000111111111111111111111111111111111111111111000000000000000000111111000000000000111111000000000000000000000000111111111111111111000000000000000000111111000000000000000000111111000000111111111111000000111111111111111111111111111111111111111111000000000000000000111111000000000000111111000000000000000000000000111111111111111111000000000000000000111111000000000000000000111111000000111111111111000000111111111111111111111111111111111111111111000000000000000000111111000000000000111111000000000000000000000000111111111111111111000000000000000000111111000000000000000000000000000000000000000000111111000000000000111111111111000000000000000000111111000000000000111111111111000000000000000000000000000000111111111111000000111111000000000000000000000000000000111111000000000000000000000000000000111111000000000000111111111111000000000000000000111111000000000000111111111111000000000000000000000000000000111111111111000000111111000000000000000000000000000000111111000000000000000000000000000000111111000000000000111111111111000000000000000000111111000000000000111111111111000000000000000000000000000000111111111111000000111111000000000000000000000000000000111111000000000000000000000000000000111111000000000000111111111111000000000000000000111111000000000000111111111111000000000000000000000000000000111111111111000000111111000000000000000000000000000000111111000000000000000000000000000000111111000000000000111111111111000000000000000000111111000000000000111111111111000000000000000000000000000000111111111111000000111111000000000000000000000000000000111111000000000000000000000000000000111111000000000000111111111111000000000000000000111111000000000000111111111111000000000000000000000000000000111111111111000000111111000000000000000000000000000000111111000000000000000000111111111111000000111111111111000000111111000000000000111111111111000000111111111111111111000000000000111111000000000000111111000000000000111111111111000000111111111111000000000000000000000000000000111111111111000000111111111111000000111111000000000000111111111111000000111111111111111111000000000000111111000000000000111111000000000000111111111111000000111111111111000000000000000000000000000000111111111111000000111111111111000000111111000000000000111111111111000000111111111111111111000000000000111111000000000000111111000000000000111111111111000000111111111111000000000000000000000000000000111111111111000000111111111111000000111111000000000000111111111111000000111111111111111111000000000000111111000000000000111111000000000000111111111111000000111111111111000000000000000000000000000000111111111111000000111111111111000000111111000000000000111111111111000000111111111111111111000000000000111111000000000000111111000000000000111111111111000000111111111111000000000000000000000000000000111111111111000000111111111111000000111111000000000000111111111111000000111111111111111111000000000000111111000000000000111111000000000000111111111111000000111111111111000000000000000000000000111111111111111111000000111111000000111111111111000000111111000000000000000000111111000000000000000000111111111111111111111111000000111111000000111111000000111111000000000000111111111111000000000000111111111111111111000000111111000000111111111111000000111111000000000000000000111111000000000000000000111111111111111111111111000000111111000000111111000000111111000000000000111111111111000000000000111111111111111111000000111111000000111111111111000000111111000000000000000000111111000000000000000000111111111111111111111111000000111111000000111111000000111111000000000000111111111111000000000000111111111111111111000000111111000000111111111111000000111111000000000000000000111111000000000000000000111111111111111111111111000000111111000000111111000000111111000000000000111111111111000000000000111111111111111111000000111111000000111111111111000000111111000000000000000000111111000000000000000000111111111111111111111111000000111111000000111111000000111111000000000000111111111111000000000000111111111111111111000000111111000000111111111111000000111111000000000000000000111111000000000000000000111111111111111111111111000000111111000000111111000000111111000000000000111111111111000000111111111111111111000000111111000000111111000000000000111111111111000000000000111111111111111111000000111111000000000000111111111111000000111111000000000000000000000000000000111111111111111111000000111111111111111111000000111111000000111111000000000000111111111111000000000000111111111111111111000000111111000000000000111111111111000000111111000000000000000000000000000000111111111111111111000000111111111111111111000000111111000000111111000000000000111111111111000000000000111111111111111111000000111111000000000000111111111111000000111111000000000000000000000000000000111111111111111111000000111111111111111111000000111111000000111111000000000000111111111111000000000000111111111111111111000000111111000000000000111111111111000000111111000000000000000000000000000000111111111111111111000000111111111111111111000000111111000000111111000000000000111111111111000000000000111111111111111111000000111111000000000000111111111111000000111111000000000000000000000000000000111111111111111111000000111111111111111111000000111111000000111111000000000000111111111111000000000000111111111111111111000000111111000000000000111111111111000000111111000000000000000000000000000000111111111111111111000000111111111111000000000000000000111111000000111111000000000000111111000000111111000000111111111111111111111111000000000000000000111111000000111111111111111111111111111111111111111111000000000000000000111111111111000000000000000000111111000000111111000000000000111111000000111111000000111111111111111111111111000000000000000000111111000000111111111111111111111111111111111111111111000000000000000000111111111111000000000000000000111111000000111111000000000000111111000000111111000000111111111111111111111111000000000000000000111111000000111111111111111111111111111111111111111111000000000000000000111111111111000000000000000000111111000000111111000000000000111111000000111111000000111111111111111111111111000000000000000000111111000000111111111111111111111111111111111111111111000000000000000000111111111111000000000000000000111111000000111111000000000000111111000000111111000000111111111111111111111111000000000000000000111111000000111111111111111111111111111111111111111111000000000000000000111111111111000000000000000000111111000000111111000000000000111111000000111111000000111111111111111111111111000000000000000000111111000000111111111111111111111111111111111111111111000000000000000000000000000000111111000000000000000000111111111111111111000000111111111111111111000000000000000000000000111111000000111111000000111111111111000000111111111111111111111111111111000000000000000000000000000000000000111111000000000000000000111111111111111111000000111111111111111111000000000000000000000000111111000000111111000000111111111111000000111111111111111111111111111111000000000000000000000000000000000000111111000000000000000000111111111111111111000000111111111111111111000000000000000000000000111111000000111111000000111111111111000000111111111111111111111111111111000000000000000000000000000000000000111111000000000000000000111111111111111111000000111111111111111111000000000000000000000000111111000000111111000000111111111111000000111111111111111111111111111111000000000000000000000000000000000000111111000000000000000000111111111111111111000000111111111111111111000000000000000000000000111111000000111111000000111111111111000000111111111111111111111111111111000000000000000000000000000000000000111111000000000000000000111111111111111111000000111111111111111111000000000000000000000000111111000000111111000000111111111111000000111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111000000000000111111000000111111111111000000111111000000000000000000111111000000111111000000000000000000111111000000111111111111000000000000000000000000000000000000000000000000000000111111111111111111000000000000111111000000111111111111000000111111000000000000000000111111000000111111000000000000000000111111000000111111111111000000000000000000000000000000000000000000000000000000111111111111111111000000000000111111000000111111111111000000111111000000000000000000111111000000111111000000000000000000111111000000111111111111000000000000000000000000000000000000000000000000000000111111111111111111000000000000111111000000111111111111000000111111000000000000000000111111000000111111000000000000000000111111000000111111111111000000000000000000000000000000000000000000000000000000111111111111111111000000000000111111000000111111111111000000111111000000000000000000111111000000111111000000000000000000111111000000111111111111000000000000000000000000000000000000000000000000000000111111111111111111000000000000111111000000111111111111000000111111000000000000000000111111000000111111000000000000000000111111000000111111111111000000111111111111111111111111111111111111111111000000111111000000000000000000111111000000111111111111111111111111000000000000000000111111111111000000111111000000111111000000111111111111000000111111000000111111111111111111111111111111111111111111000000111111000000000000000000111111000000111111111111111111111111000000000000000000111111111111000000111111000000111111000000111111111111000000111111000000111111111111111111111111111111111111111111000000111111000000000000000000111111000000111111111111111111111111000000000000000000111111111111000000111111000000111111000000111111111111000000111111000000111111111111111111111111111111111111111111000000111111000000000000000000111111000000111111111111111111111111000000000000000000111111111111000000111111000000111111000000111111111111000000111111000000111111111111111111111111111111111111111111000000111111000000000000000000111111000000111111111111111111111111000000000000000000111111111111000000111111000000111111000000111111111111000000111111000000111111111111111111111111111111111111111111000000111111000000000000000000111111000000111111111111111111111111000000000000000000111111111111000000111111000000111111000000111111111111000000111111000000111111000000000000000000000000000000111111000000000000111111111111111111000000111111000000111111000000111111111111111111111111111111000000000000111111000000000000000000111111111111000000111111111111111111000000000000000000000000000000111111000000000000111111111111111111000000111111000000111111000000111111111111111111111111111111000000000000111111000000000000000000111111111111000000111111111111111111000000000000000000000000000000111111000000000000111111111111111111000000111111000000111111000000111111111111111111111111111111000000000000111111000000000000000000111111111111000000111111111111111111000000000000000000000000000000111111000000000000111111111111111111000000111111000000111111000000111111111111111111111111111111000000000000111111000000000000000000111111111111000000111111111111111111000000000000000000000000000000111111000000000000111111111111111111000000111111000000111111000000111111111111111111111111111111000000000000111111000000000000000000111111111111000000111111111111111111000000000000000000000000000000111111000000000000111111111111111111000000111111000000111111000000111111111111111111111111111111000000000000111111000000000000000000111111111111000000111111111111111111000000111111111111111111000000111111000000111111000000000000111111000000111111000000000000000000000000111111000000111111000000000000000000111111111111111111111111111111111111000000000000000000111111000000111111111111111111000000111111000000111111000000000000111111000000111111000000000000000000000000111111000000111111000000000000000000111111111111111111111111111111111111000000000000000000111111000000111111111111111111000000111111000000111111000000000000111111000000111111000000000000000000000000111111000000111111000000000000000000111111111111111111111111111111111111000000000000000000111111000000111111111111111111000000111111000000111111000000000000111111000000111111000000000000000000000000111111000000111111000000000000000000111111111111111111111111111111111111000000000000000000111111000000111111111111111111000000111111000000111111000000000000111111000000111111000000000000000000000000111111000000111111000000000000000000111111111111111111111111111111111111000000000000000000111111000000111111111111111111000000111111000000111111000000000000111111000000111111000000000000000000000000111111000000111111000000000000000000111111111111111111111111111111111111000000000000000000111111000000111111111111111111000000111111000000000000000000111111111111000000111111000000000000111111000000000000111111000000111111111111111111111111111111111111000000111111111111000000111111000000111111000000111111111111111111000000111111000000000000000000111111111111000000111111000000000000111111000000000000111111000000111111111111111111111111111111111111000000111111111111000000111111000000111111000000111111111111111111000000111111000000000000000000111111111111000000111111000000000000111111000000000000111111000000111111111111111111111111111111111111000000111111111111000000111111000000111111000000111111111111111111000000111111000000000000000000111111111111000000111111000000000000111111000000000000111111000000111111111111111111111111111111111111000000111111111111000000111111000000111111000000111111111111111111000000111111000000000000000000111111111111000000111111000000000000111111000000000000111111000000111111111111111111111111111111111111000000111111111111000000111111000000111111000000111111111111111111000000111111000000000000000000111111111111000000111111000000000000111111000000000000111111000000111111111111111111111111111111111111000000111111111111000000111111000000111111000000111111111111111111000000111111000000000000111111000000000000000000111111111111000000111111111111111111111111000000111111111111000000111111000000111111111111111111000000000000000000000000111111000000111111111111111111000000111111000000000000111111000000000000000000111111111111000000111111111111111111111111000000111111111111000000111111000000111111111111111111000000000000000000000000111111000000111111111111111111000000111111000000000000111111000000000000000000111111111111000000111111111111111111111111000000111111111111000000111111000000111111111111111111000000000000000000000000111111000000111111111111111111000000111111000000000000111111000000000000000000111111111111000000111111111111111111111111000000111111111111000000111111000000111111111111111111000000000000000000000000111111000000111111111111111111000000111111000000000000111111000000000000000000111111111111000000111111111111111111111111000000111111111111000000111111000000111111111111111111000000000000000000000000111111000000111111111111111111000000111111000000000000111111000000000000000000111111111111000000111111111111111111111111000000111111111111000000111111000000111111111111111111000000000000000000000000111111000000000000000000000000000000111111000000000000111111111111000000000000111111111111000000000000111111111111111111111111111111000000000000111111111111111111111111000000000000000000000000000000111111000000000000000000000000000000111111000000000000111111111111000000000000111111111111000000000000111111111111111111111111111111000000000000111111111111111111111111000000000000000000000000000000111111000000000000000000000000000000111111000000000000111111111111000000000000111111111111000000000000111111111111111111111111111111000000000000111111111111111111111111000000000000000000000000000000111111000000000000000000000000000000111111000000000000111111111111000000000000111111111111000000000000111111111111111111111111111111000000000000111111111111111111111111000000000000000000000000000000111111000000000000000000000000000000111111000000000000111111111111000000000000111111111111000000000000111111111111111111111111111111000000000000111111111111111111111111000000000000000000000000000000111111000000000000000000000000000000111111000000000000111111111111000000000000111111111111000000000000111111111111111111111111111111000000000000111111111111111111111111000000000000000000000000000000111111111111111111111111111111111111111111000000111111111111000000111111000000000000000000111111000000111111000000000000111111111111000000111111111111111111000000000000111111000000000000000000111111111111111111111111111111111111111111111111000000111111111111000000111111000000000000000000111111000000111111000000000000111111111111000000111111111111111111000000000000111111000000000000000000111111111111111111111111111111111111111111111111000000111111111111000000111111000000000000000000111111000000111111000000000000111111111111000000111111111111111111000000000000111111000000000000000000111111111111111111111111111111111111111111111111000000111111111111000000111111000000000000000000111111000000111111000000000000111111111111000000111111111111111111000000000000111111000000000000000000111111111111111111111111111111111111111111111111000000111111111111000000111111000000000000000000111111000000111111000000000000111111111111000000111111111111111111000000000000111111000000000000000000111111111111111111111111111111111111111111111111000000111111111111000000111111000000000000000000111111000000111111000000000000111111111111000000111111111111111111000000000000111111000000000000000000111111";
	
	static void solve() throws Exception {
		int y = nextInt() * 6;
		int x = nextInt() * 6;
		out.println(DATA.charAt(x + y * 198));
	}
	
	static int nextInt() throws IOException {
		return parseInt(next());
	}

	static long nextLong() throws IOException {
		return parseLong(next());
	}

	static double nextDouble() throws IOException {
		return parseDouble(next());
	}

	static String next() throws IOException {
		while (tok == null || !tok.hasMoreTokens()) {
			tok = new StringTokenizer(in.readLine());
		}
		return tok.nextToken();
	}

	public static void main(String[] args) {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(new OutputStreamWriter(System.out));
			solve();
			in.close();
			out.close();
		} catch (Throwable e) {
			e.printStackTrace();
			exit(1);
		}
	}
}