def final_sequence(player, opponent, action, seq):
    """Play the moves in `seq` first, ignoring the strategy's moves until the
    list is exhausted."""
    length = player.match_attributes['length']
    if length < 0:
        return action
    index = length - len(player.history)
    if len(player.history) >= length:
        return action
    if index <= len(seq):
        return seq[-index]
    return action
