#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
using namespace std;

#define pq_max          priority_queue<ll>
#define pq_min          priority_queue<ll,vi,greater<ll>>
#define iint int
#define f(i,a,b)        for(ll i=a;i<b;i++)
#define f0(i,n)         f(i,0,n)
#define fr(i,a,b)       for(ll i=a;i>=b;i--)
#define for1(i,n)       for(ll i=1;i<=n;i++)
#define pb              push_back
#define tc(t)           int t;cin >>t;while(t--)
#define lol             std::ios::sync_with_stdio(false); cin.tie(NULL);
#define endl            "\n"
#define ss              second
#define ff              first
#define ll              long long
#define lld             long double
#define int             long long
#define pii             pair< int,int >
#define pll             pair< ll,ll >
#define sz(a)           a.size()
const long long  inf = 1e18;
#define all(a)          a.begin(),a.end()
#define arr(a,n)        int a[n];f0(i, n) cin >> a[i];
#define ini(a,n)        memset(a,n,sizeof(a))
#define printArr(a,n)   f0(i,n) cout<<a[i]<<" ";
#define in              cin>>
#define rr              return 0;
#define vi              vector< int >
#define vs              vector<string>
#define l_b             lower_bound
#define u_b             upper_bound
#define mod             1000000007
#define pi              3.141592653589793238
#define fmap(m)         for(auto it:m)
#define deb(args...)    { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
#define debarr(arr,a,b) for(int i=(a);i<(b);i++) cout<<(arr[i])<<" ";cout<<endl;
#define long_max        numeric_limits<ll>::max()
vs tokenizer(string str, char ch) {std::istringstream var((str)); vs v; string t; while (getline((var), t, (ch))) {v.pb(t);} return v;}

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cout << *it << " = " << a << endl;
    err(++it, args...);
}
int dx[8] = { +1, +1, +1, 0, 0, -1, -1, -1};
int dy[8] = { +1, 0, -1, +1, -1, +1, 0, -1};

int dx4[4] = { +1 , -1 , +0 , +0};
int dy4[4] = { 0  , 0 , +1 , -1};

int dx2[2] = {0, 1};
int dy2[2] = {1, 0};

const int N = 1e4 + 10;

void solve()
{
    vector<vi>ncr(61 , vi(61, 0));
    ncr[0][0] = 1 ;

    for (int i = 1; i < 61; i++)
    {
        ncr[i][0] = 1;
        for (int j = 1 ; j < i; j++)
            ncr[i][j] = ncr[i - 1][j - 1] + ncr[i - 1][j];
        ncr[i][i] = 1;
    }

    int a, b, k;
    cin >> a >> b >> k;
    int n = a + b;
    f0(i, n)
    {
        int cnt = ncr[a - 1 + b][b];
        if (cnt >= k) //we put a
        {
            cout << 'a';
            a--;
        }
        else
        {
            cout << 'b';
            b-- ;
            k -= cnt;
        }
    }
    cout << '\n';
}

signed main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    lol;

    int t = 1;
    // cin >> t;
    while (t--)
        solve();
    return 0;
}
#include<bits/stdc++.h>

typedef   long long  int ll;
typedef  long double ld;
typedef std::vector<ll> vi;
typedef std::vector<std::vector<ll> > vv;
typedef std::vector<std::pair<ll,ll> > pii;
typedef std::pair<ll,ll> pi;

#define mod 1000000007
#define IO ios_base::sync_with_stdio(false);cin.tie(NULL);
#define fo(i,a,b) for(i=a;i<b;i++)
#define forr(i,a,b) for(i=a;i>=b;i--)
#define mp make_pair
#define pb(x) push_back(x)
#define fi first
#define se second
#define print(vec,a,b) for(ll i=a;i<b;i++) cout<<vec[i]<<" ";cout<<endl;
#define all(a) a.begin(),a.end()
#define input(vec,a,b) for(ll i = a;i<b;i++) cin>>vec[i];
#define ms(a,val) memset(a,val,sizeof(a))
using namespace std;

const int N = 1e5+ 5;



ll expo_pow(ll x, ll y) {
	if (y == 0)
		return 1;
	y = y % (mod - 1);
	x %= mod;
	if (y == 0)
		y = mod - 1;
	ll res = 1;
	while (y) {
		if (y & 1)
			res = (res * x) % mod;
		x = (x * x) % mod;
		y >>= 1;
	}
	return res;
}
 
ll modInverse(ll a, ll m = mod) {
	return expo_pow(a, m - 2);
}
	

void solve(){
            ll i,j,n,m,k;
            cin>>n;
            vi t(n,0);
            input(t,0,n);
            
            ll pos[N] = {0};
            pos[0] = 1;
            
            fo(j,0,n)
            {
                fo(i,0,N)
                {
                    if(i + t[j] >= N)
                     continue;
                    if(pos[i] == 1 && pos[i+t[j]] == 0)
                        pos[i+t[j]] = 2;
                }
                fo(i,0,N)
                {
                    if(i + t[j] >= N)
                     continue;
                    if(pos[i+t[j]] == 2)
                        pos[i+t[j]] = 1;
                }
            }

            ll sum = 0; 
            
            fo(i,0,n)
             sum+=t[i];
             
            ll val = ceil(1.0*sum/2);
            
            fo(i,val,N-1)
            {
                
                if(pos[i] == 1)
                {
                    cout<<i<<endl;
                    
                    return;
                }
            }
            
            
                
            
            
            
            
            
            
            
            
            
            
            
            
            
            
           
}



int main()
{
     //IO;
      ll t=1,i;
      //cin>>t;

		
      while(t--)
      {

          solve();
      }
    return 0;
}
