{"trustable":true,"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":"HTML","content":"\u003cp\u003eFor the given integer $$$n$$$ ($$$n \u0026gt; 2$$$) let\u0027s write down all the strings of length $$$n$$$ which contain $$$n-2$$$ letters \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003ea\u003c/span\u003e\u0027 and two letters \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003eb\u003c/span\u003e\u0027 in \u003cspan class\u003d\"tex-font-style-bf\"\u003elexicographical\u003c/span\u003e (alphabetical) order.\u003c/p\u003e\u003cp\u003eRecall that the string $$$s$$$ of length $$$n$$$ is lexicographically less than string $$$t$$$ of length $$$n$$$, if there exists such $$$i$$$ ($$$1 \\le i \\le n$$$), that $$$s_i \u0026lt; t_i$$$, and for any $$$j$$$ ($$$1 \\le j \u0026lt; i$$$) $$$s_j \u003d t_j$$$. The lexicographic comparison of strings is implemented by the operator \u003cspan class\u003d\"tex-font-style-tt\"\u003e\u0026lt;\u003c/span\u003e in modern programming languages.\u003c/p\u003e\u003cp\u003eFor example, if $$$n\u003d5$$$ the strings are (the order does matter):\u003c/p\u003e\u003col\u003e \u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003eaaabb\u003c/span\u003e \u003c/li\u003e\u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003eaabab\u003c/span\u003e \u003c/li\u003e\u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003eaabba\u003c/span\u003e \u003c/li\u003e\u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003eabaab\u003c/span\u003e \u003c/li\u003e\u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003eababa\u003c/span\u003e \u003c/li\u003e\u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003eabbaa\u003c/span\u003e \u003c/li\u003e\u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003ebaaab\u003c/span\u003e \u003c/li\u003e\u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003ebaaba\u003c/span\u003e \u003c/li\u003e\u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003ebabaa\u003c/span\u003e \u003c/li\u003e\u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003ebbaaa\u003c/span\u003e \u003c/li\u003e\u003c/ol\u003e\u003cp\u003eIt is easy to show that such a list of strings will contain exactly $$$\\frac{n \\cdot (n-1)}{2}$$$ strings.\u003c/p\u003e\u003cp\u003eYou are given $$$n$$$ ($$$n \u0026gt; 2$$$) and $$$k$$$ ($$$1 \\le k \\le \\frac{n \\cdot (n-1)}{2}$$$). Print the $$$k$$$-th string from the list.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe input contains one or more test cases.\u003c/p\u003e\u003cp\u003eThe first line contains one integer $$$t$$$ ($$$1 \\le t \\le 10^4$$$) — the number of test cases in the test. Then $$$t$$$ test cases follow.\u003c/p\u003e\u003cp\u003eEach test case is written on the the separate line containing two integers $$$n$$$ and $$$k$$$ ($$$3 \\le n \\le 10^5, 1 \\le k \\le \\min(2\\cdot10^9, \\frac{n \\cdot (n-1)}{2})$$$.\u003c/p\u003e\u003cp\u003eThe sum of values $$$n$$$ over all test cases in the test doesn\u0027t exceed $$$10^5$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case print the $$$k$$$-th string from the list of all described above strings of length $$$n$$$. Strings in the list are sorted lexicographically (alphabetically).\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e7\n5 1\n5 2\n5 8\n5 10\n3 1\n3 2\n20 100\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eaaabb\naabab\nbaaba\nbbaaa\nabb\nbab\naaaaabaaaaabaaaaaaaa\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}