#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
template <class T>
bool ckmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool ckmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <typename T, size_t N>
long long SIZE(const T (&t)[N]) {
  return N;
}
template <typename T>
long long SIZE(const T& t) {
  return t.size();
}
string to_string(const string s, long long x1 = 0, long long x2 = 1e9) {
  return '"' + ((x1 < s.size()) ? s.substr(x1, x2 - x1 + 1) : "") + '"';
}
string to_string(const char* s) { return to_string((string)s); }
string to_string(const bool b) { return (b ? "true" : "false"); }
string to_string(const char c) { return string({c}); }
template <size_t N>
string to_string(const bitset<N>& b, long long x1 = 0, long long x2 = 1e9) {
  string t = "";
  for (long long __iii__ = min(x1, SIZE(b)), __jjj__ = min(x2, SIZE(b) - 1);
       __iii__ <= __jjj__; ++__iii__) {
    t += b[__iii__] + '0';
  }
  return '"' + t + '"';
}
template <typename A, typename... C>
string to_string(const A(&v), long long x1 = 0, long long x2 = 1e9,
                 C... coords);
long long l_v_l_v_l = 0, t_a_b_s = 0;
template <typename A, typename B>
string to_string(const pair<A, B>& p) {
  l_v_l_v_l++;
  string res = "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
  l_v_l_v_l--;
  return res;
}
template <typename A, typename... C>
string to_string(const A(&v), long long x1, long long x2, C... coords) {
  long long rnk = rank<A>::value;
  string tab(t_a_b_s, ' ');
  string res = "";
  bool first = true;
  if (l_v_l_v_l == 0) res += '\n';
  res += tab + "[";
  x1 = min(x1, SIZE(v)), x2 = min(x2, SIZE(v));
  auto l = begin(v);
  advance(l, x1);
  auto r = l;
  advance(r, (x2 - x1) + (x2 < SIZE(v)));
  for (auto e = l; e != r; e = next(e)) {
    if (!first) {
      res += ", ";
    }
    first = false;
    l_v_l_v_l++;
    if (e != l) {
      if (rnk > 1) {
        res += '\n';
        t_a_b_s = l_v_l_v_l;
      };
    } else {
      t_a_b_s = 0;
    }
    res += to_string(*e, coords...);
    l_v_l_v_l--;
  }
  res += "]";
  if (l_v_l_v_l == 0) res += '\n';
  return res;
}
void dbgm() { ; }
template <typename Heads, typename... Tails>
void dbgm(Heads H, Tails... T) {
  cout << to_string(H) << " | ";
  dbgm(T...);
}
long long msb(long long x);
long long lsb(long long x);
vector<long long> tovec(string a);
string tostr(vector<long long> a);
const long long md = 1e9 + 7, MX = 500001;
long long get(long long n, long long a, long long b, long long colored) {
  if (colored > a) return -1;
  long long even = (n + 1) / 2;
  long long odd = n / 2;
  if (colored > even) return -1;
  if (even - colored > b) return -1;
  return even - colored + a - colored;
}
void solve() {
  long long a, b;
  cin >> a >> b;
  set<long long> s;
  for (long long i = 0; i <= a; i++) {
    long long x = get(a + b, a, b, i);
    if (x != -1) s.insert(x);
  }
  for (long long i = 0; i <= b; i++) {
    long long x = get(a + b, b, a, i);
    if (x != -1) s.insert(x);
  }
  cout << s.size() << '\n';
  for (long long x : s) cout << x << " ";
  return;
}
signed main() {
  cin.tie(0)->sync_with_stdio(0);
  cin.exceptions(cin.failbit);
  long long T = 1;
  cin >> T;
  while (T--) {
    solve();
    if (T) cout << '\n';
  }
  return 0;
}
long long msb(long long x) {
  for (long long i = 60; i > -1; i--)
    if ((1LL << i) & x) return i;
  return -1;
}
long long lsb(long long x) {
  for (long long i = 0; i < 61; i++)
    if ((1LL << i) & x) return i;
  return -1;
}
vector<long long> tovec(string a) {
  vector<long long> ans;
  for (char x : a) ans.push_back(((long long)(x) - 'a'));
  return ans;
}
string tostr(vector<long long> a) {
  string ans;
  for (long long x : a) ans += ((char)((x) + 'a'));
  return ans;
}

### Prompt

Please formulate a CPP solution to the following problem:

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. 

