N, M = map(int, input().split()) lst = [] X = map(int, input().split()) Y = map(int, input().split()) for i, x in enumerate(X): lst.append((x, 1, i)) for j, y in enumerate(Y): lst.append((y, 2, j)) lst.sort() tmp = [] ans = ['Infinity'] * N for x, q, i in lst: if q == 1: tmp.append((x, i)) else: # assert q == 2 while tmp: x0, i0 = tmp.pop() ans[i0] = x - x0 print(*ans, sep='\n')