Original formulation is given here (you can try also your program for correctness) .
Additional rules:
1. The program should read from standard input and write to s
I'm not out to break any records but I'll post this anyway:
#define x(z) while(p>##z s)putchar(*p--);
main(c){
int s[9],*p=s-1;
for(;read(0,&c,1);){
isalpha(c)?putchar(c):c=='('?(c=0):c==')'?(c=1):isdigit(c)?:(*++p=c);
if(c==0){x()main(0);}
if(c==1) break;}
x(=)return 0;}
Edit: Fixed correctness issues pointed out by kuszi's comment.