{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"PLAIN","content":" 从前有一座叫做零食城的城市,有种不同大小的零食会以一定的顺序降临到零食城, 而零食城的人要将这些零食从大到小自下而上摆成一座零食塔\n 然而,他们遇到了一些困难。每天都会有一个新的零食降临到这个城市,由于零食不一定按照从大到小的顺序降临,所以并不是每天都可以将新降临的零食直接放到零食塔的塔顶,必须等待所有比他大的零食都降临之后才可以。为了不触怒天神,每一个零食都要尽可能早地放到零食塔上。\n 请你写一个代码模拟摆零食的操作。"}},{"title":"Input","value":{"format":"PLAIN","content":" 第一行有一个整数 — 零食的总数。\n 第二行有 n个整数, 第 i 个整数表示第i天降临的零食大小。大小互不相同并且在 1 到 n之间。"}},{"title":"Output","value":{"format":"PLAIN","content":" 输出 n行. 第i输出第i天按照顺序放到零食塔上的零食的大小。如果当天没有零食被放到塔顶,则输出空行。"}},{"title":"Example","value":{"format":"PLAIN","content":"3\n3 1 2\n\n3\n \n2 1"}},{"title":"Note","value":{"format":"PLAIN","content":" 在样例中大小为 3 的零食第一天就降临, 当天我们就将其放到零食塔上。第二天大小为 1 的零食降临了, 但我们并不能将它放到塔顶,因为大小为 2的零食还没降临。第三天大小为2的零食降临了, 于是我们立即将它放到零食塔上。之后再将之前降临的大小为1的零食也放到零食塔上。"}}]}