n,x = map(int,input().split()) l = [0]*x for i in range(n): a,b = map(int,input().split()) for j in range(x): l[j] = max(l[j], b - abs(j - (a - 1))) print(*l)