Given $n$ stacks of cards, stack $i$ contains $a_i$ cards ($1\le i\le n$) such that each $a_i$ is odd. Two players $A$ and $B$ play a game. Players alternate turns. In a move, a player takes an arbitrary stack and splits it into $3$ new non-empty stacks, such that each of the new stacks still contain odd number of cards. The player who cannot make a move loses. If $A$ goes first, is there any condition on the $a_i$'s to determine who has a winning strategy? It is assumed that both players play optimally.
Thanks for any help.