#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int tt;
  cin >> tt;
  while (tt--) {
    long long int n, k;
    cin >> n >> k;
    vector<char> v(n, 'a');
    double k1 = k;
    double p1 = (1 + sqrt(1 + 4 * 2 * k));
    p1 = p1 / 2;
    long long int p = ceil(p1);
    p--;
    long long int sum = (p * (p - 1)) / 2;
    v[p] = 'b';
    long long int w = k - sum;
    w--;
    v[w] = 'b';
    reverse(v.begin(), v.end());
    for (int g = 0; g < v.size(); g++) cout << v[g];
    cout << endl;
  }
  return 0;
}
