#include <bits/stdc++.h>

using namespace std;

#define pii pair<int,int>
#define ll long long
#define s second
#define f first

string ab;
int a, b;

int main(){
  cin >> ab;
  cin >> a >> b;
  if(abs(a-b) > 1){cout << "nemoguce" << endl;}
  else{
   if(a >= b){
    for(int i = 0; i < a + b; ++i){cout << ab[i % 2];}
   }
   else{
    for(int i = 0; i < a + b; ++i){cout << ab[(i + 1) % 2];}
   }
  }
  return 0;
}