{"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":"HTML","content":"\u003cscript type\u003d\u0027text/x-mathjax-config\u0027\u003eMathJax.Hub.Config({tex2jax: { inlineMath: [[\u0027$\u0027,\u0027$\u0027]] } }); \u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027 src\u003d\u0027https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\u0027\u003e\u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027\u003esetTimeout(function(){MathJax.Hub.Queue([\u0027Typeset\u0027, MathJax.Hub, \u0027left_view\u0027]);}, 2000);\u003c/script\u003e\n\u003cdiv class\u003d\"panel_content\"\u003e\n Welcome to HDU to take part in the first CCPC girls\u0027 competition! \n \u003cbr\u003e \n \u003cbr\u003e \n \u003ccenter\u003e \n \u003cimg style\u003d\"max-width:100%;\" SRC\u003d\"CDN_BASE_URL/447d60ff4d002c0b038af203168398a7?v\u003d1562764413\"\u003e \n \u003c/center\u003e \n \u003cbr\u003e \n \u003cbr\u003eAs a pretty special competition, many volunteers are preparing for it with high enthusiasm. \n \u003cbr\u003eOne thing they need to do is blowing the balloons. \n \u003cbr\u003e \n \u003cbr\u003eBefore sitting down and starting the competition, you have just passed by the room where the boys are blowing the balloons. And you have found that the number of balloons of different colors are strictly different. \n \u003cbr\u003e \n \u003cbr\u003eAfter thinking about the volunteer boys\u0027 sincere facial expressions, you noticed that, the problem with more balloon numbers are sure to be easier to solve. \n \u003cbr\u003e \n \u003cbr\u003eNow, you have recalled how many balloons are there of each color. \n \u003cbr\u003ePlease output the solving order you need to choose in order to finish the problems from easy to hard. \n \u003cbr\u003eYou should print the colors to represent the problems. \n \u003cbr\u003e \n作为ACMer,众所周知,每个不同颜色的气球代表一道题,气球数量越多的问题肯定更容易解决。现在,你已经知道每种颜色有多少个气球。请输出你的最优做题顺序顺序,以便从简单到困难地完成问题。按照你解决问题的顺序打印出代表问题的颜色。\n\n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line is an integer $T$ which indicates the case number. \n\u003cbr\u003eAnd as for each case, the first line is an integer $n$, which is the number of problems. \n\u003cbr\u003eThen there are $n$ lines followed, with a string and an integer in each line, in the $i$-th line, the string means the color of ballon for the $i$-th problem, and the integer means the ballon numbers. \n\u003cbr\u003e \n\u003cbr\u003eIt is guaranteed that: \n\u003cbr\u003eT is about 100. \n\u003cbr\u003e1 \u003c\u003d n \u003c\u003d 10. \n\u003cbr\u003e1 \u003c\u003d string length \u003c\u003d 10\n\u003cbr\u003e1 \u003c\u003d bolloon numbers \u003c\u003d 83.(there are 83 teams :p) \n\u003cbr\u003eFor any two problems, their corresponding colors are different. \n\u003cbr\u003eFor any two kinds of balloons, their numbers are different. \n\u003cbr\u003e\n第一行是一个整数T,代表T组样例。对于每组样例,有一个整数n,代表问题的个数。后面有n行,每一行都有一个字符串和一个整数,在第i行中,字符串表示第i个问题中气球的颜色,整数表示气球的个数。"}},{"title":"Output","value":{"format":"HTML","content":"For each case, you need to output a single line. \n\u003cbr\u003eThere should be $n$ strings in the line representing the solving order you choose. \n\u003cbr\u003ePlease make sure that there is only a blank between every two strings, and there is no extra blank. \n\u003cbr\u003e\n232/5000 \n对于每组样例,都需要输出一行。这一行应该有n个字符串表示你选择的解题顺序。\n请确保每两个字符串之间只有一个空白,没有多余的空白。"}},{"title":"Sample Input","value":{"format":"HTML","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":"HTML","content":"\u003cpre\u003eyellow green red\nblue\nred white\u003c/pre\u003e"}}]}