#include <stdio.h>
int main()
{
char c,d;
char str[1000] = { 0 };
int f, r;
int index;
c = getchar();
while (c != EOF) {
if (c == ' ' || c == '\t' || c == '\r') {
d = c;
c = getchar();
if (c == ' ' || c == '\t' || c == '\r') {
while (c == ' ' || c == '\t' || c == '\r') {
c = getchar();
if (c == 10) {
printf("*"); //공백 처리 확인
printf("\n");
}
}
}
else if (c == 10) {
printf("\n");
c = getchar();
}
else {
if (d == ' ') printf(" ");
printf("%c", c);
c = getchar();
}
}
else {
if (c == 10) {
printf("\n");
c = getchar();
}
else {
printf("%c", c);
c = getchar();
}
}
}
return 0;
}