Output #1
3 3 4 4 3 -1 -1 4 4 -1 4
Initially, $A$ is an empty sequence, so $A = ()$, and an empty sequence is recorded on each page of the notebook.
* By the $1$\-st query, $3$ is appended to the tail of $A$, resulting in $A = (3)$.
* By the $2$\-nd query, the sequence recorded on the $1$\-st page of the notebook becomes $(3)$. It remains that $A = (3)$.
* By the $3$\-rd query, $4$ is appended to the tail of $A$, resulting in $A = (3, 4)$.
* By the $4$\-th query, the sequence recorded on the $2$\-nd page of the notebook becomes $(3, 4)$. It remains that $A = (3, 4)$.
* By the $5$\-th query, $A$ is replaced by $(3)$, which is recorded on the $1$\-st page of the notebook, resulting in $A = (3)$.
* By the $6$\-th query, the last term of $A$ is removed, resulting in $A = ()$.
* By the $7$\-th query, nothing happens because $A$ is already empty. It remains that $A = ()$.
* By the $8$\-th query, $A$ is replaced by $(3,4)$, which is recorded on the $2$\-nd page of the notebook, resulting in $A = (3, 4)$.
* By the $9$\-th query, the sequence recorded on the $1$\-st page of the notebook becomes $(3, 4)$. It remains that $A = (3, 4)$.
* By the $10$\-th query, $A$ is replaced by $()$, which is recorded on the $3$\-rd page of the notebook, resulting in $A = ()$.
* By the $11$\-th query, $A$ is replaced by $(3, 4)$, which is recorded on the $1$\-st page of the notebook, resulting in $A = (3, 4)$.