#include <stdio.h>
    #include <stdlib.h> 

    int main(int argc, char *argv[]) {
    int a1,a2,i,z=0;
	char c1,c2;
	printf("unesi Perovo omiljeno slovo \n");
	scanf(" %c",&c1);
	printf("koliko tih slova poseduje\n");
	scanf(" %d",&a1);
	printf("unesi Petrino omiljeno slovo \n");
	scanf(" %c",&c2);
	printf("koliko tih slova poseduje\n");
	scanf(" %d",&a2);
	z=a1+a2;
	if(a1==a2)
		{
			for(i=0;i<a1;i++)
				printf("%c%c",c1,c2);
	    }
	else if(a1==a2+1)
			for(i=1;i<=z;i++)
				{
					if(i%2!=0)
						printf("%c",c1);
					if(i%2==0)
						printf("%c",c2);
				}
	else if(a2==a1+1)
			for(i=1;i<=z;i++)
				{
					if(i%2!=0)
						printf("%c",c2);
					if(i%2==0)
						printf("%c",c1);
				}
	else
		printf("nemoguce\n");	
     	return 0;
    }