#include <iostream>

using namespace std;

int main( void )
{
	int t, map[101];
	cin >> t;
	while(t--) {
		int n;
		cin >> n;
		for(int i=0; i < n; ++i) {
			cin >> map[i];
		}
		int Max, Min;
		Max = Min = 0; n--;
		for(int i=0; i < n; ++i) {
			int sub = map[i+1] - map[i];
			Max = max(Max, sub);
			Min = min(Min, sub);
		}
		cout << Max << ' ' << -Min << endl;
	}
	return 0;
}