{"trustable":false,"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":"\u003cstyle type\u003d\u0027text/css\u0027\u003e .input, .output {border: 1px solid #888888;} .output {margin-bottom:1em;position:relative;top:-1px;} .output pre,.input pre {background-color:#EFEFEF;line-height:1.25em;margin:0;padding:0.25em;} .title {background-color:#FFFFFF;border-bottom: 1px solid #888888;font-family:arial;font-weight:bold;padding:0.25em;} \u003c/style\u003e \u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027]], displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027]]}\n });\n \u003c/script\u003e\n \u003cscript type\u003d\"text/javascript\" async\n src\u003d\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\"\u003e\n \u003c/script\u003e\n\n\u003cp\u003e Moira is an English major and has a midterm project deadline coming up. She has to write a paragraph but not with normal English words, rather using a different type of dictionary. Unfortunately, Moira isn’t able to make this dictionary and needs your help.\n \u003c/p\u003e\n\n\u003cp\u003e\n\nHer dictionary consists of only the alphabets ‘a’ and ‘b’. She will give you an integer n (n\u003e2) and you have to produce all the strings of length n which contain n−2 letters \u0027a\u0027 and two letters \u0027b\u0027 in lexicographical (alphabetical) order.\n\n\n\u003c/p\u003e\n\n\u003cp\u003e\n\nRecall that the string s of length n is lexicographically less than string t of length n, if there exists such i (1≤i≤n), that s[i] \u0026lt t[i], and for any j (1≤j \u0026lt i) s[j]\u003dt[j]. The lexicographic comparison of strings is implemented by the operator \u0026lt in modern programming languages.\n\n\n\u003c/p\u003e\n\n\u003cp\u003e\n\nFor example, if n\u003d3 the strings are (the order does matter):\n\u003col\u003e\n\u003cli\u003eabb\u003c/li\u003e\n\u003cli\u003ebab\u003c/li\u003e\n\u003cli\u003ebba\u003c/li\u003e\n\u003c/ol\u003e\nIt is easy to show that such a list of strings will contain exactly n⋅(n−1)/2 strings.\n\n\n\u003c/p\u003e\n\n\u003cp\u003e\nHowever, Moira doesn’t need all these strings of length n. Along with the length n (n \u0026gt 2), she will also give you an input k (1≤ k ≤ n⋅(n−1)/2). You need print the k-th string from the list for Moira.\n\n\u003c/p\u003e\n"}},{"title":"Input","value":{"format":"HTML","content":"\n\u003cp\u003eThe input contains one or more test cases.\u003cbr\u003e\nThe first line contains one integer t (1≤t≤10\u003csup\u003e4\u003c/sup\u003e) — the number of test cases in the test. Then t test cases follow.\u003cbr\u003e\nEach test case is written on the separate line containing two integers n and k (3≤n≤10\u003csup\u003e5\u003c/sup\u003e,1≤k≤min (2⋅10\u003csup\u003e9\u003c/sup\u003e, n⋅(n−1)2)). \u003cbr\u003e\nThe sum of values n over all test cases in the test doesn\u0027t exceed 10\u003csup\u003e5\u003c/sup\u003e\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).\n\n\u003c/p\u003e"}},{"title":"Example","value":{"format":"HTML","content":"\u003cdiv class\u003d\"sample-test\"\u003e \n \u003cdiv class\u003d\"input\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e \n \u003cpre\u003e7\n8 18\n19 11\n20 5\n15 19\n19 15\n20 6\n10 28\n\u003c/pre\u003e\n \u003c/div\u003e \n \u003cdiv class\u003d\"output\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e \n \u003cpre\u003eabaaabaa\naaaaaaaaaaaaabaaaab\naaaaaaaaaaaaaaaababa\naaaaaaaabaabaaa\naaaaaaaaaaaaabbaaaa\naaaaaaaaaaaaaaaabbaa\naabbaaaaaa\n\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}}]}