#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=100000+5;
const int M=100+5;
int n,m,k;
struct wer{
int l,r;
}q[M];
int tot=0;
int to[N],id[N],pos[N];
vector<int>v[N];
bool vis[N]={0};
void dfs(int pt){
id[pt]=tot;v[tot].push_back(pt);
pos[pt]=v[tot].size()-1;vis[pt]=1;
if (!vis[to[pt]])dfs(to[pt]);
}
int main(){
freopen ("usaco_Feb_swap.in","r",stdin);
freopen ("usaco_Feb_swap.out","w",stdout);
scanf ("%d%d%d",&n,&m,&k);
for (int i=1;i<=m;i++)scanf("%d%d",&q[i].l,&q[i].r);
for (int i=1;i<=n;i++){
int now=i;
for (int j=1;j<=m;j++){
int l=q[j].l,r=q[j].r;
if (now<l||now>r)continue;
now=l+r-now;
}
to[i]=now;
}
for (int i=1;i<=n;i++){
if (!vis[i])tot++,dfs(i);
}
for (int i=1;i<=n;i++){
int cnt=v[id[i]].size();
int p=k%cnt,x=pos[i];
printf("%d\n",v[id[i]][((x-p)%cnt+cnt)%cnt]);
}
return 0;
}