#include <stdio.h>
#include <stdlib.h>

int main(void)
{
	int n,m;
	int i,j;
	int tarou[100];
	int hanako[100];
	int tarou_sum = 0,hanako_sum = 0;
	int sa;
	int ok = 0;
	int min_tarou = 999,min_hanako = 999;
	int min = 999;
	int hen = 0;
	while(1){
		scanf("%d %d",&m,&n);
		ok = 0;min_tarou =999;min_hanako = 999;
		min = 999;
		hanako_sum = 0;tarou_sum = 0;
		if(m == 0)break;
		
		for(i = 0;i < m;i++){
			scanf("%d",&tarou[i]);
			tarou_sum += tarou[i];
		}
		for(i = 0;i < n;i++){
			scanf("%d",&hanako[i]);
			hanako_sum += hanako[i];
		}
		
		if(abs(hanako_sum - tarou_sum) % 2){
			puts("-1");
			continue;
		}
		sa = abs(hanako_sum - tarou_sum) / 2;
		
		
		for(i = 0;i < m;i++){
			for(j = 0;j < n;j++){
				if(abs(tarou[i] - hanako[j]) == sa && tarou[i] + hanako[j] < min){
					min_tarou = tarou[i];
					min_hanako = hanako[j];
					min = tarou[i] + hanako[j];
					
				}
			}
			
		}
		if(min_tarou == 999){
			puts("-1");
		}else{
			printf("%d %d\n",min_tarou,min_hanako);
		}
	}//while
	return 0;
}