#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{
    char a,b;
    int n,m;
    a=getchar();
    b=getchar();
    cin>>n>>m;
    if(abs(n-m)>=2)
        cout<<"nemoguce";
    else if(n<m)
    {
        while(n)
        {
            putchar(b);
            putchar(a);
            n--;
        }
        putchar(b);
    }
    else if(n>m)
    {
        while(m)
        {
            putchar(a);
            putchar(b);
            m--;
        }
        putchar(a);
    }
    else while(m)
        {
            putchar(a);
            putchar(b);
            m--;
        }
    return 0;
}