#include <stdio.h>

int main(){
  int t,n,i,a[100],t,Max,Min;

  scanf("%d",&t);

  while(t--){
    scanf("%d",&n);

    for(i=0;i<n;i++){
      scanf("%d",&a[i]);
    }
    for(i=0;i<n-1;i++){
      a[i] = a[i+1]-a[i];
    }
    for(i=n-3;i >= 0;i--){
      if(a[i] < a[i+1]) t=a[i];a[i] = a[i+1];a[i+1] = t;
    }
    Max = a[0];

    for(i=n-3;i >= 0;i--){
      if(a[i] > a[i+1]) t=a[i];a[i] = a[i+1];a[i+1] = t;
    }

    Min = a[0];

    if(Max >= 0 && Min <= 0) printf("%d %d\n",Max,-Min);
    if(Max < 0) printf("%d %d\n",0,-Min);
    if(Min > 0) printf("%d %d\n",Max,0);

  }

  return 0;
}