#include <stdio.h>

int main(void){
	while(1){
		int n, m, i, j;
		long a[20001] = {0};
	
		scanf("%d %d", &n, &m);
		if(n==0 && m==0) break;
		
		for(i=1; i<=m+n; i++)
			scanf(" %ld", &a[i]);
		
		for(i=1; i<=m+n; i++){
			for(j=i; j<=m+n; j++){
				if(a[i] > a[j]){
					long tmp = a[i];
					a[i] = a[j];
					a[j] = tmp;
				}
			}
		}
		
		long max = a[1] - a[0];
		for(i=1; i<=m+n-1; i++){
			if(max < a[i+1] - a[i])
				max = a[i+1] - a[i];
		}
		
		printf("%ld\n", max);
	
	}

	return 0;
}