#include <bits/stdc++.h>
using namespace std;
int n,m,k,a[100010],cnt;
struct node {
int a,b;
}t[1000010];
int main () {
freopen("usaco_Feb_swap.in","r",stdin);
freopen("usaco_Feb_swap.out","w",stdout);
cin >> n >> m >> k;
for (int i=1;i<=n;i++) a[i]=i;
for (int i=1;i<=m;i++) {
int l,r;
cin >> l >> r;
for (int j=l;j<=(l+r)/2;j++) {
t[++cnt].a=j;
t[cnt].b=r-j+l;
}
}
while (k--) {
for (int i=1;i<=cnt;i++) {
int s=a[t[i].a];
a[t[i].a]=a[t[i].b];
a[t[i].b]=s;
}
}
for (int i=1;i<=n;i++) cout << a[i] <<endl;
return 0;
}