#include <stdio.h>

int main(void) {
	int n, m;
	int taro[101], hana[101], ans[2];
	int t_sum, h_sum, min;

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

		t_sum = h_sum = 0;
		for (int i = 0; i < n; i++) {
			scanf("%d", &taro[i]);
			t_sum += taro[i];
		}
		for (int j = 0; j < m; j++) {
			scanf("%d", &hana[j]);
			h_sum += hana[j];
		}

		min = 1000*1000;
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				if ((t_sum - taro[i] + hana[j]) == (h_sum - hana[j] + taro[i]) ){
					if (taro[i] + hana[j] < min) {
						min = taro[i] - hana[j];
						ans[0] = taro[i];
						ans[1] = hana[j];
					}
				}
			}
		}

		if (min == 1000 * 1000) {
			printf("-1\n");
			continue;
		}
		printf("%d %d\n", ans[0], ans[1]);
	}//endwhile
	return 0;
}
