def max_end3(nums):
    res = max(nums[0], nums[-1])
    li = []
    for i in range(3):
        li.append(res)
    return li

31cddc3cf56cbf8cb9bb5c554bbe6365e80ff764
<mask token>

def max_end3(nums):
    res = max(nums[0], nums[-1])
    li = []
    for i in range(3):
        li.append(res)
    return li
