#include <stdio.h>
#include <stdlib.h>
int c(const void *v1,const void *v2){
    return *(int *)v1-*(int *)v2;
}
int main(void){
    int n1,n2,i,line[20000],line1[20000],max;
    for(;scanf("%d %d",&n1,&n2),(n1+n2)!=0;){
        for(i=0;scanf("%d",&line[i++]),i!=(n1+n2););
        qsort(line,n1+n2,4,c);
        line1[0]=line[0];
        for(i=1;i<n1+n2;i++)
            line1[i]=line[i]-line[i-1];
        for(i=1,max=line1[0];i<n1+n2;i++)
            if(max<line1[i])
                max=line1[i];
        printf("%d\n",max);
    }
    return 0;
}