Editorial-TAKENOTLESS

Let X = max(A_1, A_2, \ldots, A_N). If X appears in A an odd number of times, Marichka can win by taking some pile with X stones completely in the first move. Then all players will be forced to keep taking other piles with X stones, and Marichka will win.

If X appears in A an even number of times, however, then, whoever is the first to take some stones from some pile with X stones, loses. Indeed, then his opponent would follow the strategy of Marichka from the previous paragraph.

So, if X appears an even number of times, we can discard all piles with X stones, as whoever is the first to take stones from them loses. Then we can look at the second-largest value among A_1, A_2, \ldots, A_N), and so on. Overall, Marichka will win if some size of a pile appears an odd number of times, and Zenyk will win only if all frequencies of sizes are even.