#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, k;
    cin >> n >> k;
    k--;
    int i = 1;
    while (k >= i) {
      k -= i;
      i++;
    }
    string x;
    for (int j = 0; j < n; j++) {
      if (j == (n - i - 1) || j == (n - k - 1)) {
        cout << "b";
      } else {
        cout << "a";
      }
    }
    cout << endl;
  }
}
