loop {
	n, m = gets.split.map(&:to_i)
	break if n == 0 && m == 0
	a = [0]
	if n != 0
		a += gets.split.map(&:to_i)
	end
	if m != 0
		a += gets.split.map(&:to_i)
	end
	a.sort!
	b = []
	for i in 0...(n+m)
		b += [a[i+1] - a[i]]
	end
	p b.max
}