#include <iostream>

using namespace std;

int main()
{
    string slova, ispis;
    int x, y;
    
    cin >> slova;
    cin >> x >> y;
    
    if(x-y>1)
    cout << "nemoguce";
    
    else if(y-x>1)
    cout << "nemoguce";
    
    else if(x==y)
    {
         for(int i = 0; i < x; i++)
         ispis += slova;
         cout << ispis;
    }
    
    else if(x==y+1)
    {
        for(int i = 0; i < y; i++)
         ispis += slova;
         ispis += slova[0];
         cout << ispis;
    }
    
    else if(y==x+1)
    {
        ispis += slova[1];
        for(int i = 0; i < x; i++)
         ispis += slova;
         cout << ispis;
    }
    

    return 0;
}