 #include <stdio.h>
   
   int main(void){
           while(1){
                   int n,m;
                   scanf("%d%d",&n,&m);
                   if(n==0&&m==0)
                           break;
                   int Taro[100]={0},hanako[100]={0};
                  int sum[3]={200,200,200},sumtaro=0,sumhanako=0,i,o,p=0;
                  for(i=0;i<n;i++){
                          scanf("%d",&Taro[i]);sumtaro+=Taro[i];}
                  for(i=0;i<m;i++){
                          scanf("%d",&hanako[i]);sumhanako+=hanako[i];}
                  for(i=0;i<n;i++){
                          for(o=0;o<m;o++){
                                  if(sumtaro-Taro[i]+hanako[o]==sumhanako+Taro[i]-hanako[o])                                  {
                                          if(sum[2]>Taro[i]+hanako[o]){
                                          sum[0]=Taro[i];
                                         sum[1]=hanako[o];
                                          sum[2]=Taro[i]+hanako[o];p++;}
                                  }       
                          }       
                  }       
                 
                  
         if(p==0)                printf("-1\n");
          else
                         printf("%d %d\n",sum[0],sum[1]);
         }               
          return 0;       
  }       