#include <stdio.h>

int main(void) {
	int taro[100] = {0}, hanako[100] = {0};
	int i, j, n, m, min, tarotrade, hanakotrade;
	int taroall, hanakoall;
	
	scanf("%d%d",&n,&m);
	
	while( m + n ) {
		taroall=0;
		hanakoall=0;
		min = 201;
		for(i = 0; i < n; i++ ) {
			scanf("%d",&taro[i]);
			//printf("%d",taro[i]);
			taroall += taro[i];
		}
		for(i = 0; i < m; i++ ) {
			scanf("%d",&hanako[i]);
			//printf("%d",hanako[i]);
			hanakoall += hanako[i];
		}
		
		//printf("%d",taroall);
		//printf("%d",hanakoall);
		
		for(i = 0; i < n; i++ ) {
			for(j = 0; j < m; j++ ) {
				if( (taroall - taro[i] + hanako[j]) == (hanakoall - hanako[j] + taro[i]) ) {
					//printf("%d",taro[i] + hanako[j]);
					if(min > taro[i] + hanako[j] ){
						tarotrade = taro[i];
						hanakotrade = hanako[j];
						min = taro[i] + hanako[j];
						//puts("1");
					}
				}
			}
		}
		if(min == 201) {
			puts("-1");
		} else {
			printf("%d %d\n",tarotrade,hanakotrade);
		}
		scanf("%d%d",&n,&m);
	}
	return(0);
}