Beklemishev's worms

Beklemishev's worms are a construction described by Lev D. Beklemishev very similar to Kirby-Paris hydras.

Description
A worm is simply a list of nonnegative integers \([W_1, W_2, \ldots, W_n]\). In a game Beklemishev calls "the Worm battle," our hero Cedric is presented with an arbitrary worm \(W\), and his task is to reduce it to an empty list. On turn \(t\) of the game:


 * If the last element of the worm is zero, it is removed (Cedric chops off its head).
 * Otherwise, the last element of the worm is first reduced by one, and the worm grows back according to the following process:
 * Let \(k\) be the index of the maximal element amongst \(W_1, W_2, \ldots, W_{n - 1}\).
 * The worm is then divided into a good part \(g = [W_1, W_2, \ldots, W_k]\) and a bad part \(b = [W_{k+1}, W_{k+2}, \ldots, W_n]\).
 * The worm is set to the concatenation \(g + b + b + \cdots + b + b\) with \(t\) copies of \(b\).