{"trustable":false,"prependHtml":"\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 async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"MD","content":"在ACM中,气球是一个亮点。\n当有队伍AC一道题,志愿者就会为其送上对应题目的气球。\n通常,为了在比赛中不至于太迟送上气球,志愿者会在比赛之前提前准备好一部分气球。\n已知目前气球房间内有 n 种颜色的气球,每种颜色有 x 个,且每种颜色的个数互不相同。\n因为气球颜色越多,可以预测其难度越低。请按气球数量从多到少,打印出它的颜色。"}},{"title":"Input","value":{"format":"MD","content":"第一个整数是 T ,表示有 T 个测试数据。T的大小约为 100。\n之后每个测试数据,对应一个整数 n ,表示气球颜色的种数。\n之后 n 行,每行一个字符串 s 和一个整数 x,表示颜色 s 的气球有 x 个。\n1\u0026le; n \u0026le;10\n1\u0026le; |s| \u0026le;10\n1\u0026le; x \u0026le;83\n保证气球个数互不相同,输入的气球颜色互不相同。"}},{"title":"Output","value":{"format":"MD","content":"对每个测试数据,输出1行。\n每行包含 n 个字符串,表示 n 种颜色,颜色之间用一个空格隔开,不要有多余的空格。"}},{"title":"Sample Input","value":{"format":"MD","content":"\u003cpre\u003e3\n3\nred 1\ngreen 2\nyellow 3\n1\nblue 83\n2\nred 2\nwhite 1\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"MD","content":"\u003cpre\u003eyellow green red\nblue\nred white\u003c/pre\u003e"}},{"title":"Hint","value":{"format":"MD","content":"可以尝试使用 vector 代替数组去做。"}}]}