#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1.0);
void solve() {
  long long n, k, l, r, mid;
  cin >> n >> k;
  if (n == 2) {
    cout << "bb\n";
  } else if (n == 3) {
    if (k == 1)
      cout << "abb\n";
    else if (k == 2)
      cout << "bab\n";
    else
      cout << "bba\n";
  } else {
    l = 1;
    r = 100000;
    while (l <= r) {
      mid = (l + r) >> 1;
      if (mid * (mid + 1) / 2 < k)
        l = mid + 1;
      else
        r = mid - 1;
    }
    mid = n - (r + 2);
    for (int i = 1; i <= mid; i++) cout << 'a';
    cout << 'b';
    n -= mid + 1;
    k -= r * (r + 1) / 2;
    mid = n - k;
    for (int i = 1; i <= mid; i++) cout << 'a';
    cout << 'b';
    n -= mid + 1;
    for (int i = 1; i <= n; i++) cout << 'a';
    cout << '\n';
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int T;
  cin >> T;
  for (int t = 1; t <= T; t++) solve();
  return 0;
}
