def I(): return input() def N(): return int(input()) def M(): return map(int,input().split()) def L(): return list(map(int,input().split())) #----------------------------------------- N,X = M() A = [] B = [] for i in range(N): a,b = M() A.append(a) B.append(b) for j in range(X): k = j+1 res = 0 for i in range(N): res = max(res,max(B[i]-abs(k-A[i]),0)) print(res,end = ' ')