#include<stdio.h>
int main(void){
	int n,m,i,j,t[100],h[100],st,sh,anst,ansh;
	while(1){
		scanf("%d %d",&n,&m);
		if(n==0&&m==0){
			break;
		}
		anst=ansh=100000;
		st=sh=0;
		i=0;
		while(i<n){
			scanf("%d",&t[i]);
			st+=t[i];
			i++;
		}
		i=0;
		while(i<m){
			scanf("%d",&h[i]);
			sh+=h[i];
			i++;
		}
		for(i=0;i<m;i++){
			for(j=0;j<n;j++){
				if(st+h[i]-t[j]==sh+t[j]-h[i]&&h[i]+t[j]<anst+ansh){
					anst=t[j];
					ansh=h[i];
				}
			}
		}
		if(anst+ansh==200000){
			printf("-1\n");
		}
		else{
			printf("%d %d\n",anst,ansh);
		}
	}
	return 0;
}