    #include <stack>
    #include <string>
    #include <iostream>
    
    int main() 
    {
        std::string temp;
        std::stack<std::string> stk;
        while (std::cin >> temp)
            stk.push(temp);
        while (!stk.empty())
        {
          std::cout << stk.top() << " ";
          stk.pop();
        }
    }  
