#include <stdio.h>
#define MAX 101
#define INF 1000000

int main(void) {
  int n, m, i, j, k;
  int sans, tans, sres, tres;
  int ssum, tsum;
  int s[MAX], t[MAX];
  while (1) {
    scanf("%d %d", &n, &m);
    if (n == 0 && m == 0) return 0;
    for (i = 0; i < n; i++) {
      scanf("%d", s + i);
    }
    for (i = 0; i < m; i++) {
      scanf("%d", t + i);
    }
    ssum = 0;
    tsum = 0;
    for (i = 0; i < n; i++) {
      ssum += s[i];
    }
    for (i = 0; i < m; i++) {
      tsum += t[i];
    }
    sans = INF, tans = INF;
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++) {
        sres = ssum - s[i] + t[j];
        tres = tsum + s[i] - t[j];
        if (sres == tres&& s[i] + t[j] < sans + tans) {
          sans = s[i];
          tans = t[j];
        }
      }
    }
    if (sans != INF) {
      printf("%d %d\n", sans, tans);
    } else {
      puts("-1");
    }
  }
}

