{"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 \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\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\u003e$T$ is about 100. \n\u003cbr\u003e$1\\leq n\\leq 10$. \n\u003cbr\u003e$1\\leq$ string length $\\leq 10$. \n\u003cbr\u003e$1\\leq$ bolloon numbers $\\leq 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"}},{"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"}},{"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"}}]}