N, X = map(int, input().split()) mp = [0] * X for _ in range(N): a, b = map(int, input().split()) for i in range(X): mp[i] = max(mp[i], b - abs(i - a + 1)) print(*mp)