INF = 1 << 30
loop {
	n, m = gets.split.map(&:to_i)
	break if n == 0 && m == 0
	a = []
	b = []
	if n != 0
		a += gets.split.map(&:to_i)
	end
	if m != 0
		b += gets.split.map(&:to_i)
	end
	a += [INF]
	b += [INF]
	na = nb = tmp = ans = d = 0
	loop {
		if a[na] <= b[nb]
			break if a[na] == INF
			d = a[na] - tmp
			tmp = a[na]
			na += 1
		else
			d = b[nb] - tmp
			tmp = b[nb]
			nb += 1
		end
		ans = d if d > ans
	}
	p ans
}