#include <bits/stdc++.h>

int ri() {
	int n;
	scanf("%d", &n);
	return n;
}

#define LINF 1000000000000000000

struct SegTree {
	struct Node {
		int64_t min = LINF;
		int64_t min2 = LINF;
		int mincnt = 0;
		int64_t added = 0;
		int64_t chmaxed = -LINF;
		Node operator * (const Node &r) const {
			const Node &l = *this;
			Node res;
			if (l.min < r.min) res.min = l.min, res.mincnt = l.mincnt, res.min2 = std::min(l.min2, r.min);
			else if (r.min < l.min) res.min = r.min, res.mincnt = r.mincnt, res.min2 = std::min(r.min2, l.min);
			else res.min = l.min, res.mincnt = l.mincnt + r.mincnt, res.min2 = std::min(l.min2, r.min2);
			return res;
		}
	};
	int n, n_;
	std::vector<Node> nodes;
	SegTree (int n_) : n_(n_) {
		for (n = 1; n < n_; n <<= 1);
		nodes.resize(n << 1);
		for (int i = 0; i < n_; i++) nodes[i + n] = {0, LINF, 1, 0, -LINF};
		for (int i = n; --i; ) fetch(i);
	}
	void fetch(int i) {
		nodes[i] = nodes[i << 1] * nodes[i << 1 | 1];
	}
	void flush(int i) {
		if (nodes[i].added) {
			nodes[i].min += nodes[i].added;
			nodes[i].min2 += nodes[i].added;
			if (i < n) {
				nodes[i << 1].added += nodes[i].added;
				if (nodes[i << 1].chmaxed != -LINF) nodes[i << 1].chmaxed += nodes[i].added;
				nodes[i << 1 | 1].added += nodes[i].added;
				if (nodes[i << 1 | 1].chmaxed != -LINF) nodes[i << 1 | 1].chmaxed += nodes[i].added;
			}
			nodes[i].added = 0;
		}
		if (nodes[i].chmaxed != -LINF) {
			if (i < n) {
				nodes[i << 1].chmaxed = std::max(nodes[i << 1].chmaxed, nodes[i].chmaxed);
				nodes[i << 1 | 1].chmaxed = std::max(nodes[i << 1 | 1].chmaxed, nodes[i].chmaxed);
			}
			if (nodes[i].chmaxed >= nodes[i].min2) {
				flush(i << 1);
				flush(i << 1 | 1);
				fetch(i);
			} else if (nodes[i].chmaxed > nodes[i].min) nodes[i].min = nodes[i].chmaxed;
			nodes[i].chmaxed = -LINF;
		}
	}
	template<class T> void dive(int l, int r, int node, int size, const T &func) {
		flush(node);
		if (r <= 0 || l >= size) return;
		if (l <= 0 && r >= size) func(node);
		else {
			int half = size >> 1;
			dive(l, r, node << 1, half, func);
			dive(l - half, r - half, node << 1 | 1, half, func);
			fetch(node);
		}
	}
	void mininfo(int l, int r, int64_t &min, int &mincnt, int64_t &min2) {
		Node tmp;
		dive(l, r, 1, n, [&] (int node) { tmp = tmp * nodes[node]; });
		min = tmp.min;
		mincnt = tmp.mincnt;
		min2 = tmp.min2;
	}
	void chmax(int l, int r, int64_t val) {
		dive(l, r, 1, n, [&] (int node) { nodes[node].chmaxed = val; flush(node); });
	}
	int kth_min(int l, int r, int k, int64_t min) {
		int cur = 1;
		int index = 0;
		int size = n;
		while (cur < n) {
			flush(cur);
			flush(cur << 1);
			int leftcnt = nodes[cur << 1].min < min ? 1000000000 :
						  nodes[cur << 1].min == min ? nodes[cur << 1].mincnt : 0;
			if (leftcnt > k) cur <<= 1;
			else k -= leftcnt, cur = cur << 1 | 1, index += size >> 1;
			size >>= 1;
		}
		assert(index < r);
		return index;
	}
	std::vector<int64_t> dump() {
		for (int i = 1; i < 2 * n; i++) flush(i);
		std::vector<int64_t> res(n_);
		for (int i = n; i < n + n_; i++) res[i - n] = nodes[i].min;
		return res;
	}
};

// dummy
struct SegTreeDummy {
	std::vector<int64_t> data;
	SegTreeDummy (int n) {
		data.resize(n);
	}
	void mininfo(int l, int r, int64_t &min, int &mincnt, int64_t &min2) {
		min = LINF;
		mincnt = 0;
		min2 = LINF;
		for (int i = l; i < r; i++) {
			if (min > data[i]) min2 = min, min = data[i], mincnt = 1;
			else if (min == data[i]) mincnt++;
			else min2 = std::min(min2, data[i]);
		}
	}
	void chmax(int l, int r, int64_t val) {
		for (int i = l; i < r; i++) data[i] = std::max(data[i], val);
	}
	int kth_min(int l, int r, int k, int64_t) {
		std::vector<int> mins;
		int64_t min = LINF;
		for (int i = l; i < r; i++) {
			if (min > data[i]) min = data[i], mins = { i };
			else if (min == data[i]) mins.push_back(i);
		}
		return mins[k];
	}
	std::vector<int64_t> dump() {
		return data;
	}
};

int main() {
	int n = ri();
	int q = ri();
	SegTree tree(n);
	for (int i = 0; i < q; i++) {
		int r = ri();
		int64_t val;
		scanf("%" SCNd64, &val);
		while (val) {
			int64_t min, min2;
			int mincnt;
			tree.mininfo(0, r, min, mincnt, min2);
			// std::cerr << "min " << min << " cnt:" << mincnt << " min2:" << min2 << std::endl;
			int64_t consume = std::min(min2 - min, val / mincnt);
			if (!consume) {
				int index = tree.kth_min(0, r, val, min);
				// std::cerr << "final " << index << "  " << min + 1 << std::endl;
				tree.chmax(0, index, min + 1);
				break;
			} else {
				// std::cerr << "  normal consume " << consume << std::endl;
				val -= consume * mincnt;
				tree.chmax(0, r, min + consume);
			}
		}
		/*
		for (auto i : tree.dump()) fprintf(stderr, "%" PRId64 " ", i);
		fprintf(stderr, "\n");*/
	}
	for (auto i : tree.dump()) printf("%" PRId64 "\n", i);
 	return 0;
}


Measured memory_bytes: 14396