#include <stdio.h>
#define space ' '
int main(int argc, char **argv) {
int c;
while ((c = getchar()) != EOF) {
putchar (c);
if (c == space) {
while(c == space) {
c = getchar();
}
putchar(c);
}
}
return 0;
}