#include <bits/stdc++.h>

using namespace std;

int main(){
	ios_base::sync_with_stdio(false); 
    cin.tie(NULL) ; cout.tie(NULL) ;
    
    char a, b;
    cin>>a>>b;
    long int x, y;
    cin>>x>>y;
    
    if(y>x){
    	swap(x,y);
    	swap(a,b);
	}
    
    if(x-y > 1){
    	cout<<"nemoguce";
	}else{
		for(long int i = 1;i<=y;i++){
			cout<<a;
			cout<<b;
		}
		if(x-y == 1) cout<<a;
	}
    
    return 0;
}