/* author: Arjun Sreedharan */
#include <stdio.h>
#include <string.h>

#define BUFF_SIZE 2048

int main(void)
{

    char buff[2048];
    char *buff_temp = buff;
    char* buff_ptr = buff;
    unsigned int len = 0;

    while (fgets(buff_ptr, sizeof buff, stdin) != NULL) {
        len += strlen(buff_ptr) + 1;
        buff_ptr += strlen(buff_ptr);
    }
    buff_ptr = buff;

    while (--len) {
        while (*buff_ptr == ' ' && buff_ptr[1] == ' ') {
            --len;
            ++buff_ptr;
        }
        
       *buff_temp++ = *buff_ptr++;
    }
    printf("%s\n", buff);
}
