#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t, cs = 1;
  cin >> t;
  while (t--) {
    long long n, k, ans = 0;
    cin >> n >> k;
    string str = "";
    for (long long i = 2; i <= n; i++) {
      if (ans < k && ans + i - 1 >= k) {
        for (long long j = 1; j < i; j++) {
          if (ans + j == k) {
            for (long long l = 1; l <= n; l++) {
              str += "a";
            }
            str[i - 1] = 'b';
            str[j - 1] = 'b';
            reverse(str.begin(), str.end());
            cout << str << endl;
            break;
          }
        }
        break;
      } else {
        ans += (i - 1);
      }
    }
  }
  return 0;
}
