import bisect N,M = map(int,input().split()) lsX = list(map(int,input().split())) lsY = list(map(int,input().split())) for i in range(N): x = lsX[i] ind = bisect.bisect_left(lsY, x) if ind == len(lsY): print('Infinity') else: print(lsY[ind]-x)