#include <bits/stdc++.h>
using namespace std;

//      Starting Kit     (START)
typedef long long ll;
#define INF INT_MAX
#define MOD (1e9+7)

#define pii pair<int, int>
#define mp make_pair

#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vb vector<bool>
#define vs vector<string>
#define vvi vector<vi>
#define vii vector<pii>
#define pb push_back
#define print_vect(v) for (auto it : v) cout << it << " ";
//      Starting Kit     (END)


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    char c1c2[10];
    scanf("%s", c1c2);

    int a1, a2;
    scanf("%d %d", &a1, &a2);

    if ((int)abs(a1-a2) > 1) printf("nemoguce\n");
    else {

        if (a1 == a2)
            for (int i = 0; i < a1; ++i) printf("%s", c1c2);
        else if (a1 > a2) {
            for (int i = 0; i < a2; ++i) printf("%s", c1c2);
            printf("%c", c1c2[0]);
        }
        else {
            printf("%c", c1c2[1]);
            for (int i = 0; i < a1; ++i) printf("%s", c1c2);
        }
    }



    return 0;
}