output_description: Print the minimum number of stones to move to guarantee Takahashi's win;
  otherwise, print `-1` instead.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      A_1 \ldots A_N
attempt: print(0)
  
problem_description: Statement
  
  There are N piles of stones. The i-th pile has A_i stones.
  
  Aoki and Takahashi are about to use them to play the following game:
  
    * Starting with Aoki, the two players alternately do the following operation:
      * Operation: Choose one pile of stones, and remove one or more stones from it.
    * When a player is unable to do the operation, he loses, and the other player wins.
  
  When the two players play optimally, there are two possibilities in this game:
  the player who moves first always wins, or the player who moves second always
  wins, only depending on the initial number of stones in each pile.
  
  In such a situation, Takahashi, the second player to act, is trying to
  guarantee his win by moving at least zero and at most (A_1 - 1) stones from
  the 1-st pile to the 2-nd pile before the game begins.
  
  If this is possible, print the minimum number of stones to move to guarantee
  his victory; otherwise, print `-1` instead.
samples: [{"input": "2\n    5 3", "output": "1\n    \n\nWithout moving stones, if Aoki first removes 2 stones from the 1-st pile,\nTakahashi cannot win in any way.\n\nIf Takahashi moves 1 stone from the 1-st pile to the 2-nd before the game\nbegins so that both piles have 4 stones, Takahashi can always win by properly\nchoosing his actions.\n\n* * *"}, {"input": "2\n    3 5", "output": "-1\n    \n\nIt is not allowed to move stones from the 2-nd pile to the 1-st.\n\n* * *"}, {"input": "3\n    1 1 2", "output": "-1\n    \n\nIt is not allowed to move all stones from the 1-st pile.\n\n* * *"}, {"input": "8\n    10 9 8 7 6 5 4 3", "output": "3\n    \n\n* * *"}, {"input": "3\n    4294967297 8589934593 12884901890", "output": "1\n    \n\nWatch out for overflows."}]