#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pb push_back
#define fi first
#define se second
#define ld long double
#define pii pair<int,int>
#define pll pair<long long,long long>
#define all(a) begin(a),end(a)
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define ordered_set tree<ld, null_type,less<ld>, rb_tree_tag,tree_order_statistics_node_update>
// order_of_key -> # less than k
// find_by_order -> k-th element
// pq max element

const double eps = 0.000001;
const int modi = 1e9+7;
const int NMAX = 200010;

void solve() {
    string s;
    cin >> s;
    int a,b;
    cin >> a >> b;
    if ( b > a ) {
        swap(s[0], s[1]);
        swap(a, b);
    }
    if ( a-b > 1 ) {
        puts("nemoguce");
        return;
    }
    for (int i = 0 ; i < a + b ; i++ ) {
        if ( i % 2 == 0 ) cout << s[0];
        else cout << s[1];
    }
}


int main () {
    

    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int t = 1;
    
    //cin >>t ; 


    int i = 1 ;
    while(t--) {
        //cout << "Case #" << i++ << ": " ;
        solve(); 
    }
}