#include <iostream>
#include <algorithm>
using namespace std;
int main(){
    string c1,c2,c3;
    int a1,a2;
    cin>>c3;
    c1=c3[0];
    c2=c3[1];
    cin>>a1;
    cin>>a2;
    string s1[a1],s2[a2],rec[a1+a2];
    fill_n(s1, a1, c1);
    fill_n(s2, a2, c2);
    if(a1>a2){
            rec[0]=c1;
    }
    else{
            rec[0]=c2;
    }
    if(a2>a1+1||a1>a2+1){
        cout<<"nemoguce";
        
    }
    else{
        for(int i=0;i<=a2+a1;i++){
            if(rec[i]==c1)
                rec[i+1]=c2;
            else{
                rec[i+1]=c1;
            }
        }
        for (int i =0; i <= a1+a2-1; i++) 
        cout << rec[i];
    }
}