#include<iostream>
using namespace std;
int main()
{
    char s[2];
    cin>>s;

    int n,m;
    cin>>n>>m;
    if((n-m)*(n-m)>1)
    {
        cout<<"nemoguce";
        return 0;
    }
    char s1[2],s2[2];
    s1[0]=s[0];
    s1[1]='\0';
    s2[0]=s[1];
    s2[1]='\0';
    if(n>m)
    {
        for(int i=0;i<m;i++)
            cout<<s1<<s2;
        cout<<s1;
        return 0;
    }
    else
    {
        for(int i=0;i<n;i++)
            cout<<s2<<s1;
        cout<<s2;
        return 0;
    }
}