#include <iostream>
#include <string>
#include <cmath>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {


	string ulaz,resenje="";
	long int b1,b2;
	char c1, c2;
	
	cin>>ulaz;
	cin>>b1>>b2;
	
	c1=ulaz[0];
	c2=ulaz[1];
	
	int x=abs(b1-b2);
	if(	x <1){
		for( int i=0; i<b1 ;i++){
			resenje=resenje+ulaz;
		}
	}else if(x<2){
		if(b1>b2){
			for( int i=0; i<b2 ;i++){
			resenje=resenje+ulaz;
			
			}
		resenje=resenje+c1;
		}else{
			resenje=resenje+c2;
			b2=b1;
			for( int i=0; i<b2 ;i++){
			resenje=resenje+ulaz;
			}
		}
	}else{
		resenje="nemoguce";
	}
	cout<<resenje;	
	return 0;
}