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

int main(void)
{
int n,m,i,j,min,sum,sum1,sum2,d;
int ansa,ansb;
int a[100];
int b[100];

while(scanf("%d%d",&n,&m),n+m){

sum=0;
min=0;
for(i=0;i<n;i++){
scanf("%d",&a[i]);
sum1+=a[i];
}
for(i=0;i<m;i++){
scanf("%d",&b[i]);
sum2+=b[i];
}

sum=sum1+sum2;

if(sum%2){
printf("-1\n");
} else {
d=abs(sum1-sum2)/2;
for(i=0;i<n;i++){
for(j=0;j<m;j++){
if(d==abs(a[i]-b[j])){
if(min>a[i]+b[j]){
ansa=a[i];
ansb=b[j];
min=a[i]+b[j];
}
}
}
}
printf("%d %d\n",ansa,ansb);
}
}
return 0;
}