#include <vector>
#include <iostream>
#include <limits>
#define show(x) std::cerr << #x << " = " << (x) << std::endl
using ll = long long;
template <typename T>
constexpr T INF() { return std::numeric_limits<T>::max() / 4; }
template <typename Base>
class LazySeg
{
    static std::size_t SZ(const std::size_t n)
    {
        std::size_t ans = 1;
        for (; ans < n; ans <<= 1) {}
        return ans;
    }

public:
    using BaseAlgebra = Base;
    using ValMonoid = typename BaseAlgebra::ValMonoid;
    using OpMonoid = typename BaseAlgebra::OpMonoid;
    using T = typename BaseAlgebra::VT;
    using F = typename BaseAlgebra::OT;
    LazySeg(const std::size_t n) : size(n), half(SZ(n)), value(half << 1, ValMonoid::id()), action(half << 1, OpMonoid::id()) {}
    template <typename InIt>
    LazySeg(const InIt first, const InIt last) : size(std::distance(first, last)), half(SZ(size)), value(half << 1, ValMonoid::id()), action(half << 1, OpMonoid::id())
    {
        copy(first, last, value.begin() + half);
        for (std::size_t i = half - 1; i >= 1; i--) { up(i); }
    }
    T get(const std::size_t a) const { return accumulate(a, a + 1); }
    void set(std::size_t a, const T& val)
    {
        modify(a, a + 1, OpMonoid::id()), value[a += half] = val;
        while (a >>= 1) { up(a); }
    }
    T accumulate(const std::size_t L, const std::size_t R) const
    {
        auto arec = [&](auto&& self, const std::size_t index, const std::size_t left, const std::size_t right) -> T {
            if (L <= left and right <= R) {
                return value[index];
            } else if (right <= L or R <= left) {
                return ValMonoid::id();
            } else {
                return act(action[index], acc(self(self, index << 1, left, (left + right) >> 1), self(self, index << 1 | 1, (left + right) >> 1, right)));
            }
        };
        return arec(arec, 1, 0, half);
    }
    void modify(const std::size_t L, const std::size_t R, const F& f)
    {
        auto mrec = [&](auto&& self, const std::size_t index, const std::size_t left, const std::size_t right) -> void {
            if (L <= left and right <= R) {
                this->update(index, f);
            } else if (right <= L or R <= left) {
            } else {
                this->update(index << 1, action[index]), this->update(index << 1 | 1, action[index]);
                self(self, index << 1, left, (left + right) >> 1), self(self, index << 1 | 1, (left + right) >> 1, right);
                this->up(index), action[index] = OpMonoid::id();
            }
        };
        mrec(mrec, 1, 0, half);
    }
    std::vector<T> data() const
    {
        std::vector<T> ans(size);
        for (std::size_t i = 0; i < size; i++) { ans[i] = get(i); }
        return ans;
    }

private:
    void up(const std::size_t i) { value[i] = acc(value[i << 1], value[i << 1 | 1]); }
    void update(const std::size_t i, const F& f) { value[i] = act(f, value[i]), action[i] = compose(f, action[i]); }
    const std::size_t size, half;
    std::vector<T> value;
    std::vector<F> action;
    const ValMonoid acc{};
    const OpMonoid compose{};
    const BaseAlgebra act{};
};

template <typename T>
std::ostream& operator<<(std::ostream& os, const LazySeg<T>& seg)
{
    os << "[";
    for (const auto& e : seg.data()) { os << e << ","; }
    return (os << "]" << std::endl);
}
template <typename VX = ll, typename OX = ll>
struct Max_Set
{
    using VT = VX;
    struct ValMonoid
    {
        VT operator()(const VT& a, const VT& b) const { return std::max(a, b); }
        static constexpr VT id() { return -INF<VT>(); }
    };
    using OT = OX;
    struct OpMonoid
    {
        OT operator()(const OT& f1, const OT& f2) const { return f1 != INF<OT>() ? f1 : f2; }
        static constexpr OT id() { return INF<OT>(); }
    };
    VT operator()(const OT& f, const VT& x) const { return f != INF<VT>() ? f : x; }
};

template <typename VX = ll, typename OX = ll>
struct Max_Plus
{
    using VT = VX;
    struct ValMonoid
    {
        VT operator()(const VT& a, const VT& b) const { return std::max(a, b); }
        static constexpr VT id() { return -INF<VT>(); }
    };
    using OT = OX;
    struct OpMonoid
    {
        OT operator()(const OT& a, const OT& b) const { return a + b; }
        static constexpr OT id() { return 0; }
    };
    VT operator()(const OT& f, const VT& x) const { return f + x; }
};
template <typename VX = ll, typename OX = ll>
struct Sum_Plus
{
    using VT = std::pair<VX, VX>;
    struct ValMonoid
    {
        VT operator()(const VT& a, const VT& b) const { return {a.first + b.first, a.second + b.second}; }
        static constexpr VT id() { return {0, 0}; }
    };
    using OT = OX;
    struct OpMonoid
    {
        OT operator()(const OT& f1, const OT& f2) const { return f1 + f2; }
        static constexpr OT id() { return 0; }
    };
    VT operator()(const OT& f, const VT& x) const { return {x.first + x.second * f, x.second}; }
};
template <typename VX = ll, typename OX = ll>
struct Sum_Set
{
    using VT = std::pair<VX, VX>;
    struct ValMonoid
    {
        VT operator()(const VT& a, const VT& b) const { return {a.first + b.first, a.second + b.second}; }
        static constexpr VT id() { return {0, 0}; }
    };
    using OT = OX;
    struct OpMonoid
    {
        OT operator()(const OT& f1, const OT& f2) const { return f1 != INF<OT>() ? f1 : f2; }
        static constexpr OT id() { return INF<OT>(); }
    };
    VT operator()(const OT& f, const VT& x) const { return f != INF<VX>() ? VT{x.second * f, x.second} : x; }
};
int main()
{
    int N, Q;
    std::cin >> N >> Q;
    LazySeg<Max_Set<ll>> seg(N);
    LazySeg<Sum_Set<ll>> seg2(N);
    for (int i = 0; i < N; i++) { seg.set(i, 0); }
    for (int i = 0; i < N; i++) { seg2.set(i, {0, 1}); }
    for (int q = 0; q < Q; q++) {
        int A;
        ll B;
        std::cin >> A >> B;
        int inf = -1, sup = A;
        while (sup - inf > 1) {
            const int mid = (inf + sup) / 2;
            if (mid == 0) {
                inf = mid;
            } else {
                const ll sub = seg2.accumulate(mid, A).first;
                const ll H = seg.get(mid - 1);
                const ll cap = H * (A - mid) - sub;
                (cap < B ? sup : inf) = mid;
            }
        }
        const ll rect = seg2.accumulate(inf, A).first + B;
        const ll H = rect / (A - inf);
        seg.modify(inf, A, H), seg2.modify(inf, A, H);
        const ll res = rect % (A - inf);
        if (res > 0) { seg.modify(inf, inf + res, H + 1), seg2.modify(inf, inf + res, H + 1); }
    }
    for (int i = 0; i < N; i++) { std::cout << seg.get(i) << std::endl; }
    return 0;
}

Measured memory_bytes: 12544