1. #include <bits/stdc++.h>
  2. #define ll long long int
  3. #define ld long double
  4. using namespace std;
  5.  
  6. void mainSolve()
  7. {
  8. int n, x;
  9. cin >> n >> x;
  10. if (n == 1)
  11. {
  12. cout << "a\n";
  13. return;
  14. }
  15. if (n < (2 * x) - 1)
  16. {
  17. cout << "-1\n";
  18. return;
  19. }
  20. string ans = "";
  21. int i = 0;
  22. for (char a = 'a'; i < x; i++, a++)
  23. ans += a;
  24. string last = ans;
  25. reverse(last.begin(), last.end());
  26. n -= (2 * x);
  27. if (n < 0)
  28. {
  29. cout << ans;
  30. for (int i = x - 2; i >= 0; i--)
  31. cout << ans[i];
  32. cout << endl;
  33. return;
  34. }
  35. while (n--)
  36. ans += 'a';
  37. ans += last;
  38. cout << ans << endl;
  39. }
  40.  
  41. int main()
  42. {
  43. #ifndef ONLINE_JUDGE
  44. freopen("input.txt", "r", stdin);
  45. freopen("output.txt", "w", stdout);
  46. #endif
  47. int t;
  48. cin >> t;
  49. while (t--)
  50. {
  51. mainSolve();
  52. }
  53. return 0;
  54. }