Which word comes at the question mark?

BUY, PEA, DOC, RYE, FIG
ATOM, LAWS, WHEY, HOME
UNITS, TORSO, SPARK
NOBODY, CYCLIC, RIDING
GLIDERS, MARISOL, ?

The word sequences are characterized by the fact that at each position the letters jump forward a fixed distance in a cyclic alphabet (where the letter Z is followed by the letter A). For example, in the top sequence we see that the first letter jumps forward 14 positions from each word to its successor, the second letter 10 positions and the third letter 2 positions.

From GLIDERS to MARISOL, the corresponding letters jump forward 6, 15, 9, 5, 14, 23 and 19 positions respectively. If we jump forward the same number of positions from MARISOL, we find the next word in the last sequence: SPANGLE. We could try to jump once more from that word across the same number of positions, but then we would find the non-existent word YEJSUIX.

Assignment

A word is a string (str) consisting of one or more uppercase letters. Your task:

Example

In the following interactive session we assume the text file words.txt1 to be located in the current directory.

>>> distance('U', 'W')
2
>>> distance('Z', 'J')
10
>>> distance('T', 'T')
0

>>> distances('BUY', 'PEA')
[14, 10, 2]
>>> distances('ATOM', 'LAWS')
[11, 7, 8, 6]
>>> distances('UNITS', 'TORSO')
[25, 1, 9, 25, 22]
>>> distances('NOBODY', 'CYCLIC')
[15, 10, 1, 23, 5, 4]
>>> distances('GLIDERS', 'MARISOL')
[6, 15, 9, 5, 14, 23, 19]

>>> jump('BUY', [14, 10, 2])
'PEA'
>>> jump('ATOM', (11, 7, 8, 6))
'LAWS'
>>> jump('UNITS', [25, 1, 9, 25, 22])
'TORSO'
>>> jump('NOBODY', (15, 10, 1, 23, 5, 4))
'CYCLIC'
>>> jump('GLIDERS', [6, 15, 9, 5, 14, 23, 19])
'MARISOL'

>>> sequence('BUY', [14, 10, 2], 'words.txt2')
['BUY', 'PEA', 'DOC', 'RYE', 'FIG']
>>> sequence('ATOM', (11, 7, 8, 6), 'words.txt3')
['ATOM', 'LAWS', 'WHEY', 'HOME']
>>> sequence('UNITS', [25, 1, 9, 25, 22], 'words.txt4')
['UNITS', 'TORSO', 'SPARK']
>>> sequence('NOBODY', (15, 10, 1, 23, 5, 4), 'words.txt5')
['NOBODY', 'CYCLIC', 'RIDING']
>>> sequence('GLIDERS', [6, 15, 9, 5, 14, 23, 19], 'words.txt6')
['GLIDERS', 'MARISOL', 'SPANGLE']