## https://yukicoder.me/problems/no/353 def main(): A, B = map(int, input().split()) a_array = [] while A > 0: a_array.append(A % 2) A //= 2 b_array =[] while B > 0: b_array.append(B % 2) B //= 2 max_ab_len = max(len(a_array), len(b_array)) carry_over = 0 answer = [] for i in range(max_ab_len): a = 0 if i < len(a_array): a = a_array[i] b = 0 if i < len(b_array): b = b_array[i] if a | b == 0: answer.append(carry_over) carry_over = 0 elif a | b == 1 and a & b == 0: if carry_over == 0: answer.append(a ^ b) else: answer.append(0) carry_over = 1 elif a & b == 1: answer.append(carry_over) carry_over = 1 if carry_over == 1: answer.append(carry_over) ans = 0 for a in reversed(answer): ans <<= 1 ans ^= a print(ans) if __name__ == "__main__": main()