for _ in range(int(eval(input()))):

    _= int(eval(input()))

    upv=dov=0

    h= list(map(int, input().split()))

    for i in range(len(h)-1):

        upv= max(upv, h[i+1]-h[i])

        dov= max(dov, h[i]-h[i+1])

    print((upv, dov))
t = int(eval(input()))

for _ in range(t):

    n = int(eval(input()))

    h = list(map(int, input().split()))

    maxv = minv = 0

    for i in range(len(h)-1):

        maxv = max(maxv, h[i+1]-h[i])

        minv = max(minv, h[i]-h[i+1])

    print((maxv, minv))
for _ in range(int(eval(input()))):
    _ = int(eval(input()))
    upv = dov = 0
    h = list(map(int, input().split()))
    for i in range(len(h) - 1):
        upv = max(upv, h[i + 1] - h[i])
        dov = max(dov, h[i] - h[i + 1])
    print((upv, dov))

t = int(eval(input()))
for _ in range(t):
    n = int(eval(input()))
    h = list(map(int, input().split()))
    maxv = minv = 0
    for i in range(len(h) - 1):
        maxv = max(maxv, h[i + 1] - h[i])
        minv = max(minv, h[i] - h[i + 1])
    print((maxv, minv))

-for _ in range(int(eval(input()))): -    _ = int(eval(input())) -    upv = dov = 0 +t = int(eval(input())) +for _ in range(t): +    n = int(eval(input())) +    maxv = minv = 0 -        upv = max(upv, h[i + 1] - h[i]) -        dov = max(dov, h[i] - h[i + 1]) -    print((upv, dov)) +        maxv = max(maxv, h[i + 1] - h[i]) +        minv = max(minv, h[i] - h[i + 1]) +    print((maxv, minv))