#include <iostream>
#include <string>
using namespace std;
 
int main(){
    string str,newstr("");
    getline(cin,str);
    int j = str.length();
    for(int i = str.length()-1; i >= 0; i--){
        if(str[i] == ' '){
            newstr += str.substr(i+1,j-1-i);
            newstr += ' ';
            j = i;
        }
        if(i == 0)
            newstr += str.substr(0,j);
    }
    cout << newstr;
    return 0;
}