A stack allows three operations -push, pop andtop. Operationpushputs the input element at the top of the stack. Operationpoptakes the top element out of the stack and returns it to the caller. Operationtop only returns the top element of the stack without deleting it from the top of the stack.
Consider an initially empty stack of English words. Let us consider the following operations (separated by semicolons) on the stack.
top; push where; top; push the; push mind; top; push has; pop; push is; top; push without; push dear; pop; push fear; top; push and; push the; top; push bed; pop; top; push head; top; push is; push held; push high;
From this point on, we continue executing only the operationpop on the stack, until the stack is empty. The output of thesepopoperations only is as follows.
highheldisheadtheandfearwithoutismindthewhere
Note that there is no space on either side of the words printed by thepop operation. This ends the first phase of operations on the stack.
In the second phase, the following operations are executed on the stack.
push where; top; push know; push ledge; pop; pop; push knowledge; top; push is; push tree; pop; push free; push where; push thy; pop; top; push the; push world; top; top; push have; pop; push has; push not; top; push being; pop; push been; push broken; top; push up; push into; top; push fragments; top; push by; push narrow; push domestic; top; push walls;
H
enceforth, we continue executingonly the
operationpop as before, until the stack is empty. What will be the output of these finalpop operations only?
(Please ignore all outputs until the final sequence ofpop operations. In your answer, please exclude all spaces, quotation marks or any additional character other than the words from the stack.)