#include <stdio.h>
#define ll long long
#define rep(i,l,r)for(ll i=l;i<r;i++)

ll a[110],b[110];

int main(){
	ll n,m;
	while(scanf("%lld%lld",&n,&m),n){
		ll sn=0,sm=0;
		ll id1=-1,id2,min=200;
		rep(i,0,n){
			scanf("%lld",a+i);
			sn+=a[i];
		}
		rep(i,0,m){
			scanf("%lld",b+i);
			sm+=b[i];
		}
		rep(i,0,n)rep(j,0,m){
			if(sn-a[i]+b[j]==sm-b[j]+a[i]){
				if(a[i]+b[j]<min){
					min=a[i]+b[j];
					id1=a[i];
					id2=b[j];
				}
			}
		}
		if(id1==-1)puts("-1");
		else printf("%lld %lld\n",id1,id2);
	}
}

