The game of Nim (2)

This is another problem about the game of Nim, which is thoroughly
explained in
problem problem://problemsjutge.org:problems/upc/2004-semi1/5.pbm. But
here, we may have a huge number of sets, each with a huge number of
marbles.

Input

Input consists of several cases. Every case begins with the number of
sets n, followed by the number of marbles of each set, all between 0 and
10⁹. Assume 0 ≤ n ≤ 10⁵.

Output

For every case, tell if it is a winning or a losing configuration.

Hint

You should use a mathematical trick to solve this problem.

Problem information

Author: Salvador Roura

Generation: 2026-01-25T11:29:27.945Z

© Jutge.org, 2006–2026.
https://jutge.org
