#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++)
#define RFOR(i,n,m) for(int i=(int)(n); i>=(int)(m); i--)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define ins insert

#define debug(a) cerr<<(a)<<endl
#define dbrep(a,n) rep(_i,n) cerr<<(a[_i])<<" "; cerr<<endl
#define dbrep2(a,n,m) rep(_i,n){rep(_j,m) cerr<<(a[_i][_j])<<" "; cerr<<endl;}

using namespace std;

template<class A, class B>
ostream &operator<<(ostream &os, const pair<A,B> &p){return os<<"("<<p.fi<<","<<p.se<<")";}
template<class A, class B>
istream &operator>>(istream &is, pair<A,B> &p){return is>>p.fi>>p.se;}

template<class T>
vector<T> make_vec(size_t a){
	return vector<T>(a);
}
template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
	return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

/* Some Libraries */

//-------------------------------------------------

ll comb[61][32];

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll A,B,K; cin>>A>>B>>K;

    comb[0][0] = 1;
    rep(i,60)rep(j,31){
        comb[i+1][j]+=comb[i][j];
        comb[i+1][j+1]+=comb[i][j];
    }

    int len = A+B;
    rep(i,len){
        if (A>0 && K<=comb[A+B-1][A-1]){
            cout<<'a';
            A--;
        }else{
            if (A>0) K-=comb[A+B-1][A-1];
            cout<<'b';
            B--;
        }
    }
    cout<<"\n";
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define pb push_back
#define F first
#define S second
#define um map <ll,ll>
#define rep(i,z,n)  for(int i=z;i<n;i++)
#define repi(i,z,n) for(int i=z;i<=n;i++)
#define repn(i,z,n) for(int i=n-1;i>=z;i--)
#define vec vector<ll>
#define vecp vector<pair<ll,ll>>
#define pi (double)3.14159265358979323846
#define ld long double
#define all(z) z.begin(),z.end()

ll power(ll a, ll b, ll m) { ll ans = 1; a = a % m; if (a == 0) return 0; while (b) { if (b & 1) ans = (ans * a) % m; b /= 2; a = (a * a) % m; } return ans; }
ll modInverse(ll a, ll m) {return power(a, m - 2, m);}
ll binpow(ll a, ll b) {ll res = 1; while (b > 0) {if (b & 1)res = res * a; a = a * a; b >>= 1;} return res;}
ll binlog2(ll n) {ll logValue = -1; while (n) {logValue++; n >>= 1;} return logValue;}
ll ceil(ll t1, ll t2) {ll ans = (t1 + t2 - 1) / t2; return ans;}
void print(vec a) {rep(i, 0, a.size())cout << a[i] << " "; cout << endl;}
const ll mod = 1e9 + 7;
const ll N = 2e3 + 5;
const ll inf = 2e18;

ll n, m;
char a[N][N];
ll dp[N][N];
ll ph[N][N];
ll pv[N][N];
ll pd[N][N];

void recur(ll i, ll j) {
    if (i == 1 && j == 1) {
        return;
    }

    if (i <= 0 || j <= 0 || a[i][j] == '#')
        return;

    if (dp[i][j] != -1)
        return ;

    recur(i - 1, j);
    recur(i, j - 1);
    recur(i - 1, j - 1);

    dp[i][j] = (ph[i - 1][j] + pv[i][j - 1] + pd[i - 1][j - 1]) % mod;
    ph[i][j] = dp[i][j];
    pv[i][j] = dp[i][j];
    pd[i][j] = dp[i][j];
    ph[i][j] += ph[i - 1][j] ;
    pv[i][j] += pv[i][j - 1] ;
    pd[i][j] += pd[i - 1][j - 1];
    ph[i][j] %= mod;
    pv[i][j] %= mod;
    pd[i][j] %= mod;

}


void solve() {
    cin >> n >> m;
    rep(i, 1, n + 1)
    rep(j, 1, m + 1) {
        cin >> a[i][j];
    }

    repi(i, 0, n + 3)
    repi(j, 0, m + 3)
    dp[i][j] = -1;

    dp[1][1] = 1;
    ph[1][1] = 1;
    pd[1][1] = 1;
    pv[1][1] = 1;
    recur(n, m);
    cout << dp[n][m] << endl;
    // repi(i, 1, n) {
    //     repi(j, 1, m) {
    //         cout << dp[i][j] << " ";
    //     }
    //     cout << endl;
    // }

}


int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    speed;
    int test = 1;
    // init();
    // cin >> test;
    // ll t1 = 1;
    while (test--) {
        // cout << "Case #" << t1 << ": ";
        solve();
        // t1++;
    }
    return 0;
}