#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){
    if(left)return rem-a;
    else return 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++){
    int a,b; scanf("%d%d",&a,&b); a--; b--;
    bars[i] = make_pair(a,b);
  }
  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, bars[i].second);
    int b = origin(bars[i].first, bars[i].second+1);
    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);
}