#include<bits/stdc++.h>
using namespace std;

int h,w,n;
inline int origin(int a, int b){
  int left = (a&1)==(b&1)?1:0;
  int rem = left?b:w-1-b;
  if(rem >= a)return left?rem-a:b+a;
  a -= rem;

  int rev = (a/w)&1;
  rem = a%w;
  if(left == 1-rev)return max(0,rem-1);
  else return min(w-1,w-rem);
}

int main(){
  scanf("%d%d%d",&h,&w,&n);
  vector< pair<int,int> > bars(n);
  for(int i=0;i<n;i++){
    scanf("%d%d",&bars[i].first,&bars[i].second);
  }
  sort(bars.begin(),bars.end());

  vector<int> perm(w);
  for(int i=0;i<w;i++)perm[i] = i;

  for(int i=0;i<n;i++){
    int a = origin(bars[i].first-1, bars[i].second-1);
    int b = origin(bars[i].first-1, bars[i].second);
    swap(perm[a],perm[b]);
  }

  vector<int> inv_perm(w);
  for(int i=0;i<w;i++)inv_perm[perm[origin(h,i)]] = i;
  for(int i=0;i<w;i++)printf("%d\n",inv_perm[i]+1);
}