#include <stdio.
h>
void swap_characters(char *a, char *b) {
char temp = *a;
*a = *b;
*b = temp;
}
void reverse_section(char *start, char *end) {
while (start < end) {
swap_characters(start, end);
start++;
end--;
}
}
void swap_words_in_string(char *str) {
char *start = str;
char *end = str;
while (*end != '\0') {
end++;
}
end--;
reverse_section(start, end);
char *word_start = NULL;
while (*start != '\0') {
while (*start == ' ' && *start != '\0') {
start++;
}
word_start = start;
while (*start != ' ' && *start != '\0') {
start++;
}
reverse_section(word_start, start - 1);
}
}
int main() {
char str[100];
scanf("%s",&str);
swap_words_in_string(str);
printf("Swapped string : %s\n", str);
return 0;
}