n, m = map(int, input().split()) X = list(map(int, input().split())) Y = list(map(int, input().split())) for x in X: nums =[] for y in Y: if x <= y: nums.append(y-x) if len(nums) == 0: print("Infinity") else: print(min(nums))