#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main(void) {
    char s[105];
    if (!fgets(s, size of(s), stdin)) {
        printf("Invalid input");
        return 0;
    }
    
    size_t n = strlen(s);
    if (n && s[n-1] == '\n') s[--n] = '\0';
    
    for (size_t i = 0; i < n; ) {
        if (s[i] == ' ') { i++;
        continue;
    }
    size_t l = i, r = i;
    while (r < n && s[r] != ' ') r++;
    for (size_t a= 1, b = r - 1; a < b; a++, b--) {
        char tmp = s[a]; s[a] = s[b]; s[b] = tmp;
    }
    i = r;
    
    return 0;
}