#include <iostream>

using namespace std;

int main()
{
    char a, b;
    int c1, c2;
    
    string rec = "";
    
    cin >> a >> b;
    cin >> c1 >> c2;
    
    bool razlikaIzmedjuBrojaSlovaPrevelika = c1 > c2 + 1 || c2 > c1 + 1;
    
    if (razlikaIzmedjuBrojaSlovaPrevelika) {
        cout << "ne moze";
        return 1;
    }
    
    if (c1 == c2) {
        for (int i =0; i < c2 ; i++) {
            rec = rec + a + b;
        }
    }
    
    if (c1 > c2) {
        for (int i =0; i < c2 ; i++) {
            rec = rec + a + b;
        }
        rec = rec + a;
        
    }
    
    if (c1 < c2) {
        for (int i =0; i < c1 ; i++) {
            rec = rec + b + a;
        }
        rec = rec + b;
    }
    
    cout << rec;

    return 0;
}