#include <iostream>
#include<string>
using namespace std;
int main()
{
	string s;
	while (getline(cin, s))
	{		
		int n = s.size();
		if (s[0] <= 'z' && s[0] >= 'a')
		{
			s[0] = s[0] - 32;
		}
		for (int i = 0; i < n - 1; i++)
		{
			if ((s[i] == ' ' || s[i] == '.' || s[i] == ','||s[i]=='\t'||s[i]=='\r'||s[i]=='\n') && (s[i + 1] <= 'z' && s[i + 1] >= 'a'))
			{
				s[i + 1] = s[i + 1] - 32;
			}
		}
		cout <<s<<endl;
	}
	return 0;
}