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 i in range(n): ind = bisect_left(Y, X[i]) if ind == m: print("Infinity") else: print(Y[ind] - X[i])