#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
string s; getline(cin,s);
while (s[0] == ' ') s.erase(0,1);
while (s[s.size() - 1] == ' ') s.erase(s.size() - 1,1);
s[0] = toupper(s[0]);
string v;
bool check = 0;
for (char c : s){
if (isspace(c)){
if (!check){
v += ' ';
check = 1;
}
}
else{
v += c;
check = 0;
}
}
cout << v;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiAKaW50IG1haW4oKXsKICAgIGlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oZmFsc2UpOyBjaW4udGllKG51bGxwdHIpOyBjb3V0LnRpZShudWxscHRyKTsKICAgICAgICBzdHJpbmcgczsgZ2V0bGluZShjaW4scyk7CiAgICAgICAgd2hpbGUgKHNbMF0gPT0gJyAnKSBzLmVyYXNlKDAsMSk7CiAgICAgICAgd2hpbGUgKHNbcy5zaXplKCkgLSAxXSA9PSAnICcpIHMuZXJhc2Uocy5zaXplKCkgLSAxLDEpOwogICAgICAgIHNbMF0gPSB0b3VwcGVyKHNbMF0pOwogICAgICAgIHN0cmluZyB2OwogICAgICAgIGJvb2wgY2hlY2sgPSAwOwogICAgICAgIGZvciAoY2hhciBjIDogcyl7CiAgICAgICAgICAgIGlmIChpc3NwYWNlKGMpKXsKICAgICAgICAgICAgICAgIGlmICghY2hlY2spewogICAgICAgICAgICAgICAgICAgIHYgKz0gJyAnOwogICAgICAgICAgICAgICAgICAgIGNoZWNrID0gMTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgZWxzZXsKICAgICAgICAgICAgICAgICAgICB2ICs9IGM7CiAgICAgICAgICAgICAgICAgICAgY2hlY2sgPSAwOwogICAgICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBjb3V0IDw8IHY7CiAgICAgIHJldHVybiAwOwp9