#include <iostream>
#include <string>
using namespace std;

typedef long long LL;


int Array[51];

void generateA()
{
	Array[0] = 1;
	Array[1] = 1;
	for (int i = 2; i <= 51; i++)
	{
		Array[i] = Array[i - 2] + Array[i - 1];
	}
}

void find_book(int N, int book)
{

	if (N == 0)
	{
		cout << "a" << endl;
		return;
	}
	if (N == 1)
	{
		cout << "b" << endl;
		return;
	}

	if (book > Array[N - 2])
		find_book(N - 1, book - Array[N - 2]);
	else
		find_book(N - 2, book);
}

int main()
{
	int x, y, z;
	cin >> x;
	generateA()
	for (int i = 0; i < x; i++)
	{
		cin >> y >> z;
		find_book(y, z);
	}
}