#include <iostream>
using namespace std;
int main() {
string str;
while (getline(cin, str)) {
size_t start = str.find_first_not_of(" \t\n\r");
if (start == string::npos) {
cout << "" << endl;
} else {
size_t end = str.find_last_not_of(" \t\n\r");
str.substr(start, end - start + 1);
}
for (int i = str.size() - 1; i >= 0; i--)
cout << str[i];
}
}
// 64 位输出请用 printf("%lld")

京公网安备 11010502036488号