#include <bits/stdc++.h>

#define debug(x) cerr << #x << " = " << x << endl

using namespace std;
typedef long long LL;

template <class T>
void read(T& x) {
    x = 0;
    T f = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9') f = (ch == '-' ? -1 : 1), ch = getchar();
    while (ch >= '0' && ch <= '9') x = x * 10 + ch - 48, ch = getchar();
    x *= f;
}

template <class T, class... Args>
void read(T& x, Args&... args) {
    read(x), read(args...);
}

template <class T>
void write(T x) {
    if (x < 0) putchar('-'), x = -x;
    if (x > 9) write(x / 10);
    putchar(x % 10 + '0');
}

const int MAXN = 2E5 + 5;
const int MOD = 1E9 + 7;
int n, m, q, a[MAXN], b[MAXN];

struct Node {
    int lson, rson, cnt;
    LL sum;
    Node() { cnt = sum = lson = rson = 0; }
} tr[MAXN * 80];

int roota, rootb;

int newNode() {
    static int cntNode = 1;
    return cntNode++;
}

void update(int cur) {
    tr[cur].cnt = tr[tr[cur].lson].cnt + tr[tr[cur].rson].cnt;
    tr[cur].sum = tr[tr[cur].lson].sum + tr[tr[cur].rson].sum;
}

void modify(int cur, int L, int R, int x, bool tag) {
    if (x == L && x == R) {
        if (tag == 0) {
            tr[cur].sum -= x;
            tr[cur].cnt--;
        } else {
            tr[cur].sum += x;
            tr[cur].cnt++;
        }
        return;
    }
    int mid = L + R >> 1;
    if (!tr[cur].lson) tr[cur].lson = newNode();
    if (!tr[cur].rson) tr[cur].rson = newNode();
    if (x <= mid)
        modify(tr[cur].lson, L, mid, x, tag);
    else
        modify(tr[cur].rson, mid + 1, R, x, tag);
    update(cur);
}

LL qsum(int cur, int L, int R, int l, int r) {
    if (!cur) return 0;
    if (l == L && r == R) return tr[cur].sum;
    int mid = L + R >> 1;
    if (r <= mid)
        return qsum(tr[cur].lson, L, mid, l, r);
    else if (l > mid)
        return qsum(tr[cur].rson, mid + 1, R, l, r);
    else
        return qsum(tr[cur].lson, L, mid, l, mid) +
               qsum(tr[cur].rson, mid + 1, R, mid + 1, r);
}

int qcnt(int cur, int L, int R, int l, int r) {
    if (!cur) return 0;
    if (l == L && r == R) return tr[cur].cnt;
    int mid = L + R >> 1;
    if (r <= mid)
        return qcnt(tr[cur].lson, L, mid, l, r);
    else if (l > mid)
        return qcnt(tr[cur].rson, mid + 1, R, l, r);
    else
        return qcnt(tr[cur].lson, L, mid, l, mid) +
               qcnt(tr[cur].rson, mid + 1, R, mid + 1, r);
}

signed main() {
    // freopen("1.in", "r", stdin);
    read(n, m, q);
    roota = newNode();
    rootb = newNode();
    LL ans = 0;
    for (int i = 1; i <= q; i++) {
        int t, x, y;
        read(t, x, y);
        if (t == 1) {
            int pre = a[x];
            a[x] = y;
            LL presum = qsum(rootb, 0, 1E8, pre, 1E8) +
                        1ll * (m - qcnt(rootb, 0, 1E8, pre, 1E8)) * pre;
            LL cursum = qsum(rootb, 0, 1E8, y, 1E8) +
                        1ll * (m - qcnt(rootb, 0, 1E8, y, 1E8)) * y;
            modify(roota, 0, 1E8, y, 1);
            modify(roota, 0, 1E8, pre, 0);
            ans = ans - presum + cursum;
        } else {
            int pre = b[x];
            b[x] = y;
            LL presum = qsum(roota, 0, 1E8, pre, 1E8) +
                        1ll * (n - qcnt(roota, 0, 1E8, pre, 1E8)) * pre;
            LL cursum = qsum(roota, 0, 1E8, y, 1E8) +
                        1ll * (n - qcnt(roota, 0, 1E8, y, 1E8)) * y;
            modify(rootb, 0, 1E8, y, 1);
            modify(rootb, 0, 1E8, pre, 0);
            ans = ans - presum + cursum;
        }
        printf("%lld\n", ans);
    }

    return 0;
}
#include<iostream>
#include<vector>
#include<map>
using namespace std;

int main(){
  int a, b; cin >> a >> b;
  long long k; cin >> k;
  vector<vector<long long>> s(a+1, vector<long long>(b+1));
  for(int i = a; i >= 0; i--){
  	for(int j = b; j >= 0; j--){
    
    	if(i==a || j==b) s[i][j] = 1;
    
    	else{
        	s[i][j] = s[i+1][j] + s[i][j+1];
        }
    }
  }
  
  string ans;
  long long min = 0;
  int i = 0, j = 0;
  for(int p = 0; p < a+b; p++){
  	if(i==a){
    	ans += 'b';
    	continue;
    }
  	if(j==b){
    	ans += 'a';
    	continue;
    }
  
  	if(k <= min + s[i+1][j]){
    	ans += 'a';
      	i++;
    }
  
  	else{
    	ans += 'b';
      	min += s[i+1][j];
      	j++;
    }
    
    //cout << min << endl;
  }
  
  cout << ans << endl;
  
  /*for(int x = 0; x <= a; x++){
  for(int y = 0; y <= b; y++){
  	cout << s[x][y] << " ";}
  cout << endl;
  }*/
}