#include <bits/stdc++.h>
using namespace std;
long long int find_up(long long int low, long long int high, long long int k) {
  long long int ans = 2;
  while (low <= high) {
    long long int mid = (low + high) / 2;
    long long int val = mid * (mid - 1);
    val /= 2;
    if (val >= k) {
      ans = mid;
      high = mid - 1;
    } else {
      low = mid + 1;
    }
  }
  return ans;
}
void get_string(vector<char> &v, long long int n, string &s) {
  for (long long int i = 0; i < n; i++) {
    s += v[i];
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, k;
    cin >> n >> k;
    vector<char> v(n, 'a');
    string s = "";
    if (k == 1) {
      v[n - 1] = 'b';
      v[n - 2] = 'b';
      get_string(v, n, s);
      cout << s << endl;
      continue;
    }
    long long int m = find_up(2, 1e5 + 3, k);
    long long int val = m * (m - 1);
    val /= 2;
    if (val == k) {
      v[n - m] = 'b';
      v[n - m + 1] = 'b';
      get_string(v, n, s);
      cout << s << endl;
      continue;
    } else {
      v[n - m] = 'b';
      long long int val1 = (m - 1) * (m - 2);
      val1 /= 2;
      k -= val1;
      k--;
      v[n - k - 1] = 'b';
      get_string(v, n, s);
      cout << s << endl;
      continue;
    }
  }
  return 0;
}
