/** I can do this all day **/

#pragma GCC optimize("O2")
#include <bits/stdc++.h>
using namespace std;

typedef long long                   ll;
typedef long double                 ld;
typedef pair<int,int>               pii;
typedef pair<ll,ll>                 pll;
#define all(x)                      (x).begin(),(x).end()
#define F                           first
#define S                           second
#define Mp                          make_pair
#define SZ(x)			    		(int)x.size()
#define fast_io                     ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define file_io                     freopen("in.txt" , "r+" , stdin) ; freopen("out.txt" , "w+" , stdout);

const int N = 1e5 + 10;
const ll mod = 1e9 + 7;
const ll mod2 = 998244353;
const ll inf = 8e18;
const int LOG = 22;

ll pw(ll a , ll b, ll M)  { return (!b ? 1 : (b & 1 ? (a * pw(a * a % M, b / 2, M)) % M : pw(a * a % M, b / 2, M))); }

unordered_map < int, int > fen[N];

int n, m, Le[N], Ri[N], Ans[N];

vector < int > Q[N];

void upd(int l, int r, int id)
{
	int L = n - l + 1;
	for(L; L < N; L += L & -L)
	{
		for(int R = r; R < N; R += R & -R)
		{
			if(fen[L].count(R) == 0)
			{
				fen[L][R] = id;
			}
			else
			{
				fen[L][R] = min(fen[L][R], id);
			}
		}
	}
}

int get(int l, int r)
{
	int L = (n - l + 1), R = r;
	int ret = 1e9;
	for(; L; L -= L & -L)
	{
		for(R = r; R; R -= R & -R)
		{
			if(fen[L].count(R))
			{
				ret = min(ret, fen[L][R]);
			}
		}
	}
	return ret;
}

int solve(int l, int r)
{
	if(l > r) return 0;
	int id = get(l, r);
	if(id == 1e9) return 0;
	return Ri[id] - Le[id] + 1 + solve(l, Le[id] - 1) + solve(Ri[id] + 1, r);
}

int main()
{
	scanf("%d%d", &n, &m);
	for(int i = 1; i <= m; i ++)
	{
		scanf("%d%d", &Le[i], &Ri[i]);
		Q[Ri[i] - Le[i] + 1].push_back(i);
	}
	for(int x = n; x >= 1; x --)
	{
		for(auto now : Q[x])
		{
			upd(Le[now], Ri[now], now);
		}
		Ans[x] = solve(1, n);
	}
	for(int i = 1; i <= n; i ++)
	{
		printf("%d\n", Ans[i]);
	}
    return 0;
}

/** test corner cases(n = 1?) watch for overflow or minus indices **/

