#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  long long n, k;
  for (long long o = 0; o < t; o++) {
    cin >> n >> k;
    long long y = n * (n - 1);
    y /= 2;
    long long i;
    if (k != 1 && k != (n * (n - 1)) / 2) {
      for (i = 2; i <= y; i++) {
        if (i * (i + 1) / 2 < k) {
          continue;
        } else
          break;
      }
    }
    long long x = k - (i * (i - 1)) / 2;
    x--;
    if (k == 1) {
      for (long long i = 0; i < n - 2; i++) {
        cout << "a";
      }
      cout << "bb"
           << "\n";
    } else if (k == (n * (n - 1)) / 2) {
      cout << "bb";
      for (long long i = 0; i < n - 2; i++) {
        cout << "a";
      }
      cout << "\n";
    } else {
      for (long long j = 1; j <= n; j++) {
        if (j == n - x) {
          cout << "b";
        } else if (j == n - i) {
          cout << "b";
        } else
          cout << "a";
      }
      cout << "\n";
    }
  }
  return 0;
}
