#include<iostream>
using namespace std;
#include<vector>
using ll = long long;
using vi = vector<int>;

ll C(int n, int k) {
  int f1 = n, f2 = 1;
  ll ret = 1;
  if (k>n/2) {
    ret = C(n,n-k);
  } else {
    for (int i=0;i<k;i++) {
      ret *= f1;
      ret /= f2;
      f1--;
      f2++;
    }
  }
  return ret;
}

int main() {
  int A,B,i;
  ll K;
  cin>>A>>B>>K;
  string ans = "";
  int a=0,b=0;
  for (i=1;i<=A+B;i++) {
    if (a<A) {
      ll c = C(A-a+B-b-1, A-a-1);
      if (c<K) {
        ans += 'b';
        b++;
        K -= c;
      } else {
        ans += 'a';
        a++;
      }
    } else {
      ans += 'b';
    }
  }
  cout<<ans<<endl;
  return 0;
}

#include <bits/stdc++.h>
#define eb emplace_back
using namespace std;
template<class T> using vc = vector<T>;
template<class T> using vv = vector<vector<T>>;
template<class T> using PQ = priority_queue<T, vc<T>, greater<T>>;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using tiii = tuple<int, int, int>;
using tlll = tuple<ll, ll, ll>;
using vi = vc<int>;
using vl = vc<ll>;
using vs = vc<string>;
const ld PI = 3.141592653589793;
const ll LINF = 1001001001001001001LL;
const int INF = 1001001001;

constexpr int MOD = 1e9 + 7;
//constexpr int MOD = 998244353;

struct mint {
  long long x;
  mint(long long x = 0) noexcept : x((x % MOD + MOD) % MOD) {}

  // basis
  mint operator-() const { return mint(-x); }
  mint& operator+=(const mint a) noexcept {
    if ((x += a.x) >= MOD) x -= MOD;
    return *this;
  }
  mint& operator-=(const mint a) noexcept {
    if ((x += MOD - a.x) >= MOD) x -= MOD;
    return *this;
  }
  mint& operator*=(const mint a) noexcept {
    (x *= a.x) %= MOD;
    return *this;
  }
  mint operator+(const mint a) const noexcept { return mint(*this) += a; }
  mint operator-(const mint a) const noexcept { return mint(*this) -= a; }
  mint operator*(const mint a) const noexcept { return mint(*this) *= a; }
  mint mpow(long long t) const noexcept {
    if (!t) return 1;
    mint a = mpow(t >> 1);
    a *= a;
    if (t & 1) a *= *this;
    return a;
  }

  // for prime MOD
  mint inv() const noexcept { return mpow(MOD - 2); }
  mint& operator/=(const mint a) noexcept { return *this *= a.inv(); }
  mint operator/(const mint a) const noexcept { return mint(*this) /= a; }

  // comparison
  bool operator==(const mint& a) const noexcept { return this->x == a.x; }
  bool operator!=(const mint& a) const noexcept { return this->x != a.x; }

  // I/O stream
  friend istream& operator>>(istream& is, mint& a) noexcept { return is >> a.x; }
  friend ostream& operator<<(ostream& os, const mint& a) noexcept { return os << a.x; }
};
// additional
mint mpow(const long long& a, long long n) noexcept { return mint(a).mpow(n); }
mint mpow(const mint& a, long long n) noexcept { return a.mpow(n); }

int main() {
  ll N, P;
  cin >> N >> P;
  mint ans = (mint)(P - 1) * mpow(P - 2, N - 1);
  cout << ans << endl;
}