#include <stdio.h>
int count(char str[100]){
int count=0;
for(int i=0; str[i];i++){
count++;
}
return count;
}
void reverse(char str[100]){
int n=count(str);
int start = 0;
int end = n-1;
while (start < end) {
if (str[start] == ' ') {
start++;
continue;
}
else if (str[end] == ' ') {
end--;
continue;
}
else {
int temp=str[start];
str[start]=str[end];
str[end]=temp;
start++;
end--;
}
}
for(int i=0;str[i];i++)
printf("%c",str[i]);}
int main() {
char str[100];
scanf("%[^\n]s",str);
// printf("%s",str);
reverse(str);
return 0;
}