n,m=map(int,input().split()) x=list(map(int,input().split())) y=list(map(int,input().split())) y.sort() import bisect for v in x: p=bisect.bisect_left(y,v) print(y[p]-v if p