#include using namespace std; const int N = 110; int a[N]; int main() { int x; int idx; while (cin >> x && x) a[idx++] = x; for (int j = idx - 1; j >= 0; j--) cout << a[j] << " "; return 0; }