#include <iostream>
#include <string.h>
using namespace std;
#define MAX 300
void ChenChuoiTaiVitriK(char s[], char s1[], int k);
void Chuanhoa(char s[]);
int myStrlen(char s[], int k);
bool myStrcat(char s[], char s1[], char s2[]);
void myStrcpy(char s[], int vt, char s1[], int k);
int myStrstr(char s[], char s1[]);
int main()
{
char s[MAX];
fflush(stdin);
fgets(s,300,stdin);
char s1[MAX];
myStrcpy(s1, 0, s, 0);
Chuanhoa(s1);
puts(s);
puts(s1);
return 0;
}
int myStrlen(char s[], int k)
{
k = 0;
while(s[k] != '\0')
k++;
return k + 1;
}
void myStrcpy(char s[], int vt, char s1[], int k)
{
int len = myStrlen(s1, len);
for(int i = 0; i < len; i++)
s[i] = s1[i];
return;
}
void Chuanhoa(char s[])
{
int len = myStrlen(s, len);
char str[MAX];
int dem = 0;
for(int i = 0; i < len; i++)
{
if(s[i] == ' ' && s[i - 1] == ' ')
continue;
if(s[i] == ' ' && s[i + 1] == ' ')
continue;
if(s[i] == ' ' && s[i - 1] == '.')
continue;
if(s[i] == ' ' && s[i + 1] == '.')
continue;
if(s[i] == '.')
str[dem] = '.', str[++dem] = ' ';
else
str[dem] = s[i];
dem++;
}
myStrcpy(s, 0, str, 0);
return;
}
CiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPHN0cmluZy5oPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwojZGVmaW5lIE1BWCAzMDAKCnZvaWQgQ2hlbkNodW9pVGFpVml0cmlLKGNoYXIgc1tdLCBjaGFyIHMxW10sIGludCBrKTsKdm9pZCBDaHVhbmhvYShjaGFyIHNbXSk7CmludCBteVN0cmxlbihjaGFyIHNbXSwgaW50IGspOwpib29sIG15U3RyY2F0KGNoYXIgc1tdLCBjaGFyIHMxW10sIGNoYXIgczJbXSk7CnZvaWQgbXlTdHJjcHkoY2hhciBzW10sIGludCB2dCwgY2hhciBzMVtdLCBpbnQgayk7CmludCBteVN0cnN0cihjaGFyIHNbXSwgY2hhciBzMVtdKTsKCgppbnQgbWFpbigpCnsKCWNoYXIgc1tNQVhdOwoKCWZmbHVzaChzdGRpbik7CglmZ2V0cyhzLDMwMCxzdGRpbik7CgoJY2hhciBzMVtNQVhdOwoJbXlTdHJjcHkoczEsIDAsIHMsIDApOwoJQ2h1YW5ob2EoczEpOyAKCXB1dHMocyk7CglwdXRzKHMxKTsgCglyZXR1cm4gMDsKfQoKaW50IG15U3RybGVuKGNoYXIgc1tdLCBpbnQgaykKewogICAgayA9IDA7CiAgICB3aGlsZShzW2tdICE9ICdcMCcpCiAgICAgICAgaysrOwogICAgcmV0dXJuIGsgKyAxOwp9Cgp2b2lkIG15U3RyY3B5KGNoYXIgc1tdLCBpbnQgdnQsIGNoYXIgczFbXSwgaW50IGspCnsKICAgIGludCBsZW4gPSBteVN0cmxlbihzMSwgbGVuKTsKICAgIGZvcihpbnQgaSA9IDA7IGkgPCBsZW47IGkrKykKICAgICAgICBzW2ldID0gczFbaV07CiAgICByZXR1cm47Cn0Kdm9pZCBDaHVhbmhvYShjaGFyIHNbXSkKewogICAgaW50IGxlbiA9IG15U3RybGVuKHMsIGxlbik7CiAgICBjaGFyIHN0cltNQVhdOwogICAgaW50IGRlbSA9IDA7CiAgICBmb3IoaW50IGkgPSAwOyBpIDwgbGVuOyBpKyspCiAgICB7CiAgICAgICAgaWYoc1tpXSA9PSAnICcgJiYgc1tpIC0gMV0gPT0gJyAnKQogICAgICAgICAgICBjb250aW51ZTsKICAgICAgICBpZihzW2ldID09ICcgJyAmJiBzW2kgKyAxXSA9PSAnICcpCiAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgIGlmKHNbaV0gPT0gJyAnICYmIHNbaSAtIDFdID09ICcuJykKICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgaWYoc1tpXSA9PSAnICcgJiYgc1tpICsgMV0gPT0gJy4nKQogICAgICAgICAgICBjb250aW51ZTsKICAgICAgICBpZihzW2ldID09ICcuJykKICAgICAgICAgICAgc3RyW2RlbV0gPSAnLicsIHN0clsrK2RlbV0gPSAnICc7CiAgICAgICAgZWxzZQogICAgICAgICAgICBzdHJbZGVtXSA9IHNbaV07CiAgICAgICAgZGVtKys7CiAgICB9CiAgICAgICAgbXlTdHJjcHkocywgMCwgc3RyLCAwKTsKICAgIHJldHVybjsKfQ==