#include <bits/stdc++.h>
using namespace std;
int t = 1;
int Go() {
  long long n, k;
  scanf("%lld %lld", &n, &k);
  long long x = 1;
  long long sum = 0;
  while (sum <= k) {
    sum += x;
    if (sum >= k) {
      break;
    }
    x++;
  }
  long long y = x - (sum - k + 1);
  string A = "";
  for (int i = 0; i < n; ++i) A += "a";
  A[x] = 'b';
  A[y] = 'b';
  reverse(A.begin(), A.end());
  cout << A << endl;
  return 0;
}
int main() {
  scanf("%d", &t);
  while (t--) Go();
}
