class Imos_1: def __init__(self, N): """ 区間 0<=t<N に対する Imos 法を準備する. """ self.__N=N self.list=[0]*(N+1) def __len__(self): return len(self.list)-1 def add(self, l, r, x=1): """閉区間 [l, r] に x を加算する.""" assert 0<=l<self.__N assert 0<=r<self.__N if l<=r: self.list[l]+=x self.list[r+1]-=x def cumulative_sum(self): """累積和を求める. """ X=self.list.copy()[:-1] for i in range(1,len(self)): X[i]+=X[i-1] return X #================================================= from collections import defaultdict class Sparse_Imos_1: def __init__(self): self.dict=defaultdict(int) def add(self, l, r, x=1): """閉区間 [l,r] に x を加算する. """ if l<=r: self.dict[l]+=x self.dict[r+1]-=x def cumulative_sum(self, since, until): """累積和を求める. [Output] (y, l, r) という形のリスト. ただし, (y, l, r) は l<=x<=y の範囲では y であるということを意味する. """ Y=[] S=0 t_old=since dic=self.dict for t in sorted(dic): if t>until: break if dic[t]==0: continue if t_old<=t-1: Y.append((S, t_old,t-1)) S+=dic[t] t_old=t if t_old<=until: Y.append((S, t_old,until)) return Y #================================================== def solve(): N,M=map(int,input().split()) I=Imos_1(N+1) for _ in range(M): L,R=map(int,input().split()) I.add(R,L) J=I.cumulative_sum() return J[1:N+1][::-1] #================================================== import sys input=sys.stdin.readline write=sys.stdout.write write("\n".join(map(str,solve())))