#include <iostream>
#include <string>
#include <vector>
using namespace std;
class ExportStr{
	vector<string> m_Str;
public:
	ExportStr& Word(string str){
		if(!m_Str.empty()) m_Str.push_back(" ");
		m_Str.emplace_back(str);
		return *this;
	}
	void End(){
		for(auto Word : m_Str)
			cout << Word;
		cout << "." << endl;
	}
};
 
int main() {
	ExportStr Hoge;
	Hoge.Word("This").Word("is").Word("a").Word("Pen").End();
	return 0;
}