{"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 Wild_cow had N(1≤N≤100000) boxes and each box has three properties: Length(L)、Width(W)、Height(H)(1≤L, W, H≤100000).\n \u003cbr\u003eHe defines a boards is better than b if and only if La \u003e\u003d Lb, Wa \u003e\u003d Wb, Ha \u003e\u003d Hb\n \u003cbr\u003eAnd the better one level add 1."}},{"title":"Input","value":{"format":"HTML","content":"The first line is T(1 ≤ T ≤ 15) means T Case \n\u003cbr\u003e \n\u003cbr\u003eFor each case \n\u003cbr\u003e \n\u003cbr\u003eThe first line is N means the number of boxes and next there are N line, each line has (W,H,L)"}},{"title":"Output","value":{"format":"HTML","content":"The output should contain N lines, one number per line. The first line contains amount of boxes of the level 0, the second does amount of boxes of the level 1 and so on, the last line contains amount of boxes of the level N-1."}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e1\n4\n10 4 7\n10 6 6\n8 2 5\n7 3 10\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e1\n1\n0\n0\u003c/pre\u003e"}}]}