/* 
AOJ 1153
Equal Total Scores
2015.4.25
 */
#include<stdio.h>

int t_num, h_num, t_cards[100], h_cards[100];

void equalize(){
  int i, j, t_sum = 0, h_sum = 0, t_changed = 0, h_changed = 0;

  
  for(i = 0; i < t_num; i++ ){
    t_sum += t_cards[i]; 
  }
  for(i = 0; i < h_num; i++){
    h_sum += h_cards[i];
  }


  for(i = 0; i < t_num; i++){
    for(j = 0; j < h_num; j++){
      t_changed = t_sum + h_cards[j] - t_cards[i];
      h_changed = h_sum + t_cards[i] - h_cards[j];
      if(t_changed == h_changed){
	printf("%d %d\n", t_cards[i], h_cards[j]);
	return ;
      }
    }
  }
  printf("-1\n");
  return ;
}

int main(void){
  int i;
  while(1){
    scanf("%d %d", &t_num, &h_num);
    if(t_num == 0 && h_num == 0){
      break;
    }

    for(i = 0; i < 100; i++){
      t_cards[i] = 0;
      h_cards[i] = 0;
    }


    for(i = 0; i < t_num; i++){
      scanf("%d", &t_cards[i]);
    }
    for(i = 0; i < h_num; i++){
      scanf("%d", &h_cards[i]);
    }


    equalize();

  }
  return ;
}