#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long int t;
  cin >> t;
  long long int a, b;
  while (t--) {
    cin >> a >> b;
    long long int no = 1, temp = 1;
    long long int c = 0, pos1 = 1, pos2;
    while (no < b) {
      pos1++;
      no += (c + 2);
      c++;
    }
    long long int val = (c * (c + 1)) / 2;
    pos2 = (b - val - 1);
    string ans(a, 'a');
    ans[a - pos1 - 1] = 'b';
    ans[a - pos2 - 1] = 'b';
    cout << ans << endl;
  }
}
