#include <stdio.h>

int remain(int n,int m)
{

  int taro[n],hana[m],i,j,tarosum,hanasum,count;

  for(i=0;i<n;i++)taro[i]=0;
  for(i=0;i<m;i++)hana[i]=0;
  tarosum=0;hanasum=0;count=0;

  for(i=0;i<n;i++){
    scanf("%d", &taro[i]);
    tarosum=tarosum+taro[i];
  }
  for(i=0;i<m;i++){
    scanf("%d", &hana[i]);
    hanasum=hanasum+hana[i];
  }
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      tarosum=tarosum-taro[i]+hana[j];
      hanasum=hanasum-hana[j]+taro[i];
      if(tarosum==hanasum){
	printf("%d %d\n", taro[i],hana[j]);
	count=1;
	break;
      }
      else{
	tarosum=tarosum+taro[i]-hana[j];
	hanasum=hanasum+hana[j]-taro[i];
      }
    }
    if(count==1)break;
  }

  if(count==0)
    printf("-1\n");

  return 0;
}

int main(void)
{
  
  int n,m,ans;
  
  while(1){
    scanf("%d %d", &n,&m);
    if(n==0&&m==0)break;
    ans=remain(n,m);
  }
  
  return 0;
}