#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, k;
    cin >> n >> k;
    int lg1 = n - 1, lg2 = n;
    int pos1 = n - 1, pos2 = n;
    int cnt = 0, i, j;
    for (i = lg1; i >= 1; i--) {
      for (j = lg2; j > i; j--) {
        cnt++;
        if (cnt == k) break;
      }
      if (cnt == k) break;
    }
    for (int x = 1; x <= n; x++) {
      if (x == i || x == j)
        cout << 'b';
      else
        cout << 'a';
    }
    cout << "\n";
  }
  return 0;
}
