#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, k;
    cin >> n >> k;
    string s(n, 'a');
    int m = 0;
    int i;
    for (i = n - 2; i >= 0; i--) {
      m += n - 1 - (i);
      if (m >= k) {
        s[i] = 'b';
        s[i + (m - k + 1)] = 'b';
        cout << s << endl;
        break;
      } else {
        continue;
      }
    }
  }
  return 0;
}
