A, B = map(int, input().split())

def f(X):
  a, b = divmod(X+1, 2)
  return (a%2)^(X*b)

print(f(max(0, A-1))^f(B)) A, B = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split B def f(X):
  a, b = divmod(X+1, 2)
  return (a%2)^(X*b) f a, b = divmod(X+1, 2) a divmod(X+1, 2) divmod X+1 X 1 2 b return (a%2)^(X*b) (a%2)^(X*b) a%2 a 2 X*b X b X X print(f(max(0, A-1))^f(B)) print f(max(0, A-1))^f(B) f(max(0, A-1)) f max(0, A-1) max 0 A-1 A 1 f(B) f B B = map(int, input().split()) map(int, input().split()) B def f(X):
  a, b = divmod(X+1, 2)
  return (a%2)^(X*b) def f(X):
  a, b = divmod(X+1, 2)
  return (a%2)^(X*b) f A, B = map(int, input().split()) map(int, input().split()) A
A, B = map(int, input().split())

def f(X):
  a, b = divmod(X+1, 2)
  return (a%2)^(X*b)

print(f(max(0, A-1))^f(B))