#include<cstdio>
#include<cmath>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
using namespace std;
#define MAXN 100005
#define lowbit(x) (x&-x)
#define reg register
typedef long long LL;
typedef unsigned long long uLL;
typedef unsigned int uint;
typedef pair<int,int> pii;
const int INF=0x7f7f7f7f;
const int mo=998244353;
const double PI=acos(-1.0);
template<typename _T>
_T Fabs(_T x){return x<0?-x:x;}
template<typename _T>
void read(_T &x){
	_T f=1;x=0;char s=getchar();
	while(s>'9'||s<'0'){if(s=='-')f=-1;s=getchar();}
	while('0'<=s&&s<='9'){x=(x<<3)+(x<<1)+(s^48);s=getchar();}
	x*=f;
}
int a,b;LL dp[35][35],k;
char str[65];
signed main(){
	dp[0][0]=1;
	for(int i=0;i<=30;i++)
		for(int j=0;j<=30;j++){
			if(i)dp[i][j]+=dp[i-1][j];
			if(j)dp[i][j]+=dp[i][j-1];
		}
	read(a);read(b);read(k);int len=a+b;
	for(int i=1;i<=len;i++){
		if(a&&b){
			if(k>dp[a-1][b])k-=dp[a-1][b],str[i]='b',b--;
			else str[i]='a',a--;
		}
		else if(!a)str[i]='b',b--;
		else if(!b)str[i]='a',a--;
		//printf("%d %d %d:%d %d %d\n",a,b,k,dp[a][b],dp[a-1][b],dp[a][b-1]);
	}
	printf("%s\n",str+1);
	return 0;
}


#include"bits/stdc++.h"
#define rep(i,n) for(ll i=0;i<n;++i)
#define ALL(x) x.begin(),x.end()
#define BACK(x) x.rbegin(),x.rend()
#define MOD 1000000007
#define INF INT_MAX
#define FLOAT_ANS setprecision(30)
#define TORAD(x) (x*acos(-1)/180.0)
#define TODEG(x) (x*180/acos(-1))
#define elif else if

using namespace std;
typedef long long ll;
typedef unsigned long long ull;

template<typename T>
bool chmin(T& a,T b){
	if(a>b){
		a=b;
		return true;
	}
	return false;
}

template<typename T>
bool chmax(T& a,T b){
	if(a<b){
		a=b;
		return true;
	}
	return false;
}

ll modpow(ll a, ll n, ll mod) {
    ll res=1;
    while (n>0) {
        if(n&1)res=(res*(a%mod))%mod;
        a=((a%mod)*(a%mod))%mod;
        n>>=1;
    }
    return res;
}

// MAIN PROGRAM -------------

int main(){
	string s;
	cin>>s;
	ll n=s.length();
	vector<char>t(n*2+100,'.');
	ll left=n+10,right=n+9;
	bool turn = false;
	for(auto c:s){
		if(c=='R'){
			turn=!turn;
			--n;
		}
		else{
			if(turn){
				--left;
				t[left]=c;
			}
			else{
				++right;
				t[right]=c;
			}
		}
	}

	stack<char>stk;
	rep(i,n){
		if(!stk.empty() && stk.top()==t[left+i]){
			stk.pop();
		}
		else{
			stk.push(t[left+i]);
		}
	}

	vector<char>ans;
	while(!stk.empty()){
		ans.push_back(stk.top());
		stk.pop();
	}

	if(turn){
		for(auto i:ans){
			cout<<i;
		}
	}
	else{
		for(ll i=ans.size()-1; i>=0; --i)cout<<ans[i];
	}
}

/*

*/