#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define pb push_back
typedef long long ll;
const double pi = acos(-1.0);
#define debug puts("*****************")
#define memset(a,b) memset(a,b,sizeof(a))
const int mod = (1 ? 1000000007 : 998244353);
const int inf = (1 ? 0x3f3f3f3f : 0x7fffffff);
const int dx[] = { -1,0,1,0 }, dy[] = { 0,1,0,-1 };
const ll INF = (1 ? 0x3f3f3f3f3f3f3f3f : 0x7fffffffffffffff);
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll poww(ll a, ll b,ll mod) { ll s = 1; while (b) { if (b & 1)s = (s * a) % mod; a = (a * a) % mod; b >>= 1; }return s % mod; }
/*----------------------------------------------------------------------------------------------------------------------*/

const int N = 1e5 + 11;
ll n,m;

void solve()
{
	cin>>n>>m;
	ll q=poww(10,n,m*m);
	cout<<q/m<<endl;
}


/*----------------------------------------------------------------------------------------------------------------------*/
int main()
{
    ios::sync_with_stdio(false); cin.tie(0);
    ll T = 1;
    //cin >> T;
    while (T--)solve();
    return 0;
}

#include<bits/stdc++.h>
#define int long long
typedef long long ll;
using namespace std;
//template<class T>T ABS(T x) {return x<0?-x:x;}
//int ksm(int x,int y) {int r=1;while(y) y&1?r=1ll*r*x%mod:0,x=1ll*x*x%mod,y>>=1;return r;}
int read() {
	int s=0,w=1;
	char ch=getchar();
	while(ch<'0'||ch>'9') {if(ch=='-')w=-1;ch=getchar();}
	while(ch>='0'&&ch<='9') s=(s<<3)+(s<<1)+(ch^48),ch=getchar();
	return s*w;
}
const int maxn = 1e5+10;
//const int mod = ;
//struct Edge{int to,next;}a[maxn];int h[maxn],cnt;
//void add(int x,int y) {a[++cnt]=(Edge){y,h[x]},h[x]=cnt,a[++cnt]=(Edge){x,h[y]},h[y]=cnt;}
//vector<int>G[maxn];
//void add(int x,int y) {G[x].push_back(y),G[y].push_back(x);}
int A,B,K;
int C(int x,int y) {
	int ans=1;
	for(int i=1;i<=y;i++) ans=ans*(x-i+1)/i;
	return ans;
}
signed main() {
	A=read(),B=read(),K=read();
	for(int i=1,now=A+B;i<=now;i++) {
		int tt=C(A+B-1,A-1);
		if(!A) cout<<'b',--B;
		else if(!B) cout<<'a',--A;
		else if(K<=tt) cout<<'a',--A;
		else K-=tt,cout<<'b',--B;
	}
	return 0;
}