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

mt19937 rng;

using ll = long long;

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

    int id;
    int min_seg;

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

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

const int inf = int(1e9);

struct treap_manager
{
    vector<node> v;

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

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

    int get_min (const int root) const
    {
        return root == -1 ? inf : v[root].min_seg;
    }

    void recalc (const int root)
    {
        assert(root != -1);
        v[root].cnt = 1 + get_cnt(v[root].lson) +
                      get_cnt(v[root].rson);
        v[root].min_seg = min({get_min(v[root].lson),
                               get_min(v[root].rson),
                               v[root].id});
    }

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

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

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

            recalc(r);
            return r;
        }
    }

    void insert (int &root, const int k, const int id)
    {
        int l, r;
        tie(l, r) = split(root, k);
        const int m = get_new_node(id);
        root = merge(merge(l, m), r);
///         "root = merge(l, merge(m, r));" is also correct
    }

    void erase (int &root, const int k)
    {
        int l, m, r;
        tie(l, m) = split(root, k);
        tie(m, r) = split(m, 1);
        root = merge(l, r);
    }

    int find_left (int root)
    {
        assert(root != -1);
        while (v[root].lson != -1)
            root = v[root].lson;
        return v[root].id;
    }

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

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

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

    int get_kth (const int root, const int k) const
    {
//        cerr << get_cnt(root) << ' ' << k << endl;
        assert(get_cnt(root) == 1 + get_cnt(v[root].lson) + get_cnt(v[root].rson));
        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 (const int t, const int k)
    {
        if (t == -1)
            return {-1, -1};

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

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

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

    void move_to_front (int &root, const int lb, const int rb)
    {
        int l, m, r;
        tie(l, m) = split(root, lb);
        tie(m, r) = split(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 = 0; i < n; i++)
        manager.insert(root, i, i + 1);

    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
}
