loop {
	n, m = gets.split.map(&:to_i)
	break if n == 0 && m == 0
	INF = 1 << 30
	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]
	c = []
	na = nb = 0
	tmp = 0
	loop {
		if a[na] <= b[na]
			c += [a[na] - tmp]
			tmp = a[na]
			na += 1
		else
			c += [b[nb] - tmp]
			tmp = b[nb]
			nb += 1
		end
		break if tmp == INF
	}
	p c.max
}