#include <bits/stdc++.h>
const double PI = atan(1.) * 4.;
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, k;
    cin >> n >> k;
    int sum = 0;
    int i = 0;
    while (1) {
      if (sum + i >= k) {
        break;
      }
      sum += i;
      i++;
    }
    int ans;
    ans = k - sum - 1;
    for (int j = 0; j < n; j++) {
      if (j == n - i - 1 || j == n - ans - 1) {
        cout << 'b';
      } else {
        cout << 'a';
      }
    }
    cout << endl;
  }
}
