from bisect import bisect_right N, M = map(int, input().split()) X = list(map(int, input().split())) Y = sorted(list(map(int, input().split()))) for x in X: i = bisect_right(Y,x) # print('TEST',i,x) if i == M: print('Infinity') else: print(Y[i] - x)