import java.util.*; import java.io.*; import java.math.*; import java.util.regex.Pattern; class Main{ static void solve(){ int a = ni(), b = ni(); if(a == 1 && b == 1) { output.print(2); } else if(a == 1 || b == 1) { int sum = a + b; int ok = sum - Math.abs(a-b); int ng = Math.abs(a-b); output.print(Math.abs(ok-ng)); } else { output.print((a+b)%2==0?0:1); } } /* 関数 */ /* 定数 */ static PrintWriter output; static Scanner sc; static int Inf = 1010101010; static long Lnf = (long)1e18; static final long mod = 1000000007; static final long MOD = 998244353 ; /* 長いやつ */ static String cut(String S , int start, int end) { return S.substring(start,end);} static char cut(String S , int start) { return S.charAt(start);} static String tos(int val) { return Integer.toString(val);} static String tos(long val) { return Long.toString(val);} static int toi(String S) { return Integer.parseInt(S);} static long tol(String S) { return Long.parseLong(S);} /* 実装が面倒なやつ */ public static long factorial(long n){ return n <= 0 ? 1 : n * factorial(n-1); } public static int digits(long n) { return String.valueOf(n).length(); } static boolean kaibun(String S) { StringBuilder s = new StringBuilder(); s.append(S); return s.reverse().toString().equals(S); } static boolean isNumber(String value) { boolean result = false; if (value != null) { Pattern pattern = Pattern.compile("^[0-9]+$|-[0-9]+$"); result = pattern.matcher(value).matches(); } return result; } static Map counter(int [] A) { HashMap count = new HashMap<>(); for(int i=0;i counter(long [] A) { HashMap count = new HashMap<>(); for(int i=0;i