a[100],b[100],s,t,x,y,i;main(n,m){for(;scanf("%d%d",&n,&m)*n;s=t=!printf(x>998?"-1\n":"%d %d\n",x,y)){x=y=999;for(i=n;i--;s+=a[i])scanf("%d",a+i);for(i=m;i--;t+=b[i])scanf("%d",b+i);for(;n--;)for(i=m;i--;)s+b[i]*2==t+a[n]*2&&a[n]+b[i]<x+y?x=a[n],y=b[i]:0;}}