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