#define here cerr<<"---------------------------\n"
#include <bits/stdc++.h>
#define ld double
#define ll long long
#define ull unsigned long long
#define llinf 100000000000000000LL // 10^17
#define iinf 2000000000 // 2*10^9
#define pb push_back
#define popb pop_back
#define fi first
#define sc second
#define endl '\n'
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pld pair<ld,ld>
#define sz(a) int(a.size())
#define all(a) a.begin(),a.end()
using namespace std;


int main(){
	ios_base::sync_with_stdio(false);cerr.tie(0);cout.tie(0);cin.tie(0);
    string s; cin >> s;
    char a = s[0];
    char b = s[1];
    ll n,m; cin >> n >> m;
    if(abs(n-m)>1){
        cout<<"nemoguce"<<endl;
        return 0;
    }
    if(n<m){
        swap(n,m);
        swap(a,b);
    }
    for(ll i = 1;i<=(n+m);i++){
        if(i&1) cout<<a;
        else cout<<b;
    }
    cout<<endl;
	return 0;
}