### Response

```cpp
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
template <class T>
bool ckmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool ckmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <typename T, size_t N>
long long SIZE(const T (&t)[N]) {
  return N;
}
template <typename T>
long long SIZE(const T& t) {
  return t.size();
}
string to_string(const string s, long long x1 = 0, long long x2 = 1e9) {
  return '"' + ((x1 < s.size()) ? s.substr(x1, x2 - x1 + 1) : "") + '"';
}
string to_string(const char* s) { return to_string((string)s); }
string to_string(const bool b) { return (b ? "true" : "false"); }
string to_string(const char c) { return string({c}); }
template <size_t N>
string to_string(const bitset<N>& b, long long x1 = 0, long long x2 = 1e9) {
  string t = "";
  for (long long __iii__ = min(x1, SIZE(b)), __jjj__ = min(x2, SIZE(b) - 1);
       __iii__ <= __jjj__; ++__iii__) {
    t += b[__iii__] + '0';
  }
  return '"' + t + '"';
}
template <typename A, typename... C>
string to_string(const A(&v), long long x1 = 0, long long x2 = 1e9,
                 C... coords);
long long l_v_l_v_l = 0, t_a_b_s = 0;
template <typename A, typename B>
string to_string(const pair<A, B>& p) {
  l_v_l_v_l++;
  string res = "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
  l_v_l_v_l--;
  return res;
}
template <typename A, typename... C>
string to_string(const A(&v), long long x1, long long x2, C... coords) {
  long long rnk = rank<A>::value;
  string tab(t_a_b_s, ' ');
  string res = "";
  bool first = true;
  if (l_v_l_v_l == 0) res += '\n';
  res += tab + "[";
  x1 = min(x1, SIZE(v)), x2 = min(x2, SIZE(v));
  auto l = begin(v);
  advance(l, x1);
  auto r = l;
  advance(r, (x2 - x1) + (x2 < SIZE(v)));
  for (auto e = l; e != r; e = next(e)) {
    if (!first) {
      res += ", ";
    }
    first = false;
    l_v_l_v_l++;
    if (e != l) {
      if (rnk > 1) {
        res += '\n';
        t_a_b_s = l_v_l_v_l;
      };
    } else {
      t_a_b_s = 0;
    }
    res += to_string(*e, coords...);
    l_v_l_v_l--;
  }
  res += "]";
  if (l_v_l_v_l == 0) res += '\n';
  return res;
}
void dbgm() { ; }
template <typename Heads, typename... Tails>
void dbgm(Heads H, Tails... T) {
  cout << to_string(H) << " | ";
  dbgm(T...);
}
long long msb(long long x);
long long lsb(long long x);
vector<long long> tovec(string a);
string tostr(vector<long long> a);
const long long md = 1e9 + 7, MX = 500001;
long long get(long long n, long long a, long long b, long long colored) {
  if (colored > a) return -1;
  long long even = (n + 1) / 2;
  long long odd = n / 2;
  if (colored > even) return -1;
  if (even - colored > b) return -1;
  return even - colored + a - colored;
}
void solve() {
  long long a, b;
  cin >> a >> b;
  set<long long> s;
  for (long long i = 0; i <= a; i++) {
    long long x = get(a + b, a, b, i);
    if (x != -1) s.insert(x);
  }
  for (long long i = 0; i <= b; i++) {
    long long x = get(a + b, b, a, i);
    if (x != -1) s.insert(x);
  }
  cout << s.size() << '\n';
  for (long long x : s) cout << x << " ";
  return;
}
signed main() {
  cin.tie(0)->sync_with_stdio(0);
  cin.exceptions(cin.failbit);
  long long T = 1;
  cin >> T;
  while (T--) {
    solve();
    if (T) cout << '\n';
  }
  return 0;
}
long long msb(long long x) {
  for (long long i = 60; i > -1; i--)
    if ((1LL << i) & x) return i;
  return -1;
}
long long lsb(long long x) {
  for (long long i = 0; i < 61; i++)
    if ((1LL << i) & x) return i;
  return -1;
}
vector<long long> tovec(string a) {
  vector<long long> ans;
  for (char x : a) ans.push_back(((long long)(x) - 'a'));
  return ans;
}
string tostr(vector<long long> a) {
  string ans;
  for (long long x : a) ans += ((char)((x) + 'a'));
  return ans;
}

```