#include<stdio.h>
#include<stdlib.h>

int comp( const void *c1, const void *c2 )
{
  int tmp1 = *(int *)c1;
  int tmp2 = *(int *)c2;

  if( tmp1 < tmp2 )  return -1;
  if( tmp1 == tmp2 ) return  0;
  if( tmp1 > tmp2 )  return  1;
} 

int main(void){
int x,y,i,max;
int t[20002];

while(1){
max=0;
scanf("%d %d",&x,&y);
if(x==0 && y==0)break;

for(i=0;i<x+y;i++){
scanf("%d",&t[i]);
}
qsort(t,x+y,sizeof(int),comp);
for(i=0;i<x+y-1;i++){
if(max<t[i+1]-t[i])max=t[i+1]-t[i];
}
printf("%d\n",max);
}
return 0;
}