#include using namespace std; int main(){ int n; std::vector v; while(cin >> n && n){ v.push_back(n); } reverse(v.begin(), v.end()); for(int i = 0; i < v.size(); i++){ cout << v[i] << ' '; } cout << endl; return 0; }