def get_nim_sum(state: tuple[int, ...]) -> int:
  """
  Get the nim sum of a position. See https://www.archimedes-lab.org/How_to_Solve/Win_at_Nim.html

  :param state: the state of the game
  :return: the nim sum of the current position
  """
  cur_sum = 0
  for n in state:
    cur_sum ^= n
  return cur_sum