#include <iostream>
#include <iomanip>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <cstring>
#include <functional>
using namespace std;
typedef long long ll;
typedef pair<long long, long long> P;
#define rep(i, n) for(long long i=0; i<n; i++)
#define reps(i, s, e) for(long long i=s; i<e; i++)
#define repr(i, n) for(long long i=n-1; i>=0; i--)
#define reprs(i, s, e) for(long long i=e-1; i>=s; i--)

int main(){

    cin.tie(0);
    ios::sync_with_stdio(false);

    ll a, b; cin >> a >> b;

    ll aa, bb;

    aa = (a % 10) + ((a / 10) % 10) + a / 100;
    bb = (b % 10) + ((b / 10) % 10) + b / 100;

    if(aa >= bb){
        cout << aa << endl;
    }
    else{
        cout << bb << endl;
    }

    return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define int long long
int a,b,k;
int gcd(int x,int y)
{
    if(y==0) return x;
    else return gcd(y,x%y);
}
void dfs(int n,int m,int x)
{
	if(n==0)
	{
		while(m--) cout<<'b';
		return ;
	}
	if(m==0)
	{
		while(n--) cout<<'a';
		return ;
	}
	int q=1,w,ci=n+m-1,hh=1,yue=max(n-1,m),shao=min(m,n-1);
	for(int i=yue+1,j=1;i<=ci;i++,j++)
	{
		if(j<=shao) hh*=j;
		q*=i;
		w=gcd(q,hh);
		q/=w;hh/=w;
	}
	if(q<x)
	{
		cout<<'b';
		dfs(n,m-1,x-q);
	}
	else
	{
		cout<<'a';
		dfs(n-1,m,x);
	}
}
signed main()
{
	scanf("%lld%lld%lld",&a,&b,&k);
	dfs(a,b,k);
	return 0;
}