//Number 1153

#include <stdio.h>
#define MAX 100

int main(void)
{
  int n, m, i, j, sum1, sum2, out1, out2, min;
  int taro[MAX] = {0};
  int hanako[MAX] = {0};

  while(1)
    {
      scanf("%d %d", &n, &m);
      if(n==0&&m==0)
	break;

      sum1 = 0;
      sum2 = 0;
      
      for(i=0; i<n; i++)
	{
	  scanf("%d", &taro[i]);
	  sum1 += taro[i];
	}
      
      for(i=0; i<m; i++)
	{
	  scanf("%d", &hanako[i]);
	  sum2 += hanako[i];
	}

      out1 = -1;
      out2 = -1;
      min = 200;
      for(i=0; i<n; i++)
	{
	  for(j=0; j<m; j++)
	    {
	      if(sum1-taro[i]+hanako[j]==sum2+taro[i]-hanako[j])
		{
		  if(min>=taro[i]+hanako[j])
		    {
		      out1 = taro[i];
		      out2 = hanako[j];
		      min = out1 + out2;
		    }
		}
	    }
	}
      
      if(out1==-1&&out2==-1)
	printf("-1\n");
      else
	printf("%d %d\n", out1, out2);
      
    }
  return 0;
}