#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(NULL);
  long long n, x, k, t, ind, su = 2, i;
  set<long long> se;
  map<long long, long long> mp;
  cin >> t;
  x = 2;
  while (x <= 2e9) {
    se.insert(x);
    mp[x] = su - 1;
    x += su;
    su++;
  }
  while (t--) {
    cin >> n >> k;
    if (k == 1) {
      for (int i = 0; i < n - 2; i++) cout << "a";
      cout << "bb" << endl;
      continue;
    }
    x = *(--se.upper_bound(k));
    ind = mp[x] + 2;
    i = n;
    for (i; i > ind; i--) cout << "a";
    cout << "b";
    i--;
    ind = k - x + 1;
    for (i; i > ind; i--) cout << "a";
    cout << "b";
    i--;
    for (i; i > 0; i--) cout << "a";
    cout << endl;
  }
}
