from bisect import bisect_left n, m = map(int, input().split()) x = list(map(int, input().split())) y = list(map(int, input().split())) y.sort() for p in x: idx = bisect_left(y, p) if idx == m: print('Infinity') else: print(y[idx] - p)