#include <stdio.h>

int main(){
  int n,m,i,j,taro[100],hanako[100];
  int sum_taro,sum_hanako,min,ansTaro,ansHanako;
  while(1){
    min = 201;
    sum_taro = sum_hanako = 0;
    scanf("%d%d",&n,&m);
    if(n == 0 && m == 0){ break; }
    for(i = 0 ; i < n ; i++){
      scanf("%d",&taro[i]);
      sum_taro += taro[i];
    }
    for(i = 0 ; i < m ; i++){
      scanf("%d",&hanako[i]);
      sum_hanako += hanako[i];
    }

    for(i = 0 ; i < n ; i++){
      for(j = 0 ; j < m ; j++){
        if(sum_taro-taro[i]+hanako[j] == sum_hanako-hanako[j]+taro[i]){
          if(taro[i]+hanako[j] < min){
            min = taro[i]+hanako[j];
            ansTaro = taro[i];
            ansHanako = hanako[j];
          }
        }
      }
    }
    if(min == 201){
      printf("-1\n");
    }else{
      printf("%d %d\n",ansTaro,ansHanako);
    }
  }
  return 0;
}