#include <iostream>

using namespace std;

int main()
{   int a1,a2;
    char c1,c2;
    string s;
    getline(cin, s);
    c1=s[0];
    c2=s[1];
    cin>>a1>>a2;
    if(a1<=1||a2<=1)
    {cout<<"Brojevi nemogu biti manji od 1"<<endl;}
    else{
    if(a1>=50000||a2>=50000)
    {
        cout<<"Brojevi nemogu biti veci od 50000"<<endl;
    }else{
    if(a1<=0||a2<=0)
    {
        cout<<"Broj ne moze biti manji ili jednak nuli"<<endl;
    }else{
    if(a1-a2==2||a2-a1==2){
        cout<<"Nemoguce"<<endl;
    }else{
    if(a1>a2){
        for(int i=0;i<a1+a2;i++)
        {
            if(i%2==0){
                cout<<c2;
            }else{
                cout<<c1;
            }
        }
    }
    else{
        for(int i=0;i<a1+a2;i++)
        {
            if(i%2==0){
                cout<<c1;
            }else{
                cout<<c2;
            }
        }
    }
    }
    }
    }
    }
    return 0;
}