#include <bits/stdc++.h>
using namespace std;
//
const int maxn = 1e5;
//
int n, k, d, pos[maxn], nxt[maxn][31];
//
void process (void)
{
    cin >> n >> k >> d;
    iota(pos, pos + n, 0);
    for (int l, r; k > 0; --k)
    {
        cin >> l >> r;
        --l, --r;
        while (l < r)
            swap(pos[l++], pos[r--]);
    }
    
    for (int i = 0; i < n; ++i)
        nxt[i][0] = pos[i];
    for (int j = 1; j < 31; ++j)
        for (int i = 0; i < n; ++i)
            nxt[i][j] = nxt[nxt[i][j - 1]][j - 1];
    iota(pos, pos + n, 0);
    for (int j = 0; j < 31; ++j)
        if (d >> j & 1)
            for (int i = 0; i < n; ++i)
                pos[i] = nxt[pos[i]][j];
                
    for (int i = 0; i < n; ++i)
        cout << pos[i] + 1 << ' ';
}
//
signed main (void)
{
    ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
    process();
}
