#include <iostream>
#include <iterator>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
vector<string> sen;
string s;
getline(cin, s);
for(int i = 0; i < s.length(); i++){
if(s[i] <'A' || (s[i]>'Z' && s[i] < 'a') || s[i] > 'z')
s[i] = ' ';
}
s+=' ';
string temp;
for(int i = 0; i < s.length();i++){
if(s[i] != ' ')
temp+= s[i];
else {
sen.push_back(temp);
temp = "";
}
}
reverse(sen.begin(), sen.end());
for(auto i : sen){
cout << i <<" ";
}
return 0;
}

京公网安备 11010502036488号