#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
long long a[MAXN];
int main() {
  int T;
  scanf("%d", &T);
  for (int i = 1; i < MAXN; i++) {
    a[i] = a[i - 1] + i;
  }
  while (T--) {
    long long n, k;
    scanf("%lld%lld", &n, &k);
    long long pos = lower_bound(a + 1, a + 1 + n, k) - a;
    long long epos = k - a[pos - 1];
    for (long long cnt = n, i = 1; i <= n; i++, cnt--) {
      if (cnt == pos + 1 || cnt == epos) {
        printf("b");
        continue;
      }
      printf("a");
    }
    printf("\n");
  }
}
