while true
    n, m = gets.chomp.split.map(&:to_i)
    break if [n, m] == [0, 0]
    
    arr, arr2 = [], []
    arr = gets.chomp.split.map(&:to_i) if n > 0
    arr2 = gets.chomp.split.map(&:to_i) if m > 0
    arr += arr2
    arr.sort!.reverse!
    arr << 0
    max, prev = 0, arr[0]
    arr[1..-1].each{|x|
        d, prev = prev - x, x
        max = d if max < d
    }    
    puts max
end
