#include <bits/stdc++.h>
using namespace std;
const int N=100010;
int a[N],n,m,k,l[N],r[N];
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<=100000;i++)
{
a[i]=i;
}
for (int i=1;i<=m;i++)
{
scanf("%d%d",&l[i],&r[i]);
}
while (k--)
{
for (int i=1;i<=m;i++)
{
for (int j=l[i];j<=(l[i]+r[i])/2;j++)
{
swap(a[j],a[r[i]-(j-l[i])]);
}
}
}
for (int i=1;i<=n;i++)
{
printf("%d\n",a[i]);
}
}