There is a bus route as shown in Figure 1. There are 10 stops, each numbered 0-9. The bus turns back at stop 0, but the other side is a circulation route, which circulates in the order of 5 → 6 → 7 → 8 → 9 → 5 as shown in the figure.

<image>


For this bus route, create a program that inputs the stop to get on and the stop to get off, and outputs the number of the stop that goes from getting on to getting off.

However, you can take a two-way bus at stops 1-5, but we will take a bus that arrives at the stop on a shorter route. For example, if you are going from stop 4 to stop 2, take the bus going to the left and follow the route "4 → 3 → 2". Also, once you get on the bus, you will not get off the bus. The same stop is not designated as a boarding stop or a getting-off stop.



Input

Given multiple datasets. The first line gives the number of datasets n (n ≤ 20). For each dataset, the stop number to get on and the stop number to get off are given on one line separated by blanks.

Output

For each data set, output the list of passing stop numbers on one line separated by blanks.

Example

Input

2
2 4
4 2


Output

2 3 4
4 3 2
#include<iostream>
using namespace std;
int a[]={0,1,2,3,4,5,6,7,8,9,5,4,3,2,1};
int n;
int main()
{
	cin>>n;
	for(;n--;)
	{
		int s,t;cin>>s>>t;
		int cnt=0,i=0;
		while(a[i]!=s)i++;
		while(a[(i+cnt)%15]!=t)cnt++;
		int cnta=1e5,j=i+1;
		while(j<15&&a[j]!=s)j++;
		if(j<15)
		{
			cnta=0;
			while(a[(j+cnta)%15]!=t)cnta++;
		}
		if(cnt<cnta)
		{
			for(int k=0;k<=cnt;k++)cout<<a[(i+k)%15]<<(k==cnt?"\n":" ");
		}
		else
		{
			for(int k=0;k<=cnta;k++)cout<<a[(j+k)%15]<<(k==cnta?"\n":" ");
		}
	}
}

