#include <iostream>
using namespace std;
int main()
{
    char c1,c2,String;
    int a1,a2,i=0;
    cin>>c1>>c2;
    cin>>a1;
    cout<<" ";
    cin>>a2;
    String=c1+c2;
    if (a1==a2)
    {
        while(i<a1)
        {
            i++;
            String+=String;
        }
        cout<<String;
    }
    else
        cout<<"nemoguce";
    return 0;
}