#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n",(x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define isYes(x) printf("%s\n",(x) ? "Yes" : "No")
#define isIn(x,y,h,w) (x >= 0 && x < h && y >= 0 && y < w)

#define int long long
//using ll = long long;
using P = pair<int,int>;

ostream &operator<<(ostream &os,const P &p){ return os << "(" << p.first << "," << p.second << ")"; }

template<class T> T &chmin(T &a,const T &b){ return a = min(a,b); }
template<class T> T &chmax(T &a,const T &b){ return a = max(a,b); }
 
const int INF=1e+18;
const double EPS=1e-9;
const int MOD=1000000009;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int h,w,n;

int pos_to_human(int x,int y){
	if(!y){
		x = x % (w * 2) - 1;
		if(x < 0) x += w * 2;
		if(x < w) return (x / 2 + 1) * 2 - 1;
		else return (w * 2 - x - 1) / 2 * 2;
	}
	if(y == w - 1) return w - pos_to_human(x,0) - 1;
	if((x + y) % 2) return pos_to_human(x + y,0);
	else return pos_to_human(x + w - y - 1,w - 1);
}

signed main(){
	cin >> h >> w >> n;
	vector<P> vec;
	for(int i = 0;i < n;i++){
		int a,b;
		cin >> a >> b; a--;b--;
		vec.emplace_back(a,b);
	}
	sort(all(vec));
	int human_to_zekken[200010];
	for(int i = 0;i < w;i++) human_to_zekken[i] = i;
	for(int i = 0;i < n;i++){
		int a = vec[i].first,b = vec[i].second;
		swap(human_to_zekken[pos_to_human(a,b)],human_to_zekken[pos_to_human(a,b + 1)]);
	}
	int ans[200010];
	for(int i = 0;i < w;i++) ans[human_to_zekken[pos_to_human(h,i)]] = i;
	for(int i = 0;i < w;i++) cout << ans[i] + 1 << endl;
}
