#include <bits/stdc++.h>
using namespace std;

int main(){
    char c1, c2;
    int a1, a2, raz;
    cin>>c1>>c2>>a1>>a2;
    raz = a1-a2;
    switch (raz){
    case -1:
        for(int i=0; i<a2-1; i++)
            cout<<c2<<c1;
        cout<<c2;
        break;
    case 0:
        for(int i=0; i<a1; i++)
            cout<<c1<<c2;
        break;
    case 1:
        for(int i=0; i<a1-1; i++)
            cout<<c1<<c2;
        cout<<c1;
        break;
    default:
        cout<<"nemoguce";
    }
    return 0;
}