#include<bits/stdc++.h>
using namespace std;
int main()
{
string str;
vector<string> vec;
getline(cin, str);
auto iter = str.begin();
while(iter!=str.end())
{
string::iterator temp=iter;
while(iter != str.end() && *iter != ' ')
{
++iter;
}
vec.push_back(string(temp, iter));
if(iter != str.end())
{
++iter;
}
}
for(auto iter2 = vec.rbegin(); iter2 != vec.rend()-1; ++iter2)
{
cout<<*iter2<<" ";
}
cout<<vec.front()<<"\n";
}