#include<iostream>
#include<cmath>

using namespace std;

int main(){
  char c1, c2; 
  int a1, a2;
  string rec;
  cin >> c1 >> c2 >> a1 >> a2;
  if(abs(a1 - a2) == 0 or abs(a1 - a2) == 1){
    if(a2 > a1){
      for(int i = 0; i < a1; i++){
          rec += c2;
          rec += c1;
      }
      rec += c2;
    }
    else if(a1 > a2){
      for(int i = 0; i < a2; i++){
          rec += c1;
          rec += c2;
      }
      rec += c1;
    }
    else{
      for(int i = 0; i < a2; i++){
          rec += c1;
          rec += c2;
      }
    }
  }
  else cout << "nemoguce";
  cout << rec;
}