N, X = map(int,input().split()) A, B = list(), list() for i in range(N): a, b = map(int,input().split()) A.append(a) B.append(b) for x in range(1, X+1): ans = 0 for i in range(N): ans = max(ans, B[i] - abs(x - A[i])) print(ans,end=' ')