{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"In this problem you have to find the permutations using the first **N** English capital letters. Since there can be many permutations, you have to print the first **K**.\n"}},{"title":"Input","value":{"format":"MD","content":"Input starts with an integer **T (\u0026#8804; 100)**, denoting the number of test cases.\n\nEach case contains two integers **N, K (1 \u0026#8804; N \u0026#8804; 26, 1 \u0026#8804; K \u0026#8804; 30)**.\n"}},{"title":"Output","value":{"format":"MD","content":"For each case, print the case number in a line. Then print the first **K** permutations that contain the first **N** English capital letters in alphabetical order. If there are less than **K** permutations then print all of them.\n"}},{"title":"Sample","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\u003e2\n3 8\n10 10\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1:\nABC\nACB\nBAC\nBCA\nCAB\nCBA\nCase 2:\nABCDEFGHIJ\nABCDEFGHJI\nABCDEFGIHJ\nABCDEFGIJH\nABCDEFGJHI\nABCDEFGJIH\nABCDEFHGIJ\nABCDEFHGJI\nABCDEFHIGJ\nABCDEFHIJG\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}