#include<stdio.h>
int main(){
  char n;
  unsigned int ans;
  int a,b,c[1000],d[1000],i,j,sumx,sumy,p=0,dtx[1000],dty[1000];
  for(i=0;i<1000;i++){
    dtx[i]=-1;
    dty[i]=-1;
  }
  while(1){
    scanf("%d%d",&a,&b);
    if(a==0 && b==0)break;
    sumx=0;
    sumy=0;
    for(i=0;i<a;i++){
      scanf("%d",&c[i]);
      sumx+=c[i];
    }
    for(i=0;i<b;i++){
      scanf("%d",&d[i]);
      sumy+=d[i];
    }
    ans=sumx-sumy;
    for(i=0;i<a;i++)
      for(j=0;j<b;j++)
	if((d[j]-c[i])*2==ans || (c[i]-d[j])*2==ans)
	  if(c[i]+d[j] <= c[i+1]+d[j+1]){
	    dtx[p]=c[i];
	    dty[p]=d[j];
	  }
    p++;
  }
  for(i=0;i<p;i++){
    if(dtx[i]==-1 && dty[i]==-1)
      printf("-1\n");
    else printf("%d %d\n",dtx[i],dty[i]);
  }
  return 0;
}