#include <iostream>
using namespace std;

int main() {
int a1;
int a2;
int min;
char c1, c2;
cin >> c1 >> c2 >> a1 >> a2;
min = a1;
if (a1 - a2 > 2 || a2 - a1 > 2)
  cout << "nemoguce";
else{
  if (a2 > a1){
    cout << c2;
    min = a2;
  }

  for (int i = 0; i < min; i++){
    cout << c1 << c2;
  }
  
  if (a1 > a2)
    cout << c1;

}


}