// Aizu 1153: Equal Total Scores
// 2017.9.13 bal4u@uu

#include <stdio.h>

#define INF 0x7fffff
int a[102], b[102];

int main()
{
	int na, nb, sa, sb, i, j, aa, bb, ss;

	while (scanf("%d%d", &na, &nb) && na) {
		for (sa = i = 0; i < na; i++) scanf("%d", a+i), sa += a[i];
		for (sb = j = 0; j < nb; j++) scanf("%d", b+j), sb += b[j];
		sa -= sb, ss = INF;
		for (i = 0; i < na; i++) for (j = 0; j < nb; j++) {
			if ((a[i] - b[j]) << 1 == sa) {
				if (a[i] + b[j] < ss) aa = a[i], bb = b[j], ss = aa + bb;
			}
		}
		if (ss == INF) puts("-1");
		else printf("%d %d\n", aa, bb);
	}
	return 0;
}