#include<stdio.h>

int main(void){
	
	int n,m;
	int t[100],h[100];
	int buff;
	int i,j,k,l;
	int tadd,hadd;
	int cadd,cadmin;
	int changet,changeh;
	int changed[3];
	int btadd,bhadd;
	
	while(1){
		
		changed[2] = 9999;
		
		scanf(" %d %d",&n,&m);
		
		if(m==0 && n==0){
			break;
		}
		
		for(i=0;i<n;i++){
			scanf("%d",&t[i]);
			tadd += t[i];
		}
		
		for(i=0;i<m;i++){
			scanf("%d",&h[i]);
			hadd += h[i];
		}
		
		for(i=0;i<n;i++){
			for(j=0;j<m;j++){
				
				btadd = 0;
				bhadd = 0;
				
				changet = t[i];
				changeh = h[j];
				
				for(k=0;k<n;k++){
					if(k==i){
						continue;
					}
					btadd += t[k];
				}
		
				for(l=0;l<m;l++){
					if(l==j){
						continue;
					}
					bhadd += h[l];
				}
				
				btadd += changeh;
				bhadd += changet;
				
				if(btadd == bhadd && (changet + changeh) < changed[2]){
					changed[0] = changet;
					changed[1] = changeh;
					changed[2] = changet + changeh;
				}
			}
		}
		
		if(changed[2] != 9999){
			printf("%d %d\n",changed[0],changed[1]);
		}else{
			printf("-1\n");
		}
		
		tadd = 0;
		hadd = 0;
		
	}
	
	return(0);
	
}