#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
char s[100005];
int main() {
  int t;
  scanf("%d", &t);
  ;
  while (t--) {
    int n, k;
    scanf("%d", &n);
    ;
    scanf("%d", &k);
    ;
    int beg = 2;
    for (int i = 1; i <= n; ++i) {
      if (k <= i) {
        beg = i + 1;
        break;
      }
      k -= i;
    }
    for (int i = 1; i <= n; ++i) {
      if (i == k || i == beg)
        s[i] = 'b';
      else
        s[i] = 'a';
    }
    for (int i = n; i >= 1; --i) printf("%c", s[i]);
    printf("\n");
  }
}
