import bisect n, m = map(int, input().split()) s = list(map(int, input().split())) t = list(map(int, input().split())) s.sort() burden = 0 idx = 0 for tj in t: i = bisect.bisect_left(s, tj, idx) if i >= len(s): break burden = max(burden, s[i] - tj) idx = i + 1 print(burden)