#include<stdio.h>

int main(){
  int ans1, ans2, n, m, taro[128], hana[128], i, j, min;
  int taro_sum, hana_sum;
  
  while(scanf("%d%d", &n, &m), n){

    taro_sum=hana_sum=0;
    
    for(i=0; i<n; i++){
      scanf("%d", &taro[i]);
      taro_sum+=taro[i];
    }
    for(i=0; i<m; i++){
      scanf("%d", &hana[i]);
      hana_sum+=hana[i];
    }

    ans1=ans2=0;
    min=200;
    for(i=0; i<n; i++){
      for(j=0; j<m; j++){
	if(taro_sum-taro[i]+hana[j]==hana_sum-hana[j]+taro[i]){
	  if(min>taro[i]+hana[j]){
	    ans1=taro[i];
	    ans2=hana[j];
	    min=taro[i]+hana[j];
	  }
	}
      }
    }

    if(ans1==0 || ans2==0){
      printf("-1\n");
    }else{
      printf("%d %d\n", ans1, ans2);
    }
    
  }

  return 0;
}