#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int a, b;
  cin >> a >> b;
  long long int cnt = 0;
  string s(a, 'a');
  for (long long int i = 1; i <= a - 1; i++) {
    cnt += i;
    if (cnt == b) {
      s[i] = 'b';
      s[i - 1] = 'b';
      break;
    } else if (cnt > b) {
      s[i] = 'b';
      long long int n = b - i * (i - 1) / 2 - 1;
      s[n] = 'b';
      break;
    }
  }
  reverse(s.begin(), s.end());
  cout << s << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
