n, k = map(int, input().split()) assert 1 <= n <= 300 assert 0 <= k <= 5 a = list(map(int, input().split())) assert 1 <= min(a) assert max(a) <= 10 ** 9 c = list(map(int, input().split())) assert 1 <= min(c) assert max(c) <= 50