#include <iostream>
#include <string>

using namespace std;

int main()
{
	cout
	<<"Your first name: ";

	string name;
	cin >> name;

   //Build the message to write :
	string phrase = "Hello, " + name + "!";

	const int pad = 2;
	// nombre de lignes
	const int rows = pad * 2 + 3;

 // nombre de colonnes
	const std::string::size_type cols = phrase.size() + pad * 2 + 2;


 
	// build the frame
	for(int i = 0; i< rows;++i)
	{
		unsigned int j = 0;
		while(j<cols)
		{
			if((i==0) || (j==0) ||(i==rows-1)||(j==cols-1))
			{
				cout<<'*';
				++j;
			}
			else
			{
				if(i == ((rows-1)/2) && (j == pad+1))
				{
					cout << phrase;
					j+=phrase.size();
				}
				else
				{
					cout << ' ';
					++j;
				}
			}
		}
		cout<<endl;
	}

	return 0;
}
