N,M = map(int,input().split()) X = list(map(int,input().split())) Y = list(map(int,input().split())) Y.sort() def calc(x): if Y[-1] < x: return 'Infinity' end = N - 1 start = -1 while end - start > 1: mid = (start + end) // 2 if x < Y[mid]: end = mid else: start = mid return Y[end] - x for i in X: print(calc(i))