#include <bits/stdc++.h>
using namespace std;
const int N = 5e4 + 5, M = 1e5 + 5;
int n, m, ans[N], L[M], R[M];
vector<int> vec[N];
struct segment_tree_2D
{
	struct node { int mn, ls, rs; } o[N * 300];
	int rt[N << 2], tot;
	void modify(int l, int r, int &u, int ml, int mr, int v)
	{
		if(!u) { u = ++tot; o[u].mn = INT_MAX; }
		o[u].mn = min(o[u].mn, v);
		if(l == r) return;	
		int mid = l + r >> 1;
		if(mr <= mid) modify(l, mid, o[u].ls, ml, mr, v);
		else modify(mid + 1, r, o[u].rs, ml, mr, v);
	}
	void Modify(int l, int r, int u, int ml, int mr, int v)
	{
		modify(1, n, rt[u], ml, mr, v);
		if(l == r) return;
		int mid = l + r >> 1;
		if(ml <= mid) Modify(l, mid, u << 1, ml, mr, v);
		else Modify(mid + 1, r, u << 1 | 1, ml, mr, v);
	}
	int query(int l, int r, int u, int ql, int qr)
	{
		if(!u) return INT_MAX;
		if(ql <= l && r <= qr) return o[u].mn;
		int mid = l + r >> 1, res = INT_MAX;
		if(ql <= mid) res = min(res, query(l, mid, o[u].ls, ql, qr));
		if(qr > mid) res = min(res, query(mid + 1, r, o[u].rs, ql, qr));
		return res;
	}
	int Query(int l, int r, int u, int ql, int qr)
	{
		if(ql <= l && r <= qr) return query(1, n, rt[u], ql, qr);
		int mid = l + r >> 1, res = INT_MAX;
		if(ql <= mid) res = min(res, Query(l, mid, u << 1, ql, qr));
		if(qr > mid) res = min(res, Query(mid + 1, r, u << 1 | 1, ql, qr));
		return res;
	}
} sgt;
int Solve(int l, int r)
{
	if(l > r) return 0;
	int res = sgt.Query(1, n, 1, l, r);
	if(res == INT_MAX) return 0;
	return R[res] - L[res] + 1 + Solve(l, L[res] - 1) + Solve(R[res] + 1, r);
}
int main()
{
	ios::sync_with_stdio(false);
	cin >> n >> m;
	for(int i = 1; i <= m; i++)
	{
		cin >> L[i] >> R[i];
		vec[R[i] - L[i] + 1].emplace_back(i);
	}
	for(int i = n; i; i--)
	{
		for(int v : vec[i]) sgt.Modify(1, n, 1, L[v], R[v], v);
		ans[i] = Solve(1, n);
	}
	for(int i = 1; i <= n; i++) cout << ans[i] << endl;
	return 0;
}