#include <iostream>
#include <string>
using namespace std;
void test(string s)
{
for(int i=0; i<s.length(); i++)
{
if(((s[i]<65) || ((s[i]>90) && (s[i]<97)) || (s[i]>122)) && ((s[i]!=32) && (s[i]!=46)))
{
s.erase(i, 1);
i--;
}
}
for(i=0; i<s.length(); i++)
{
if(i==0)
s[i]=toupper(s[i]);
if(s[i]==46)
{
s[i+1]=toupper(s[i+1]);
i++;
}
}
cout << s << endl;
}
int main()
{
test("asdfs(^df.sdf%$asd%.gd(s.g*ed");
return 0;
}