def fun(a, b):
    maxa = max(a)
    maxb = max(b)
    mina = min(a)
    minb = min(b)

    print("%d %d %d %d"%(mina, minb, maxa, maxb))



while True:
    try:
        x = []
        y = []
        while True:
            a, b = map(int, input().split())
            if a == 0 and b == 0:
                break
            x.append(a)
            y .append(b)
        fun(x, y)

    except:
        break