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

char c1,c2;
int a1,a2,x,y;

int main(){
    cin >> c1 >> c2 >> a1 >> a2;
    x = a1-1;
    y = a2-1;

    if(abs(a1-a2) > 1){
      cout << "nemoguce";
    }

    else{
      if(a1 == a2){
        while(a1--){
          cout << c1 << c2;
        }
      }
      else if(a1 > a2){
        while(x--){
          cout << c1 << c2;
        }
        cout << c1;
      }
      else if(a1 < a2){
        while(y--){
          cout << c2 << c1;
        }
        cout << c2;
      }
    }

    return 0;
}