#include <stdio.h>

int main() {

  int hana,taro,sum;
  int hn,tn;
  int tc[150];
  int hc[150];
  int i,j,k,l;
  int hsum,tsum;
  int min;
  int a,b,c,d;

  while(1) {
    a = -1;
    b = -1;
    hsum = 0;
    tsum = 0;
    min = 300;

    scanf("%d %d",&tn,&hn);

    if(tn == 0 && hn == 0) {
      break;
    }

    for(i = 0; i < tn ; i++) {

      scanf("%d",&tc[i]);
      tsum = tsum + tc[i];

    }
    for(i = 0;i<hn ; i++) {

      scanf("%d", &hc[i]);
      hsum += hc[i];
    }

    for(j = 0; j<hn; j++ ) {
      for( i=0; i<tn; i++) {

	if(tsum-tc[i]+hc[j] == hsum-hc[j] + tc[i]) {
	  if(min > tc[i] + hc[j]) {
	    min = tc[i] + hc[i];
	    a =i;
	    b= j;
	  }
	}
      }
    }
    if(a == -1 && b == -1 ) {
      printf("-1\n");
    } else {
    printf("%d %d\n",tc[a],hc[b]);
    }

  }

  return 0;

}

      