Alice and Borys are playing tennis.

A tennis match consists of games. In each game, one of the players is serving and the other one is receiving.

Players serve in turns: after a game where Alice is serving follows a game where Borys is serving, and vice versa.

Each game ends with a victory of one of the players. If a game is won by the serving player, it's said that this player holds serve. If a game is won by the receiving player, it's said that this player breaks serve.

It is known that Alice won a games and Borys won b games during the match. It is unknown who served first and who won which games.

Find all values of k such that exactly k breaks could happen during the match between Alice and Borys in total.

Input

Each test contains multiple test cases. The first line contains the number of test cases t (1 ≤ t ≤ 10^3). Description of the test cases follows.

Each of the next t lines describes one test case and contains two integers a and b (0 ≤ a, b ≤ 10^5; a + b > 0) — the number of games won by Alice and Borys, respectively.

It is guaranteed that the sum of a + b over all test cases does not exceed 2 ⋅ 10^5.

Output

For each test case print two lines.

In the first line, print a single integer m (1 ≤ m ≤ a + b + 1) — the number of values of k such that exactly k breaks could happen during the match.

In the second line, print m distinct integers k_1, k_2, …, k_m (0 ≤ k_1 < k_2 < … < k_m ≤ a + b) — the sought values of k in increasing order.

Example

Input


3
2 1
1 1
0 5


Output


4
0 1 2 3
2
0 2
2
2 3

Note

In the first test case, any number of breaks between 0 and 3 could happen during the match: 

  * Alice holds serve, Borys holds serve, Alice holds serve: 0 breaks; 
  * Borys holds serve, Alice holds serve, Alice breaks serve: 1 break; 
  * Borys breaks serve, Alice breaks serve, Alice holds serve: 2 breaks; 
  * Alice breaks serve, Borys breaks serve, Alice breaks serve: 3 breaks. 



In the second test case, the players could either both hold serves (0 breaks) or both break serves (2 breaks).

In the third test case, either 2 or 3 breaks could happen: 

  * Borys holds serve, Borys breaks serve, Borys holds serve, Borys breaks serve, Borys holds serve: 2 breaks; 
  * Borys breaks serve, Borys holds serve, Borys breaks serve, Borys holds serve, Borys breaks serve: 3 breaks. 
#include<bits/stdc++.h>
//#include <boost/math/common_factor.hpp>
using namespace std;
 
 
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// typedef tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> ordered_set;
// #define os_find(k) find_by_order(k)
// #define os_order(k) order_of_key(k)
 
 
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef vector<int> vi;
#define loop(i,a,b) for(int i=a;i<b;i++)
#define loop1(i,a,b) for(int i=a;i<=b;i++)
#define rloop(i,a,b) for(int i=a;i>b;i--)
#define rloop1(i,a,b) for(int i=a;i>=b;i--)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define pb push_back
//#define mp make_pair
#define pii pair<ll,ll>
#define int   long long int
 #define double long double
#define min_heap priority_queue <int, vector<int>, greater<int> > 
#define ff first
#define ss second
#define ncr(n,r) fact[n]*modInv(fact[r])*modInv(fact[n-r]) 
#define MOD 1000000007
//#define MOD 998244353
#define inf 1e18
//#define modInv(a) binExp(a,mod-2)
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define test int t;cin>>t;while(t--)
#define nl "\n"
#define ceill(a,b) ((a)/(b))+(((a)%(b))!=0)
//-------------------------IMPORTANT FUNCTIONS START---------------------
ll add(ll a, ll b) {ll z=a+b; if(z>=MOD) z -= MOD; return z;}
ll mul(ll a, ll b) { return (a*b)%MOD;}
ll sub(ll a, ll b) { return (a-b+MOD)%MOD;}
ll powr(ll x,  ll y) 
{ 
    int res = 1; 
  
    while (y > 0) {  
        if (y & 1) 
            res = res * x;  
        y = y >> 1; 
        x = x * x; 
    } 
    return res; 
} 
 
 
ll power(ll x, ll y, ll p) 
{ 
    ll res = 1; 
    x = x % p; 
  
    while (y > 0) { 
        if (y & 1) res = (res * x) % p; 
        y = y >> 1;
        x = (x * x) % p; 
    } 
    return res; 
} 
ll mod_inv(ll n, ll mod){
    return power(n, mod-2LL, mod);
}
 
bool isPrime(int n) 
{ 
    // Corner case 
    if (n <= 1) 
        return false; 
  
    // Check from 2 to n-1 
    for (int i = 2; i <=sqrt(n); i++) 
        if (n % i == 0) 
            return false; 
  
 
    return true; 
} 
 
int lcm(int a, int b)
{
    return (a / __gcd(a, b)) * b;
}
//-------------------------IMPORTANT FUNCTIONS END---------------------
 // initialize 2d vector   vector<vector<int>> dp(n+1,vector<int>(x+1,0));
// 1/n+2/n+3/n.....n/n=O(logn)
// never use sqrt*sqrt cf compiler chodu hai
// negative value m floor or ceil ulte kam karte equation solve karte waqt dhyan rakh4
// order of 1e8 in 1 sec is ok
 //POWER FUNCTION FOR LARGE NO.

//--------------------DONT FORGET TO CALL SIEVE() IN MAIN FUNCTION-----------------------------------
int check(int av1,int av0,int k,int w){
	int tot=av1+av0;
	int minn;
	if(av1>w){
		minn=av1-w;
		av1-=minn;
	}
	else{
		minn=w-av1;
		w-=minn;
	}
	if(k<minn){
		return 0;
	}
	k-=minn;
	if(k%2){
		return 0;
	}
	if(k>(min(av1,av0)*2)){
		return 0;
	}
	return 1;

}
void solve(){
  int a,b;
  cin>>a>>b;
  int n=a+b;
	set<int> s;
	loop(i,0,a+b+1){
		if(check(n/2,n-(n/2),i,a)){
			s.insert(i);
		}
		if(check(n-(n/2),n/2,i,a)){
			s.insert(i);
		}

	}
	cout<<s.size()<<nl;
	for(auto x:s)cout<<x<<" ";
	cout<<nl;
}
 
signed  main()
{
 fast
//  sieve();
// facto();
test
 
    solve();
 
}