n,m = map(int,input().split()) x = list(map(int,input().split())) y = list(map(int,input().split())) y.sort() def lower_bound(a,x): ng,ok = -1,len(a) while ok-ng>1: m = (ng+ok)//2 if x<=a[m]: ok = m else: ng = m return ok for i in range(n): t = lower_bound(y,x[i]) if t==m: print('Infinity') else: d = y[t]-x[i] print(d)