#include <stdio.h>

int main(void){
	int tarou[100], hanako[100], n, m, i, j, sum, T, H, tsum, hsum, check;

	while (1){
		scanf("%d %d", &n, &m);
		if (n == 0 && m == 0) break;

		tsum = 0; hsum = 0; check = 0; sum = 201;
		for (i = 0; i < n; i++){
			scanf("%d", &tarou[i]);
			tsum = tsum + tarou[i];
		}
		for (i = 0; i < m; i++){
			scanf("%d", &hanako[i]);
			hsum = hsum + hanako[i];
		}

		for (i = 0; i < n; i++){
			for (j = 0; j < m; j++){
				if ((tsum - tarou[i] + hanako[j]) == (hsum - hanako[j] + tarou[i])){
					if (sum > (tarou[i] + hanako[j])){
						T = tarou[i]; H = hanako[j];
						sum = tarou[i] + hanako[j];
						check = 1;
					}
				}
			}
		}
		if (check == 0) printf("-1\n");
		else printf("%d %d\n", T, H);
	}

	return 0;
}