#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, k;
    cin >> n >> k;
    string str(n + 1, 'a');
    int i = 1, index = 0, total = 1;
    int x = 1, y = 1;
    while (!index) {
      if (k >= x && k <= y)
        index = i;
      else {
        i++;
        x = y + 1;
        y += i;
      }
    }
    str[n - index] = 'b';
    str[n - (k - x)] = 'b';
    for (int i = 1; i <= n; i++) cout << str[i];
    cout << "\n";
  }
  return 0;
}
