#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#define file(s) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout);
using namespace std;
typedef long long ll;
const int MAXN = 200005;
const ll INF = 2e13;
int n, Q, L, R;
ll sum[MAXN << 2], _min[MAXN << 2], lazy[MAXN << 2];
ll crs_sum[MAXN << 2];

void build(int o, int l, int r) {
    lazy[o] = -1;
    if (l == r)
        return;
    int mid = (l + r) >> 1;
    build(o << 1, l, mid), build(o << 1 | 1, mid + 1, r);
}

void pushdown(const int &o, const int &l, const int &r) {
    int ls = o << 1, rs = ls | 1, mid = (l + r) >> 1;
    _min[ls] = _min[rs] = lazy[o];
    lazy[ls] = lazy[rs] = lazy[o];
    sum[ls] = (mid - l + 1) * lazy[o], sum[rs] = (r - mid) * lazy[o];
    lazy[o] = -1;
}

void update(const int &o, const int &ls, const int &rs) {
    _min[o] = _min[rs], sum[o] = sum[ls] + sum[rs];
}

void get_crs_sum(int o, int l, int r, const int &p) {
    if (l == r) {
        crs_sum[o] = sum[o];
        return;
    }
    if (lazy[o] != -1)
        pushdown(o, l, r);
    int ls = o << 1, rs = ls | 1, mid = (l + r) >> 1;
    if (p <= mid) {
        get_crs_sum(ls, l, mid, p);
        crs_sum[o] = crs_sum[ls];
    } else {
        get_crs_sum(rs, mid + 1, r, p);
        crs_sum[o] = sum[ls] + crs_sum[rs];
    }
}

int find(int o, int l, int r, int p, ll b, ll s) {
    if (l == r)
        return l;
    int ls = o << 1, rs = ls | 1, mid = (l + r) >> 1;
    if (lazy[o] != -1)
        pushdown(o, l, r);
    if (p <= mid)
        return find(ls, l, mid, p, b, 0);
    else if (p < r) {
        if ((p - mid) * _min[ls] - crs_sum[rs] >= b)
            return find(rs, mid + 1, r, p, b, 0);
        else
            return find(ls, l, mid, p, b, crs_sum[rs]);
    } else {
        if ((p - mid) * _min[ls] - (s + sum[rs]) >= b)
            return find(rs, mid + 1, r, p, b, s);
        else
            return find(ls, l, mid, p, b, s + sum[rs]);
    }
}

ll query_sum(int o, int l, int r) {
    if (L <= l && r <= R)
        return sum[o];
    if (lazy[o] != -1)
        pushdown(o, l, r);
    ll res = 0; int mid = (l + r) >> 1;
    if (L <= mid)
        res += query_sum(o << 1, l, mid);
    if (R > mid)
        res += query_sum(o << 1 | 1, mid + 1, r);
    return res;
}

void modify(int o, int l, int r, ll v) {
    if (L <= l && r <= R) {
        sum[o] = (r - l + 1) * v, _min[o] = lazy[o] = v;
        return;
    }
    if (lazy[o] != -1)
        pushdown(o, l, r);
    int ls = o << 1, rs = ls | 1, mid = (l + r) >> 1;
    if (L <= mid)
        modify(ls, l, mid, v);
    if (R > mid)
        modify(rs, mid + 1, r, v);
    update(o, ls, rs);
}

void get_element(int o, int l, int r) {
    if (l == r) {
        printf("%lld\n", _min[o]);
        return;
    }
    int ls = o << 1, rs = ls | 1, mid = (l + r) >> 1;
    if (lazy[o] != -1)
        pushdown(o, l, r);
    get_element(ls, l, mid), get_element(rs, mid + 1, r);
}

int main() {
    scanf("%d %d", &n, &Q);
    build(1, 1, n);
    int a, p; ll b, s, l, r, mid;
    for (int t = 1; t <= Q; t++) {
        scanf("%d %lld", &a, &b);
        get_crs_sum(1, 1, n, a);
        L = p = find(1, 1, n, a, b, 0), R = a;
        s = query_sum(1, 1, n);
        l = 0, r = INF;
        while (l <= r)
            (mid = (l + r) >> 1) * (R - L + 1) - s <= b ? l = mid + 1 : r = mid - 1;
        modify(1, 1, n, r);
        b = b - (R - L + 1) * r + s;
        if (L <= (R = L + b - 1))
            modify(1, 1, n, r + 1);
    }
    get_element(1, 1, n);
    return 0;
}


Measured memory_bytes: 17792