include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t–)
{
int a,b;
cin>>a>>b;
if((a%2&&b%2))
{
cout<<“-1”<<endl;
continue;
}
else if(a==1||b==1)
{
cout<<“-1”<<endl;
continue;
}
else if(a%2==0&&b%2==0)
{
int x=min(a,b);
int rem=abs(a-b);
string a=“”,b=“”;
while(x)
{
a+=‘a’;
b=‘a’+b;
a+=‘b’;
b=‘b’+b;
x-=2;
}
while(a>b&&rem>0)
{
a+=‘a’;
rem–;
}
while(b>a&&rem>0)
{
b=‘b’+b;
rem–;
}
string t1=a+b;
string t2=t1;
int i=1;
while(i<t2.size())
{
swap(t2[i],t2[i-1]);
i+=2;
}
cout<<t2<<endl;
cout<<t1<<endl;
}
else
{
if(a%2)
{
a–;
int x=min(a,b);
int rem=abs(a-b);
string a=“”,b=“”;
while(x)
{
a+=‘a’;
b=‘a’+b;
a+=‘b’;
b=‘b’+b;
x-=2;
}
while(a>b&&rem>0)
{
a+=‘a’;
b=‘a’+b;
rem-=2;
}
while(b>a&&rem>0)
{
b=‘b’+b;
a+=‘b’;
rem-=2;
}
string t1=a+‘a’+b;
string t2=t1;
reverse(t2.begin(),t2.begin()+t2.size()/2);
reverse(t2.begin()+t2.size()/2+1,t2.end());
cout<<t2<<endl;
cout<<t1<<endl;
}
else
{
b–;
int x=min(a,b);
int rem=abs(a-b);
string a=“”,b=“”;
while(x)
{
a+=‘a’;
b=‘a’+b;
a+=‘b’;
b=‘b’+b;
x-=2;
}
while(a>b&&rem>0)
{
a+=‘a’;
b=‘a’+b;
rem-=2;
}
while(b>a&&rem>0)
{
b=‘b’+b;
a+=‘b’;
rem-=2;
}
string t1=a+'b'+b;
string t2=t1;
reverse(t2.begin(),t2.begin()+t2.size()/2);
reverse(t2.begin()+t2.size()/2+1,t2.end());
cout<<t2<<endl;
cout<<t1<<endl;
}
}
}
return 0;
}