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.InputStreamReader;
import java.io.IOException;
import java.text.BreakIterator;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

public class palin {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(System.out);
		Scanner scan = new Scanner(System.in);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {
	public void solve(int testNumber, InputReader in, PrintWriter out) {
		String str[]={"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 m=in.nextInt(),n=in.nextInt();
		System.out.println(str[(m)*33+n]);
	}
}

class InputReader {
	BufferedReader br;
	StringTokenizer st;

	public InputReader(InputStream in) {
		br = new BufferedReader(new InputStreamReader(in));
		st = null;
	}

	public String next() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return st.nextToken();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public long nextLong() {
		return Long.parseLong(next());
	}
}