def search(k, h):
    if h >= p:
        return
    ...
