
def maxims(it):
    a = next(it)
    b = next(it)
    for c in it:
        if a < b > c:
            yield b
        a = b
        b = c
        
