Pushing p r o g r a m should yield m a r g o r p when popping, provided you wait until after the m is pushed. If your program was to pop somewhere in the middle of the pushes, the order might not simply be a reverse of the input.
But if all you are doing is reversing the order of input, why not just iterate through it in reverse?