#include <stdio.h>

void show(int* taro, int n, int* hana, int m){
  int i;
  printf("taro:"); for(i=0;i<n;i++) printf("%d ", taro[i]); printf("\n");
  printf("hana:"); for(i=0;i<m;i++) printf("%d ", hana[i]); printf("\n");
}

int sum(int* arr, int len) {
  int i, sum=0;
  for(i=0;i<len;i++) sum+=arr[i];
  return sum;
}

int member(int* arr, int len, int el){
  int i;
  for(i=0;i<len;i++)
    if(arr[i]==el) return 1;

  return 0;
}

void solve(int* taro, int n, int* hana, int m){
  int sub = sum(taro,n)-sum(hana,m);
  int i, min=200, tt, hh, t=-1, h=-1;

  if(sub%2 != 0) {
    printf("-1\n");
    return;
  }
  
  for(i=0;i<n;i++){
    tt=taro[i];
    hh=-sub/2+tt;
    if(member(hana, m, hh) && (min>tt+hh)){
      min = tt+hh;
      t = tt;
      h = hh;
    }
  }

  if(t!=-1 && h!=-1)
    printf("%d %d\n", t, h);
  else
    printf("-1\n");

  return;
}

int main(){
  int i, n, m, taro[100], hana[100];

  while(1){
    scanf("%d %d", &n, &m);
    if(n==0 && m==0) break;

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