#include <bits/stdc++.h>
using namespace std;

mt19937 rng;
using ll = long long;

struct node
{
    int lson, rson;
    int y;
    int cnt;

    int id;

    node(): lson(-1), rson(-1), y(-1),
    cnt(1), id(-1)
    {}

    node(const int id_): lson(-1), rson(-1),
                        y(rng()),
                        cnt(1), id(id_) {}
};

struct treap_manager
{
    vector<node> v;

    int get_cnt (const int root)
    {
        return root == -1 ? 0 : v[root].cnt;
    }

    void recalc (const int root)
    {
        v[root].cnt = 1 + get_cnt(v[root].lson) +
                      get_cnt(v[root].rson);
    }

    int merge(int l, int r)
    {
        if (l == -1)
            return r;
        if (r == -1)
            return l;

        if (v[l].y > v[r].y)
        {
            const int mem_size = get_cnt(r);
            v[l].rson = merge(v[l].rson, r);

            recalc(l);
            return l;
        }
        else
        {
            const int mem_size = get_cnt(l);
            v[r].lson = merge(l, v[r].lson);

            recalc(r);
            return r;
        }
    }

    int get_new_node(const int id)
    {
        v.push_back(node(id));
        return int(v.size()) - 1;
    }

    void insert(int &t, const int k, const int id)
    {
        int l, r;
        tie(l, r) = split_by_k(t, k);
        const int m = get_new_node(id);
        t = merge(l, merge(m, r));
    }

    int get_kth (const int root, const int k)
    {
        assert(0 <= k && k < get_cnt(root));
        const int left_size = get_cnt(v[root].lson);
        if (k == left_size)
            return v[root].id;
        if (k < left_size)
            return get_kth(v[root].lson, k);
        /// k > left_size;
        return get_kth(v[root].rson, k - left_size - 1);
    }

    pair<int, int> split_by_k (int t, const int k)
    {
        assert(0 <= k && k <= get_cnt(t));
        if (t == -1)
            return {-1, -1};

        const int left_size = get_cnt(v[t].lson);
        if (left_size < k)
        {
            int l, r;
            tie(l, r) = split_by_k(v[t].rson, k - left_size - 1);
            v[t].rson = l;

            recalc(t);
            return {t, r};
        }
        else
        {
            int l, r;
            tie(l, r) = split_by_k(v[t].lson, k);
            v[t].lson = r;

            recalc(t);
            return {l, t};
        }
    }

    void dfs (const int root, vector<int> &ans)
    {
        if (root == -1)
            return;

        dfs(v[root].lson, ans);
        ans.push_back(v[root].id);
        dfs(v[root].rson, ans);
    }

    vector<int> get_order (const int root)
    {
        vector<int> ans;
        dfs(root, ans);
        return ans;
    }

    void move_to_front (int &root, const int lb, const int rb)
    {
        int l, m, r;
        tie(l, m) = split_by_k(root, lb);
        tie(m, r) = split_by_k(m, rb - lb);
        root = merge(m, merge(l, r));
    }
};

void solve(istream &cin = std::cin,
           ostream &cout = std::cout)
{
    treap_manager manager;
    int root = -1;

    int n, m;
    cin >> n >> m;

    for (int i = 1; i <= n; i++)
        manager.insert(root, i - 1, i);

    for (int i = 0; i < m; i++)
    {
        int l, r;
        cin >> l >> r;
        --l;

        manager.move_to_front(root, l, r);
    }

    const auto ans = manager.get_order(root);
    for (auto it : ans)
        cout << it << ' ';
    cout << endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

#ifdef LOCAL
    ifstream fin("input.txt");
    ofstream fout("output.txt");
    solve(fin, fout);
#else
    solve(cin, cout);
#endif
}
