############################################################# import sys sys.setrecursionlimit(10**7) from heapq import heappop,heappush from collections import deque,defaultdict,Counter from bisect import bisect_left, bisect_right from itertools import product,combinations,permutations from math import sin,cos #from math import isqrt #DO NOT USE PyPy ipt = sys.stdin.readline iin = lambda :int(ipt()) lmin = lambda :list(map(int,ipt().split())) ############################################################# N,X = lmin() L = [lmin() for _ in range(N)] A = [0]*X for i in range(X): for a,b in L: A[i] = max(A[i], b-abs(a-1-i)) print(*A)