#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--){
int n,x,i;
cin>>n>>x;
if(n==1&&x==1){
cout<<"a"<<endl;
}else if(n%2==0){
if(x!=n/2){
cout<<"-1"<<endl;
}else{
for(i=1;i<=n/2;i++){
cout<<((char)(i+96));
}
for(i=(n/2);i>=1;i--){
cout<<((char)(i+96));
}
cout<<endl;
}
}else if(n%2==1){
if(x!=n/2+1){
cout<<"-1"<<endl;
}
else{
for(i=1;i<=n/2;i++){
cout<<((char)(i+96));
}
for(i=(n/2)+1;i>=1;i--){
cout<<((char)(i+96));
}
cout<<endl;
}
}
}
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: