def get_penultimates(keys):
    penultimates = {}
    for key in keys:
        view = key[:key.find('_')]
        layer_name = key[(key.find('_') + 1):]
        if (view not in penultimates):
            penultimates[view] = ((view + '_') + layer_name)
        elif (layer_name > penultimates[view]):
            penultimates[view] = ((view + '_') + layer_name)
    keys = sorted(list(penultimates.keys()))
    return [penultimates[k] for k in keys]
def get_penultimates(keys):
    penultimates = {}
    for key in keys:
        view = key[:key.find('_')]
        layer_name = key[(key.find('_') + 1):]
        if (view not in penultimates):
            penultimates[view] = ((view + '_') + layer_name)
        elif (layer_name > penultimates[view]):
            penultimates[view] = ((view + '_') + layer_name)
    keys = sorted(list(penultimates.keys()))
    return [penultimates[k] for k in keys]