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. 
//#pragma GCC optimize("O3,unroll-loops")
//#pragma GCC target("avx,avx2,fma")
#include <algorithm>
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>

using namespace std;

#define PI              acos(-1.0)
#define No              cout<<"No\n"
#define Yes             cout<<"Yes\n"
#define no              cout<<"no\n"
#define yes             cout<<"yes\n"
#define NO              cout<<"NO\n"
#define YES             cout<<"YES\n"
#define MOD             (int)1000000007
//#define int             long long
#define ll              long long
#define dl              double
#define pii             pair<int, int>
#define sf(a)           scanf("%d", &a)
#define sf2(a, b)       scanf("%d %d", &a, &b);
#define sf3(a, b, c)    scanf("%d %d %d", &a, &b, &c);
#define pf(a)           printf("%d ", a)
#define pfn(a)          printf("%d\n", a)
#define case(a)         cout<<"Case "<<a<<": ";
#define casehash(a)     cout<<"Case #"<<a<<": ";
#define FASTIO          ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define pb              push_back
#define mem(arr)        memset(arr, 0, sizeof(arr))
#define mem1(arr)       memset(arr, -1, sizeof(arr))
#define all(a)          a.begin(),a.end()
#define f(i,a,b)        for (int i = a; i<=b; i++)
#define fr(i,a,b)       for (int i = a; i>=b; i--)
#define rr              return 0
#define prec(n)         fixed<<setprecision(n)
#define maxpq           priority_queue<int>
#define minpq           priority_queue<int, vector<int>, greater<int> >
#define inf             (int)(1e9)
#define infll           (int)(1e18)
#define vi              vector<int>
#define vii             vector<pii>
#define sz(s)           int(s.size())
ll gcd(int a, int b)   {return __gcd(a,b);}

inline void normal(ll &a) { a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p & 1LL) r = modMul(r, b); b = modMul(b, b); p >>= 1LL; } return r; }
inline ll modInverse(ll a) { return modPow(a, MOD-2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

inline ll checkBit(ll n, int i) { return n&(1ll<<i); }
inline void setBit(ll &n, int i) { n |= (1ll<<i); }
inline void resetBit(ll &n, int i) { n &= ~(1ll<<i); }


const double eps = 1e-9;

int dx[5] = {+1, +0, -1, -0};
int dy[5] = {+0, +1, -0, -1};
int XX[] = { -1, -1, -1, 0, 0, 1, 1, 1 };
int YY[] = { -1, 0, 1, -1, 1, -1, 0, 1 };

inline bool Equal(double x, double y) { return fabs(x-y)<eps; }
inline bool Greater(double x, double y){ return x-eps>y; }
inline bool Lesser(double x, double y){ return x+eps<y; }

#define debug(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); cerr << '\n'; }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args> void err(istream_iterator<string> it, T a, Args... args) { cerr << *it << " = " << a << " "; err(++it, args...); }



signed main()
{
//    root = new trinode();
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
    
    FASTIO
    
    int T;
    cin>>T;

    f(tc, 1, T){
        int a, b;
        cin>>a>>b;

        int n = a+b;
        int aBreak = 0, bBreak = 0;

        int ara[n+1];
        f(i, 1, a){
            ara[i] = 1;
        }
        f(i, a+1, n){
            ara[i] = 0;
        }

        f(i, 1, n){
            if(i%2 && ara[i]==0) aBreak++;
            if(i%2==0 && ara[i]==1) bBreak++;

            // cout<<ara[i]<<" ";
        }
        // cout<<endl;

        int ans[n+1], k = aBreak+bBreak;
        mem(ans);

        int mn = min(aBreak, bBreak);

        // debug(aBreak, bBreak, k);

        while(mn>=0){
            // debug(n, k);
            ans[k] = ans[n-k] = 1;
            k -= 2;
            mn--;
        }

        vi v;
        for(int i=0; i<=n; i++){
            if(ans[i] == 1) v.pb(i);
        }

        cout<<v.size()<<endl;
        for(int x:v) cout<<x<<" ";
        cout<<endl;
        
        
        
        
        
        
    }


//    tridel(root);
}





