#include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
char c1,c2;
cin>>c1>>c2;
int n1,n2;
cin>>n1>>n2;
if(n1==n2)
{
for(int i=0;i<n1;i++)
cout<<c1<<c2;
}
else if(n1==n2+1)
{
cout<<c1;
for(int i=0;i<n2;i++)
cout<<c2<<c1;
}
else if(n1==n2-1)
{
cout<<c2;
for(int i=0;i<n1;i++)
cout<<c1<<c2;
}
else
cout<<"nemoguce";
cout<<endl;
return 0;
}