Hermit crabs adopt other creatures' castoff shells for protection. But as they grow, crabs must move into successively larger shells. This produces a curious phenomenon: when a crab finds a shell that's too big for it, it waits nearby. Other crabs may accumulate, forming a little conga line of dissatisfied shell seekers. Finally a "Goldilocks" crab arrives — a crab large enough to claim the new shell — and now each waiting crab can move into the shell abandoned by its larger neighbor. By cooperating to share a scarce resource, the whole species benefits.

The same thing happens in human societies — when one person finds a new apartment, car, or job, she leaves behind her old one, and the vacancy passes down through society until the final unit is cast away or destroyed. It's called a vacancy chain.

Assignment

In this assignment we work with sequences of integers that represent shell sizes. A sequence of consecutive integers is a sequence of $$n$$ integers $$a_1, a_2, \ldots, a_n$$ such that $$a_i + 1 = a_{i + 1} (i = 1, \ldots, n - 1)$$. Your task:

Example

>>> consecutive([7, 5, 4, 9, 6, 3, 8])
True
>>> consecutive((16, 13, 18, 17, 15, 14, 20))
False
>>> consecutive((3, 4, 1, 6, 8, 7))
False

>>> goldilocks([7, 5, 4, 9, 6, 3, 8])
>>> goldilocks((16, 13, 18, 17, 15, 14, 20))
19
>>> goldilocks((3, 4, 1, 6, 8, 7))

>>> move1([7, 5, 4, 9, 6, 3, 8])
[7, 5, 4, 9, 6, 3, 8]
>>> move1((16, 13, 18, 17, 15, 14, 20))
[16, 13, 18, 17, 15, 14, 20, 19]
>>> move1((3, 4, 1, 6, 8, 7))
[3, 4, 1, 6, 8, 7]

>>> shells = [7, 5, 4, 9, 6, 3, 8]
>>> move2(shells)
>>> shells
[7, 5, 4, 9, 6, 3, 8]

>>> shells = [16, 13, 18, 17, 15, 14, 20]
>>> move2(shells)
>>> shells
[16, 13, 18, 17, 15, 14, 20, 19]

>>> shells = [3, 4, 1, 6, 8, 7]
>>> move2(shells)
>>> shells
[3, 4, 1, 6, 8, 7]