#include <iostream>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <cctype>
using namespace std;

int main(int argc, char** argv) {
	
	char c1,c2;
	int a1,a2;
	

	cout << "Unesite prvo slovo: ";
	cin >> c1;
	cout<<endl;
	
	cout << "Unesite kolicinu prvog slova: ";
	cin >> a1;
	cout<<endl;
	
	cout << "Unesite drugo slovo: ";
	cin >> c2;
	cout<<endl;
	
	cout << "Unesite kolicinu drugog slova: ";
	cin >> a2;
	cout<<endl;
	
	if(c1==c2||a1==a2+2||a2==a1+2||a1+1<a2||a2+1<a1){
		cout<<"Los unos!";
	}
	cout<<endl;

	if(a1>a2||a1==a2){
		for(int i = 0;i<a1 || i<a2;i++){
			if(a1>i){
				cout<<c1<<"  ";
			}		
			if(a2>i){
				cout<<c2<<"  ";
			}
		}
	}
	if(a2>a1){
		for(int i = 0;i<a1 || i<a2;i++){		
			if(a2>i){
				cout<<c2<<"  ";
			}
			if(a1>i){
				cout<<c1<<"  ";
			}
		}
	}
	return 0;
}