#include <stdio.h> int main() { int a[100]; int x,t = 0; while(scanf("%d",&x) == 1 && x != 0) { a[t] = x; t = t + 1; } for( ;t > 0 ; t--) { printf("%d ",a[t - 1]); } return 0; }