#include<stdio.h>

int main(){
  int n, m, tarosum, hanasum,taro[100],hana[100],diff,min,input1,input2;
  int i, j;

  while(1){

    tarosum=0;
    hanasum=0;
    min=201;
    input1=0;
    input2=0;

    scanf("%d %d",&n,&m);

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

    //  printf("%d\n",diff);
    
    for(i=0;i<n;i++){
      for(j=0;j<m;j++){
	if( 2*(taro[i]-hana[j]) == diff){
	  if( min > taro[i]+hana[j]){
	    min=taro[i]+hana[j];
	    input1=taro[i];
	    input2=hana[j];
	  }
	}
      }
    }
    
    if(input1==0 && input2==0){
      printf("-1\n");
    }else{
      printf("%d %d\n",input1,input2);
    }
    
    
  }
  return 0;
}