#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  vector<long long> a;
  a.push_back(0);
  a.push_back(1);
  for (long long i = 2; i <= 100000; i++) a.push_back(i + a[i - 1]);
  while (t--) {
    string s = "";
    long long n, k;
    cin >> n >> k;
    for (long long i = 0; i < n; i++) s = s + "a";
    auto it = lower_bound(a.begin(), a.end(), k);
    long long p = it - a.begin();
    s[n - 1 - p] = 'b';
    long long x = p * (p - 1) / 2;
    long long o = k - x;
    s[n - o] = 'b';
    cout << s << "\n";
  }
}
