将每个数字,翻转一下,sort
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int maxn=100+5;
struct node
{
int x,y;
};
std::vector<node> v;
int solve(int x)
{
int ans=0;
while(x)
{
ans=ans*10+x%10;
x/=10;
}
return ans;
}
int main()
{
int t;scanf("%d",&t);
while(t--)
{
v.clear();
int a,b;scanf("%d%d",&a,&b);
for(int i=a;i<=b;i++) v.emplace_back((node){i,solve(i)});
sort(v.begin(),v.end(),[](const node &a,const node &b){return a.y<b.y;});
for(auto &i:v)cout<<i.x<<" ";cout<<endl;
}
return 0;
}