#include <bits/stdc++.h>
using namespace std;
int n, a[100005], m, k, l[105], r[105], b;
int main () {
freopen ("usaco_Feb_swap.in", "r", stdin);
freopen ("usaco_Feb_swap.out", "w", stdout);
ios::sync_with_stdio(false);
cin >> n >> m >> k;
for (int i = 1; i <= n; i++) {
a[i] = i;
}
for (int i = 1; i <= m; i++) {
cin >> l[i] >> r[i];
}
for (int i = 1; i <= k; i++) {
for (int j = 1; j <= m; j++) {
reverse(a + l[j], a + r[j] + 1);
}
}
for (int i = 1; i <= n; i++) cout << a[i] << endl;
return 0;
}