#include <iostream>
#include <map>
#include <algorithm>
 
using namespace std;
 
typedef pair<int, int> P;
 
int get_first(int hi, int wi, int w) {
    int f;
    if ((hi+wi)%2 == 0) {
        if (wi >= hi) {
            f = wi-hi;
        }
        else {
            f = hi-wi-1;
        }
    }
    else {
        f = wi+hi;
    }
    if (f/w%2 == 0) {
        return f%w;
    }
    else {
        return w-f%w-1;
    }
}
 
int main() {
    int h, w, n;
    int index[200000], inv[200000];
    P ab[200000];
    cin >> h >> w >> n;
    for (int i=0; i<n; i++) {
        cin >> ab[i].first >> ab[i].second;
    }
    sort(ab, ab+n);
    for (int i=0; i<w; i++) {
        index[i] = i;
    }
    for (int i=0; i<n; i++) {
        int a = get_first(ab[i].first, ab[i].second-1, w);
        int b = get_first(ab[i].first, ab[i].second, w);
        int tmp = index[a];
        index[a] = index[b];
        index[b] = tmp;
    }
    for (int i=0; i<w; i++) {
        int f = get_first(h, i, w);
        inv[index[f]] = i;
    }
    for (int i=0; i<w; i++) {
        cout << inv[i]+1 << endl;
    }
    return 0;
}