#include <stdio.h>

int main(void){
    int n, m, a[105], b[105], x, s_a, s_b, A, B, min, i, j;
    n=1; m=1;
    while (1) {
        scanf("%d %d", &n, &m);
        if (n==0 && m==0) break;
        s_a=0; s_b=0;
        for (i=1; i<=n; i++) {
            scanf("%d", &a[i]);
            s_a+=a[i];
        }
        for (i=1; i<=m; i++) {
            scanf("%d", &b[i]);
            s_b+=b[i];
        }
        if ((s_a+s_b)%2==1) {
            printf("-1\n");
            continue;
        }
        x=(s_a-s_b)/2; min=1000;
        for (i=1; i<=n; i++) {
            for (j=1; j<=m; j++) {
                if (a[i]-b[j]==x && a[i]+b[j]<min) {
                    A=a[i]; B=b[j];
                    min=a[i]+b[j];
                }
            }
        }
        if (min!=1000) printf("%d %d\n", A, B);
        else printf("-1\n");
    }
}
