Let $(a_1, a_2,\ldots , a_n)$ be a permutation of $1, 2, \ldots , n,$ where $n \geq 2.$ For each $k = 1, \ldots , n$, we know that $a_k$ apples are placed at the point $k$ on the real axis. Children named $A,B,C$ are assigned respective points $x_A, x_B, x_C \in \{1, \ldots , n\}.$ For each $k,$ the children whose points are closest to $ k$ divide $a_k$ apples equally among themselves. We call $(x_A, x_B, x_C)$ a stable configuration if no child’s total share can be increased by assigning a new point to this child and not changing the points of the other two. Determine the values of $n$ for which a stable configuration exists for some distribution $(a_1, \ldots, a_n)$ of the apples.