#include<bits/stdc++.h>

using namespace std;

int main(){
    long long n, m;
    char a, b;
    cin >> a >> b >> n >> m;
    if(n == m - 1) swap(a, b);
    else if(n - 1 != m && n != m){
        cout << "nemoguce";
        return 0;
    } 
    for(long long i = 0 ; i < m ; i++){
        cout << a << b;
    }
    if(m - 1 == n)
        cout << a;

    return 0;
}