#include<bits\stdc++.h>

using namespace std;

int main()
{
ios_base :: sync_with_stdio(false);
cin.tie(0);cout.tie(0);
string s,s1;
char c1,c2;
int a1,a2,i;
cin>>s;
cin>>a1>>a2;
c1=s[0];
c2=s[1];

if(abs(a1-a2)>1) cout<<"nemoguce"<<'\n';
for(i=0;i<(a1+a2)-2;i++){
if(i==0||i%2==0)s.push_back(c1);
else s.push_back(c2);
}
cout<<s<<'/n';


    return 0;
}