from bisect import * n,m = map(int,input().split()) x = list(map(int,input().split())) y = list(map(int,input().split())) for i in range(n): ind = bisect_left(y,x[i]) if ind == m: print("Infinity") else: print(y[ind]-x[i])