This is an interactive problem.There is a positive integer $$$1 \le x \le 10^9$$$ that you have to guess.In one query you can choose two positive integers $$$a \neq b$$$. As an answer to this query you will get $$$\gcd(x + a, x + b)$$$, where $$$\gcd(n, m)$$$ is the greatest common divisor of the numbers $$$n$$$ and $$$m$$$.To guess one hidden number $$$x$$$ you are allowed to make no more than $$$30$$$ queries.

The first line of input contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$) denoting the number of test cases. The integer $$$x$$$ that you have to guess satisfies the constraints: ($$$1 \le x \le 10^9$$$).

NoteThe first hidden number is $$$4$$$, that's why the answers for the queries are:"? 1 2" — $$$\gcd(4 + 1, 4 + 2) = \gcd(5, 6) = 1$$$."? 12 4" — $$$\gcd(4 + 12, 4 + 4) = \gcd(16, 8) = 8$$$.The second hidden number is $$$10^9$$$, that's why the answer for the query is:"? 2000000000 1999999999" — $$$\gcd(3 \cdot 10^9, 3 \cdot 10^9 - 1) = 1$$$.These queries are made only for understanding the interaction and are not enough for finding the true $$$x$$$.

'use strict';

var readline = require('readline');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);

function main(answers, primes) {
  let res = crt(primes, answers);
  console.log(`! ${res}`);
  return res;
}
function exgcd(a, b) {
  if (b === 0) return [a, 1, 0];
  const [d, y, x] = exgcd(b, a % b);
  return [d, x, y - Math.floor(a / b) * x];
}
function crt(p, a) {
  const n = p.reduce((a, b) => a * b, 1);
  let res = 0;
  for (let i = 0; i < p.length; i++) {
    if (!a[i]) continue;
    let m1 = n / p[i],
        [, m2] = exgcd(m1, p[i]);
    m2 = (m2 % p[i] + p[i]) % p[i];
    res += a[i] * m1 * m2;
  }
  return (res % n + n) % n;
}

const rl = readline__default["default"].createInterface({
  input: process.stdin,
  output: process.stdout
});
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4];
let inputs = new Array(primes.length).fill(0);
const lcm = primes.reduce((a, b) => a * b, 1);
function question(message) {
  return new Promise(function (resolve, reject) {
    rl.question(message, answer => {
      resolve(Number(answer));
    });
  });
}
function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)));
  });
}
void async function () {
  let t = await read();
  while (t--) {
    inputs = [];
    for (let i = 1; i <= 23; i++) {
      const message = `? ${i} ${i + lcm}\n`;
      const res = await question(message);
      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          inputs[j] = (-i % primes[j] + primes[j]) % primes[j];
        }
      }
    }
    main(inputs, primes);
  }
}();

'use strict'

var readline = require('readline')

function _interopDefaultLegacy(e) {
  return e && typeof e === 'object' && 'default' in e ? e : { default: e }
}

var readline__default = /*#__PURE__*/ _interopDefaultLegacy(readline)

function main(answers, primes) {
  let res = crt(primes, answers)
  console.log(`! ${res}`)
  return res
}
function exgcd(a, b) {
  if (b === 0) return [a, 1, 0]
  const [d, y, x] = exgcd(b, a % b)
  return [d, x, y - Math.floor(a / b) * x]
}
function crt(p, a) {
  const n = p.reduce((a, b) => a * b, 1)
  let res = 0
  for (let i = 0; i < p.length; i++) {
    if (!a[i]) continue
    let m1 = n / p[i],
      [, m2] = exgcd(m1, p[i])
    m2 = ((m2 % p[i]) + p[i]) % p[i]
    res += a[i] * m1 * m2
  }
  return ((res % n) + n) % n
}

const rl = readline__default['default'].createInterface({
  input: process.stdin,
  output: process.stdout,
})
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4]
let inputs = new Array(primes.length).fill(0)
const lcm = primes.reduce((a, b) => a * b, 1)
function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)))
  })
}

void (async function () {
  let t = await read()
  let pre = new Date().valueOf(),
    readtime = 0,
    primetime = 0,
    maintime = 0
  while (t--) {
    inputs = []
    for (let i = 1; i <= 23; i++) {
      let now = new Date().valueOf()
      console.log(`? ${i} ${i + lcm}`)

      const res = await read()

      readtime += new Date().valueOf() - now
      now = new Date().valueOf()

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          inputs[j] = ((-i % primes[j]) + primes[j]) % primes[j]
        }
      }

      primetime += new Date().valueOf() - now
    }
    let now = new Date().valueOf()
    main(inputs, primes)
    maintime += new Date().valueOf() - now
    if (new Date().valueOf() - pre > 2000) {
      console.log(`? ${readtime},${readtime},${maintime}`)
    }
  }
})()

'use strict'

var readline = require('readline')

function _interopDefaultLegacy(e) {
  return e && typeof e === 'object' && 'default' in e ? e : { default: e }
}

var readline__default = /*#__PURE__*/ _interopDefaultLegacy(readline)

function main(answers, primes) {
  let res = crt(primes, answers)
  console.log(`! ${res}`)
  return res
}
function exgcd(a, b) {
  if (b === 0) return [a, 1, 0]
  const [d, y, x] = exgcd(b, a % b)
  return [d, x, y - Math.floor(a / b) * x]
}
function crt(p, a) {
  const n = p.reduce((a, b) => a * b, 1)
  let res = 0
  for (let i = 0; i < p.length; i++) {
    if (!a[i]) continue
    let m1 = n / p[i],
      [, m2] = exgcd(m1, p[i])
    m2 = ((m2 % p[i]) + p[i]) % p[i]
    res += a[i] * m1 * m2
  }
  return ((res % n) + n) % n
}

const rl = readline__default['default'].createInterface({
  input: process.stdin,
  output: process.stdout,
})
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4]
let inputs = new Array(primes.length).fill(0)
const lcm = primes.reduce((a, b) => a * b, 1)
function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)))
  })
}

void (async function () {
  let t = await read()
  let pre = new Date().valueOf(),
    readtime = 0,
    primetime = 0,
    maintime = 0
  while (t--) {
    inputs = []
    for (let i = 1; i <= 23; i++) {
      let now = new Date().valueOf()
      console.log(`? ${i} ${i + lcm}`)

      const res = await read()

      readtime += new Date().valueOf() - now
      now = new Date().valueOf()

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          inputs[j] = ((-i % primes[j]) + primes[j]) % primes[j]
        }
      }

      primetime += new Date().valueOf() - now
    }
    let now = new Date().valueOf()
    main(inputs, primes)
    maintime += new Date().valueOf() - now
    if (new Date().valueOf() - pre > 2000) {
      console.log(`readtime: ${readtime},primetime: ${readtime},maintime: ${maintime}`)
    }
  }
})()

'use strict';

var readline = require('readline');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);

// import { solve } from './solve'
function main(answers, primes) {
  let res = crt(primes, answers);
  //if(res===76636274)console.log(answers.join(',')+'|'+primes.join(','))
  console.log(`! ${res}`); // console.log(answers, primes)

  return res;
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0];
  const [d, y, x] = exgcd(b, a % b);
  return [d, x, y - Math.floor(a / b) * x];
}

function crt(p, a) {
  // console.log(p, a)
  const n = p.reduce((a, b) => a * b, 1); // console.log('n', n)

  let res = 0;

  for (let i = 0; i < p.length; i++) {
    // if (!a[i]) continue
    let m1 = n / p[i],
        [, m2] = exgcd(m1, p[i]);
    m2 = (m2 % p[i] + p[i]) % p[i];
    res += a[i] * m1 * m2;
  }

  return (res % n + n) % n;
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

const rl = readline__default["default"].createInterface({
  input: process.stdin,
  output: process.stdout
});
let inputs = [];
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4];
const lcm = primes.reduce((a, b) => a * b, 1);

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)));
  });
}

void async function () {
  let t = await read();

  while (t--) {
    inputs = [];

    for (let i = 0; i <= 29; i++) {
      console.log(`? ${i} ${i + lcm}`);
      const res = await read();

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          inputs[j] = (-i % primes[j] + primes[j]) % primes[j];
        }
      }
    }

    main(inputs.filter(num => num !== undefined), primes.filter((_, i) => inputs[i] !== undefined));
  }
}();

'use strict';

var readline = require('readline');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);

// import { solve } from './solve'
function main(answers, primes) {
  let res = crt(primes, answers);
  //if(res===76636274)console.log(answers.join(',')+'|'+primes.join(','))
  console.log(`! ${res}`); // console.log(answers, primes)

  return res;
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0];
  const [d, y, x] = exgcd(b, a % b);
  return [d, x, y - Math.floor(a / b) * x];
}

function crt(p, a) {
  // console.log(p, a)
  const n = p.reduce((a, b) => a * b, 1); // console.log('n', n)

  let res = 0;

  for (let i = 0; i < p.length; i++) {
    // if (!a[i]) continue
    let m1 = n / p[i],
        [, m2] = exgcd(m1, p[i]);
    m2 = (m2 % p[i] + p[i]) % p[i];
    res += a[i] * m1 * m2;
  }

  return (res % n + n) % n;
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

const rl = readline__default["default"].createInterface({
  input: process.stdin,
  output: process.stdout
});
let inputs = [];
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4];
const lcm = primes.reduce((a, b) => a * b, 1);

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)));
  });
}

void async function () {
  let t = await read();

  while (t--) {
    inputs = [];

    for (let i = 0; i <= 29; i++) {
      console.log(`? ${i} ${i + lcm}`);
      const res = await read();

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          inputs[j] = (-i % primes[j] + primes[j]) % primes[j];
          break;
        }
      }
    }

    main(inputs.filter(num => num !== undefined), primes.filter((_, i) => inputs[i] !== undefined));
  }
}();

'use strict';

var readline = require('readline');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);

// import { solve } from './solve'
function main(answers, primes) {
  let res = crt(primes, answers);
  if(res===76636274)console.log(answers.join(',')+'|'+primes.join(','))
  console.log(`! ${res}`); // console.log(answers, primes)

  return res;
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0];
  const [d, y, x] = exgcd(b, a % b);
  return [d, x, y - Math.floor(a / b) * x];
}

function crt(p, a) {
  // console.log(p, a)
  const n = p.reduce((a, b) => a * b, 1); // console.log('n', n)

  let res = 0;

  for (let i = 0; i < p.length; i++) {
    // if (!a[i]) continue
    let m1 = n / p[i],
        [, m2] = exgcd(m1, p[i]);
    m2 = (m2 % p[i] + p[i]) % p[i];
    res += a[i] * m1 * m2;
  }

  return (res % n + n) % n;
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

const rl = readline__default["default"].createInterface({
  input: process.stdin,
  output: process.stdout
});
let inputs = [];
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4];
const lcm = primes.reduce((a, b) => a * b, 1);

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)));
  });
}

void async function () {
  let t = await read();

  while (t--) {
    inputs = [];

    for (let i = 1; i <= 29; i++) {
      console.log(`? ${i} ${i + lcm}`);
      const res = await read();

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          inputs[j] = (-i % primes[j] + primes[j]) % primes[j];
          break;
        }
      }
    }

    main(inputs.filter(num => num !== undefined), primes.filter((_, i) => inputs[i] !== undefined));
  }
}();

'use strict';

var readline = require('readline');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);

// import { solve } from './solve'
function main(answers, primes) {
  let res = crt(primes, answers);
  console.log(`! ${res}`); // console.log(answers, primes)

  return res;
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0];
  const [d, y, x] = exgcd(b, a % b);
  return [d, x, y - Math.floor(a / b) * x];
}

function crt(p, a) {
  // console.log(p, a)
  const n = p.reduce((a, b) => a * b, 1); // console.log('n', n)

  let res = 0;

  for (let i = 0; i < p.length; i++) {
    // if (!a[i]) continue
    let m1 = n / p[i],
        [, m2] = exgcd(m1, p[i]);
    m2 = (m2 % p[i] + p[i]) % p[i];
    res += a[i] * m1 * m2;
  }

  return (res % n + n) % n;
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

const rl = readline__default["default"].createInterface({
  input: process.stdin,
  output: process.stdout
});
let inputs = [];
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4];
const lcm = primes.reduce((a, b) => a * b, 1);

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)));
  });
}

void async function () {
  let t = await read();

  while (t--) {
    inputs = [];

    for (let i = 1; i <= 29; i++) {
      console.log(`? ${i} ${i + lcm}`);
      const res = await read();

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          inputs[j] = (-i % primes[j] + primes[j]) % primes[j];
          break;
        }
      }
    }

    main(inputs.filter(num => num !== undefined), primes.filter((_, i) => inputs[i] !== undefined));
  }
}();

'use strict';

var readline = require('readline');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);

// import { solve } from './solve'
function main(answers, primes) {
  let res = crt(primes, answers);
  console.log(`! ${res}`); // console.log(answers, primes)

  return res;
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0];
  const [d, y, x] = exgcd(b, a % b);
  return [d, x, y - Math.floor(a / b) * x];
}

function crt(p, a) {
  // console.log(p, a)
  const n = p.reduce((a, b) => a * b, 1); // console.log('n', n)

  let res = 0;

  for (let i = 0; i < p.length; i++) {
    // if (!a[i]) continue
    let m1 = n / p[i],
        [, m2] = exgcd(m1, p[i]);
    m2 = (m2 % p[i] + p[i]) % p[i];
    res += a[i] * m1 * m2;
  }

  return (res % n + n) % n;
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

const rl = readline__default["default"].createInterface({
  input: process.stdin,
  output: process.stdout
});
let inputs = [];
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4];
const lcm = primes.reduce((a, b) => a * b, 1);

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)));
  });
}

void async function () {
  let t = await read();

  while (t--) {
    inputs = [];

    for (let i = 1; i <= 29; i++) {
      console.log(`? ${i} ${i + lcm}`);
      const res = await read();

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          inputs[j] = -i;
          break;
        }
      }
    }

    main(inputs.filter(num => num !== undefined), primes.filter((_, i) => inputs[i] !== undefined));
  }
}();

'use strict';

var readline = require('readline');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);

// import { solve } from './solve'
function main(answers, primes) {
  let res = crt(primes, answers);
  console.log(`! ${res}`); // console.log(answers, primes)

  return res;
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0];
  const [d, y, x] = exgcd(b, a % b);
  return [d, x, y - Math.floor(a / b) * x];
}

function crt(p, a) {
  // console.log(p, a)
  const n = p.reduce((a, b) => a * b, 1);
  console.log('n', n);
  let res = 0;

  for (let i = 0; i < p.length; i++) {
    if (!a[i]) continue;
    let m1 = n / p[i],
        [, m2] = exgcd(m1, p[i]);
    m2 = (m2 % p[i] + p[i]) % p[i];
    res += a[i] * m1 * m2;
  }

  return (res % n + n) % n;
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

const rl = readline__default["default"].createInterface({
  input: process.stdin,
  output: process.stdout
});
let inputs = [];
const primes = [ 23, 19, 17, 13, 11, 9, 7, 5, 4];
const lcm = primes.reduce((a, b) => a * b, 1);

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)));
  });
}

void async function () {
  let t = await read();

  while (t--) {
    inputs = [];

    for (let i = 1; i <= 29; i++) {
      console.log(`? ${i} ${i + lcm}`);
      const res = await read();

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          inputs[j] = -i;
          break;
        }
      }
    }

    main(inputs.filter(Boolean), primes.filter((_, i) => Boolean(inputs[i])));
  }
}();

'use strict';

var readline = require('readline');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);

// import { solve } from './solve'
function main(answers, primes) {
  let res = crt(primes, answers);
  console.log(`! ${res}`); // console.log(answers, primes)

  return res;
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0];
  const [d, y, x] = exgcd(b, a % b);
  return [d, x, y - Math.floor(a / b) * x];
}

function crt(p, a) {
  // console.log(p, a)
  const n = p.reduce((a, b) => a * b, 1);
  console.log('n', n);
  let res = 0;

  for (let i = 0; i < p.length; i++) {
    if (!a[i]) continue;
    let m1 = n / p[i],
        [, m2] = exgcd(m1, p[i]);
    m2 = (m2 % p[i] + p[i]) % p[i];
    res += a[i] * m1 * m2;
  }

  return (res % n + n) % n;
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

const rl = readline__default["default"].createInterface({
  input: process.stdin,
  output: process.stdout
});
let inputs = [];
const primes = [29, 23, 19, 17, 13, 11, 9, 7, 5, 4];
const lcm = primes.reduce((a, b) => a * b, 1);

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)));
  });
}

void async function () {
  let t = await read();

  while (t--) {
    inputs = [];

    for (let i = 1; i <= 29; i++) {
      console.log(`? ${i} ${i + lcm}`);
      const res = await read();

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          inputs[j] = -i;
          break;
        }
      }
    }

    main(inputs.filter(Boolean), primes.filter((_, i) => Boolean(inputs[i])));
  }
}();

'use strict';

var readline = require('readline');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);

// import { solve } from './solve'
function main(answers, primes) {
  console.log(`! ${crt(primes, answers)}`); // console.log(answers, primes)
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0];
  const [d, y, x] = exgcd(b, a % b);
  return [d, x, y - Math.floor(a / b) * x];
}

function crt(p, a) {
  // console.log(p, a)
  const n = p.reduce((a, b) => a * b, 1);
  let res = 0;

  for (let i = 0; i < p.length; i++) {
    if (!a[i]) continue;
    let m1 = n / p[i],
        [, m2] = exgcd(m1, p[i]);
    m2 = (m2 % p[i] + p[i]) % p[i];
    res += a[i] * m1 * m2;
  }

  return (res % n + n) % n;
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

const rl = readline__default["default"].createInterface({
  input: process.stdin,
  output: process.stdout
});
let inputs = [];
const primes = [29, 23, 19, 17, 13, 11, 7, 5];
const lcm = primes.reduce((a, b) => a * b, 1);

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)));
  });
}

void async function () {
  let t = await read();

  while (t--) {
    inputs = [];

    for (let i = 1; i <= 29; i++) {
      console.log(`? ${i} ${i + lcm}`);
      const res = await read();

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          inputs[j] = -i;
          break;
        }
      }
    }

    main(inputs.filter(Boolean), primes.filter((_, i) => Boolean(inputs[i])));
  }
}();

'use strict';

var readline = require('readline');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);

// import { solve } from './solve'
function main(answers, primes) {
  console.log(`! ${crt(primes, answers)}`); // console.log(answers, primes)
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0];
  const [d, y, x] = exgcd(b, a % b);
  return [d, x, y - Math.floor(a / b) * x];
}

function crt(p, a) {
  // console.log(p, a)
  const n = p.reduce((a, b) => a * b, 1);
  let res = 0;

  for (let i = 0; i < p.length; i++) {
    if (!a[i]) continue;
    let m1 = n / p[i],
        [, m2] = exgcd(m1, p[i]);
    m2 = (m2 % p[i] + p[i]) % p[i];
    res += a[i] * m1 * m2;
  }

  return (res % n + n) % n;
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

const rl = readline__default["default"].createInterface({
  input: process.stdin,
  output: process.stdout
});
let inputs = [];
const primes = [29, 23, 19, 17, 13, 11, 7, 5, 3];
const lcm = primes.reduce((a, b) => a * b, 1);

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)));
  });
}

void async function () {
  let t = await read();

  while (t--) {
    inputs = [];

    for (let i = 1; i <= 29; i++) {
      console.log(`? ${i} ${i + lcm}`);
      const res = await read();

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          inputs[j] = -i;
          break;
        }
      }
    }

    main(inputs.filter(Boolean), primes.filter((_, i) => Boolean(inputs[i])));
  }
}();

'use strict';

var readline = require('readline');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);

// import { solve } from './solve'
function main(answers, primes) {
  console.log(`! ${crt(primes, answers)}`); // console.log(answers, primes)
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0];
  const [d, y, x] = exgcd(b, a % b);
  return [d, x, y - Math.floor(a / b) * x];
}

function crt(p, a) {
  // console.log(p, a)
  const n = p.reduce((a, b) => a * b, 1);
  let res = 0;

  for (let i = 0; i < p.length; i++) {
    if (!a[i]) continue;
    let m1 = n / p[i],
        [, m2] = exgcd(m1, p[i]);
    m2 = (m2 % p[i] + p[i]) % p[i];
    res += a[i] * m1 * m2;
  }

  return (res % n + n) % n;
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

const rl = readline__default["default"].createInterface({
  input: process.stdin,
  output: process.stdout
});
let inputs = [];
const primes = [29, 23, 19, 17, 13, 11, 7, 5, 3, 2];
const lcm = primes.reduce((a, b) => a * b, 1);

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)));
  });
}

void async function () {
  let t = await read();

  while (t--) {
    inputs = [];

    for (let i = 1; i <= 29; i++) {
      console.log(`? ${i} ${i + lcm}`);
      const res = await read();

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          inputs[j] = -i;
          break;
        }
      }
    }

    main(inputs.filter(Boolean), primes.filter((_, i) => Boolean(inputs[i])));
  }
}();

'use strict';

var readline = require('readline');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);

// import { solve } from './solve'
function main(answers, primes, lcm) {
  console.log(`! ${crt(primes, answers)}`); // console.log(answers, primes)
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0];
  const [d, y, x] = exgcd(b, a % b);
  return [d, x, y - Math.floor(a / b) * x];
}

function crt(p, a) {
  // console.log(p, a)
  const n = p.reduce((a, b) => a * b, 1);
  let res = 0;

  for (let i = 0; i < p.length; i++) {
    if (!a[i]) continue;
    let m1 = n / p[i],
        [, m2] = exgcd(m1, p[i]);
    m2 = (m2 % p[i] + p[i]) % p[i];
    res += a[i] * m1 * m2;
  }

  return (res % n + n) % n;
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

const rl = readline__default["default"].createInterface({
  input: process.stdin,
  output: process.stdout
});
let inputs = [];
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4];
const lcm = primes.reduce((a, b) => a * b, 1);

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)));
  });
}

void async function () {
  let t = await read();

  while (t--) {
    inputs = [];

    for (let i = 1; i <= 29; i++) {
      console.log(`? ${i} ${i + lcm}`);
      const res = await read();

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          inputs[j] = -i;
          break;
        }
      }
    }

    main(inputs, primes);
  }
}();

'use strict';

var readline = require('readline');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);

// import { solve } from './solve'
function main(answers, primes, lcm) {
  console.log(`! ${crt(primes, answers)}`); // console.log(answers, primes)
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0];
  const [d, y, x] = exgcd(b, a % b);
  return [d, x, y - Math.floor(a / b) * x];
}

function crt(p, a) {
  console.log(p, a);
  const n = p.reduce((a, b) => a * b, 1);
  let res = 0;

  for (let i = 0; i < p.length; i++) {
    if (!a[i]) continue;
    let m1 = n / p[i],
        [, m2] = exgcd(m1, p[i]);
    m2 = (m2 % p[i] + p[i]) % p[i];
    res += a[i] * m1 * m2;
  }

  return (res % n + n) % n;
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

const rl = readline__default["default"].createInterface({
  input: process.stdin,
  output: process.stdout
});
let inputs = [];
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4];
const lcm = primes.reduce((a, b) => a * b, 1);

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)));
  });
}

void async function () {
  let t = await read();

  while (t--) {
    inputs = [];

    for (let i = 1; i <= 29; i++) {
      console.log(`? ${i} ${i + lcm}`);
      const res = await read();

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          inputs[j] = -i;
          break;
        }
      }
    }

    main(inputs, primes);
  }
}();

'use strict';

var readline = require('readline');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);

function main(answers, primes, lcm) {
  const nums1 = answers.filter(num => num !== undefined),
        nums2 = primes.filter((_, i) => answers[i] !== undefined);
  console.log(`! ${(crt(nums1.length, nums1, nums2) + lcm) % lcm}`); // console.log(answers, primes)
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0];
  const [d, y, x] = exgcd(b, a % b);
  return [d, x, y - Math.floor(a / b) * x];
}

function crt(k, a, r) {
  let n = 1,
      res = 0;

  for (let num of r) n *= num;

  for (let i = 0; i < k; i++) {
    const m = Math.floor(n / r[i]);
    const [d, x, y] = exgcd(m, r[i]);
    res = (res + a[i] * m * x % n) % n;
  }

  return res;
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

const rl = readline__default["default"].createInterface({
  input: process.stdin,
  output: process.stdout
});
let inputs = [];
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4];
const lcm = primes.reduce((a, b) => a * b, 1);

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)));
  });
}

void async function () {
  let t = await read();

  while (t--) {
    inputs = [];

    for (let i = 1; i <= 23; i++) {
      console.log(`? ${i} ${i + lcm}`);
      const res = await read();

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          inputs[j] = -i;
          break;
        }
      }
    }

    main(inputs, primes, lcm);
  }
}();

'use strict'

var readline = require('readline')

function _interopDefaultLegacy(e) {
  return e && typeof e === 'object' && 'default' in e ? e : { default: e }
}

var readline__default = /*#__PURE__*/ _interopDefaultLegacy(readline)

function main(answers, primes, lcm) {
  const nums1 = answers.filter(num => num !== undefined),
    nums2 = primes.filter((_, i) => answers[i] !== undefined)
  console.log(`! ${(crt(nums1.length, nums1, nums2) + lcm) % lcm}`) // console.log(answers, primes)
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0]
  const [d, y, x] = exgcd(b, a % b)
  return [d, x, y - Math.floor(a / b) * x]
}

function crt(k, a, r) {
  let n = 1,
    res = 0

  for (let num of r) n *= num

  for (let i = 0; i < k; i++) {
    const m = Math.floor(n / r[i])
    const [d, x, y] = exgcd(m, r[i])
    res = (res + ((a[i] * m * x) % n)) % n
  }

  return res
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

const rl = readline__default['default'].createInterface({
  input: process.stdin,
  output: process.stdout,
})
const inputs = []
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4]
const lcm = primes.reduce((a, b) => a * b, 1)

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)))
  })
}
let a = 0
void (async function () {
  let t = await read()

  while (t--) {
    a++
    let str = []
    for (let i = 1; i <= 23; i++) {
      console.log(`? ${i} ${i + lcm}`)
      const res = await read()
      //str.push(res)

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          if(i===2)str.push(`${i}-${j}-${res}-${primes[j]}`)
          inputs[j] = -i
          break
        }
      }
    }
    if (a === 4) console.log(inputs.join(',')+'|'+str.join(','))
    main(inputs, primes, lcm)
  }
})()

'use strict'

var readline = require('readline')

function _interopDefaultLegacy(e) {
  return e && typeof e === 'object' && 'default' in e ? e : { default: e }
}

var readline__default = /*#__PURE__*/ _interopDefaultLegacy(readline)

function main(answers, primes, lcm) {
  const nums1 = answers.filter(num => num !== undefined),
    nums2 = primes.filter((_, i) => answers[i] !== undefined)
  console.log(`! ${(crt(nums1.length, nums1, nums2) + lcm) % lcm}`) // console.log(answers, primes)
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0]
  const [d, y, x] = exgcd(b, a % b)
  return [d, x, y - Math.floor(a / b) * x]
}

function crt(k, a, r) {
  let n = 1,
    res = 0

  for (let num of r) n *= num

  for (let i = 0; i < k; i++) {
    const m = Math.floor(n / r[i])
    const [d, x, y] = exgcd(m, r[i])
    res = (res + ((a[i] * m * x) % n)) % n
  }

  return res
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

const rl = readline__default['default'].createInterface({
  input: process.stdin,
  output: process.stdout,
})
const inputs = []
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4]
const lcm = primes.reduce((a, b) => a * b, 1)

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)))
  })
}
let a = 0
void (async function () {
  let t = await read()

  while (t--) {
    a++
    let str = []
    for (let i = 1; i <= 23; i++) {
      console.log(`? ${i} ${i + lcm}`)
      const res = await read()
      //str.push(res)

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          if(i===2)str.push(`${i}-${j}-${res}-${primes[j]}`)
          inputs[j] = -i
          break
        }
      }
    }
    if (a === 4) console.log(inputs.join(',')+'|',primes.join(','))
    main(inputs, primes, lcm)
  }
})()

'use strict'

var readline = require('readline')

function _interopDefaultLegacy(e) {
  return e && typeof e === 'object' && 'default' in e ? e : { default: e }
}

var readline__default = /*#__PURE__*/ _interopDefaultLegacy(readline)

function main(answers, primes, lcm) {
  const nums1 = answers.filter(num => num !== undefined),
    nums2 = primes.filter((_, i) => answers[i] !== undefined)
  console.log(`! ${(crt(nums1.length, nums1, nums2) + lcm) % lcm}`) // console.log(answers, primes)
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0]
  const [d, y, x] = exgcd(b, a % b)
  return [d, x, y - Math.floor(a / b) * x]
}

function crt(k, a, r) {
  let n = 1,
    res = 0

  for (let num of r) n *= num

  for (let i = 0; i < k; i++) {
    const m = Math.floor(n / r[i])
    const [d, x, y] = exgcd(m, r[i])
    res = (res + ((a[i] * m * x) % n)) % n
  }

  return res
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

const rl = readline__default['default'].createInterface({
  input: process.stdin,
  output: process.stdout,
})
const inputs = []
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4]
const lcm = primes.reduce((a, b) => a * b, 1)

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)))
  })
}

void (async function () {
  let t = await read()
  let a = 0

  while (t--) {
    a++
    let str = []
    for (let i = 1; i <= 23; i++) {
      console.log(`? ${i} ${i + lcm}`)
      const res = await read()
      //str.push(res)

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          if(i===2)str.push(`${i}-${j}-${res}-${primes[j]}`)
          inputs[j] = -i
          break
        }
      }
    }
    if (a === 4) console.log(str.join(','))
    main(inputs, primes, lcm)
  }
})()

'use strict'

var readline = require('readline')

function _interopDefaultLegacy(e) {
  return e && typeof e === 'object' && 'default' in e ? e : { default: e }
}

var readline__default = /*#__PURE__*/ _interopDefaultLegacy(readline)

function main(answers, primes, lcm) {
  const nums1 = answers.filter(num => num !== undefined),
    nums2 = primes.filter((_, i) => answers[i] !== undefined)
  console.log(`! ${(crt(nums1.length, nums1, nums2) + lcm) % lcm}`) // console.log(answers, primes)
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0]
  const [d, y, x] = exgcd(b, a % b)
  return [d, x, y - Math.floor(a / b) * x]
}

function crt(k, a, r) {
  let n = 1,
    res = 0

  for (let num of r) n *= num

  for (let i = 0; i < k; i++) {
    const m = Math.floor(n / r[i])
    const [d, x, y] = exgcd(m, r[i])
    res = (res + ((a[i] * m * x) % n)) % n
  }

  return res
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

const rl = readline__default['default'].createInterface({
  input: process.stdin,
  output: process.stdout,
})
const inputs = []
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4]
const lcm = primes.reduce((a, b) => a * b, 1)

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)))
  })
}

void (async function () {
  let t = await read()
  let a = 0

  while (t--) {
    a++
    let str = []
    for (let i = 1; i <= 23; i++) {
      console.log(`? ${i} ${i + lcm}`)
      const res = await read()
      str.push(res)

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          if(i===2)str.push(`${i}-${j}-${res}-${primes[j]}`)
          inputs[j] = -i
          break
        }
      }
    }
    if (a === 4) console.log(str.join(','))
    main(inputs, primes, lcm)
  }
})()

'use strict'

var readline = require('readline')

function _interopDefaultLegacy(e) {
  return e && typeof e === 'object' && 'default' in e ? e : { default: e }
}

var readline__default = /*#__PURE__*/ _interopDefaultLegacy(readline)

function main(answers, primes, lcm) {
  const nums1 = answers.filter(num => num !== undefined),
    nums2 = primes.filter((_, i) => answers[i] !== undefined)
  console.log(`! ${(crt(nums1.length, nums1, nums2) + lcm) % lcm}`) // console.log(answers, primes)
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0]
  const [d, y, x] = exgcd(b, a % b)
  return [d, x, y - Math.floor(a / b) * x]
}

function crt(k, a, r) {
  let n = 1,
    res = 0

  for (let num of r) n *= num

  for (let i = 0; i < k; i++) {
    const m = Math.floor(n / r[i])
    const [d, x, y] = exgcd(m, r[i])
    res = (res + ((a[i] * m * x) % n)) % n
  }

  return res
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

const rl = readline__default['default'].createInterface({
  input: process.stdin,
  output: process.stdout,
})
const inputs = []
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4]
const lcm = primes.reduce((a, b) => a * b, 1)

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)))
  })
}

void (async function () {
  let t = await read()
  let a = 0

  while (t--) {
    a++
    let str = []
    for (let i = 1; i <= 23; i++) {
      console.log(`? ${i} ${i + lcm}`)
      const res = await read()
      str.push(res)

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          str.push(`${i}-${j}-${res}-${primes[j]}`)
          inputs[j] = -i
          break
        }
      }
    }
    if (a === 4) console.log(str.join(','))
    main(inputs, primes, lcm)
  }
})()

'use strict'

var readline = require('readline')

function _interopDefaultLegacy(e) {
  return e && typeof e === 'object' && 'default' in e ? e : { default: e }
}

var readline__default = /*#__PURE__*/ _interopDefaultLegacy(readline)

function main(answers, primes, lcm, a) {
  const nums1 = answers.filter(num => num !== undefined),
    nums2 = primes.filter((_, i) => answers[i] !== undefined)

  if (a === 4) console.log(nums1.join(',') + '|' + nums2.join(','))
  console.log(`! ${(crt(nums1.length, nums1, nums2) + lcm) % lcm}`) // console.log(answers, primes)
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0]
  const [d, y, x] = exgcd(b, a % b)
  return [d, x, y - Math.floor(a / b) * x]
}

function crt(k, a, r) {
  let n = 1,
    res = 0

  for (let num of r) n *= num

  for (let i = 0; i < k; i++) {
    const m = Math.floor(n / r[i])
    const [d, x, y] = exgcd(m, r[i])
    res = (res + ((a[i] * m * x) % n)) % n
  }

  return res
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

const rl = readline__default['default'].createInterface({
  input: process.stdin,
  output: process.stdout,
})
const inputs = []
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4]
const lcm = primes.reduce((a, b) => a * b, 1)

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)))
  })
}

void (async function () {
  let t = await read()
  let a = 0

  while (t--) {
    a++
    let str = ''
    for (let i = 1; i <= 23; i++) {
      console.log(`? ${i} ${i + lcm}`)
      const res = await read()
      str += res

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          inputs[j] = -i
          break
        }
      }
    }
    main(inputs, primes, lcm, a)
  }
})()

'use strict'

var readline = require('readline')

function _interopDefaultLegacy(e) {
  return e && typeof e === 'object' && 'default' in e ? e : { default: e }
}

var readline__default = /*#__PURE__*/ _interopDefaultLegacy(readline)

function main(answers, primes, lcm) {
  const nums1 = answers.filter(num => num !== undefined),
    nums2 = primes.filter((_, i) => answers[i] !== undefined)
  console.log(`! ${(crt(nums1.length, nums1, nums2) + lcm) % lcm}`) // console.log(answers, primes)
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0]
  const [d, y, x] = exgcd(b, a % b)
  return [d, x, y - Math.floor(a / b) * x]
}

function crt(k, a, r) {
  let n = 1,
    res = 0

  for (let num of r) n *= num

  for (let i = 0; i < k; i++) {
    const m = Math.floor(n / r[i])
    const [d, x, y] = exgcd(m, r[i])
    res = (res + ((a[i] * m * x) % n)) % n
  }

  return res
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

const rl = readline__default['default'].createInterface({
  input: process.stdin,
  output: process.stdout,
})
const inputs = []
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4]
const lcm = primes.reduce((a, b) => a * b, 1)

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)))
  })
}

void (async function () {
  let t = await read()
  let a = 0

  while (t--) {
    a++
    let str = ''
    for (let i = 1; i <= 23; i++) {
      console.log(`? ${i} ${i + lcm}`)
      const res = await read()
      str += res

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          inputs[j] = -i
          break
        }
      }
    }
    if (a === 4) console.log(str)
    main(inputs, primes, lcm)
  }
})()

'use strict';

var readline = require('readline');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);

function main(answers, primes, lcm) {
  const nums1 = answers.filter(num => num !== undefined),
        nums2 = primes.filter((_, i) => answers[i] !== undefined);
  console.log(`! ${(crt(nums1.length, nums1, nums2) + lcm) % lcm}`); // console.log(answers, primes)
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0];
  const [d, y, x] = exgcd(b, a % b);
  return [d, x, y - Math.floor(a / b) * x];
}

function crt(k, a, r) {
  let n = 1,
      res = 0;

  for (let num of r) n *= num;

  for (let i = 0; i < k; i++) {
    const m = Math.floor(n / r[i]);
    const [d, x, y] = exgcd(m, r[i]);
    res = (res + a[i] * m * x % n) % n;
  }

  return res;
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

const rl = readline__default["default"].createInterface({
  input: process.stdin,
  output: process.stdout
});
const inputs = [];
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4];
const lcm = primes.reduce((a, b) => a * b, 1);

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)));
  });
}

void async function () {
  let t = await read();
  let a = 0;

  while (t--) {
    a++;

    for (let i = 1; i <= 23; i++) {
      console.log(`? ${i} ${i + lcm}`);
      const res = await read();
      if (a === 4) console.log(res);

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          inputs[j] = -i;
          break;
        }
      }
    }

    main(inputs, primes, lcm);
  }
}();

'use strict';

var readline = require('readline');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);

function main(answers, primes, lcm) {
  const nums1 = answers.filter(num => num !== undefined),
        nums2 = primes.filter((_, i) => answers[i] !== undefined);
  console.log(`! ${(crt(nums1.length, nums1, nums2) + lcm) % lcm}`); // console.log(answers, primes)
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0];
  const [d, y, x] = exgcd(b, a % b);
  return [d, x, y - Math.floor(a / b) * x];
}

function crt(k, a, r) {
  let n = 1,
      res = 0;

  for (let num of r) n *= num;

  for (let i = 0; i < k; i++) {
    const m = Math.floor(n / r[i]);
    const [d, x, y] = exgcd(m, r[i]);
    res = (res + a[i] * m * x % n) % n;
  }

  return res;
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

const rl = readline__default["default"].createInterface({
  input: process.stdin,
  output: process.stdout
});
const inputs = [];
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4];
const lcm = primes.reduce((a, b) => a * b, 1);

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)));
  });
}

void async function () {
  let t = await read();
  let a = 0;

  while (t--) {
    a++;

    for (let i = 1; i <= 23; i++) {
      console.log(`? ${i} ${i + lcm}`);
      const res = await read();

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          inputs[j] = -i;
          break;
        }
      }
    }

    if (a === 3) console.log(inputs, primes, lcm);
    main(inputs, primes, lcm);
  }
}();

'use strict';

var readline = require('readline');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);

function main(answers, primes, lcm) {
  const nums1 = answers.filter(num => num !== undefined),
        nums2 = primes.filter((_, i) => answers[i] !== undefined);
  console.log(`! ${(crt(nums1.length, nums1, nums2) + lcm) % lcm}`); // console.log(answers, primes)
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0];
  const [d, y, x] = exgcd(b, a % b);
  return [d, x, y - Math.floor(a / b) * x];
}

function crt(k, a, r) {
  let n = 1,
      res = 0;

  for (let num of r) n *= num;

  for (let i = 0; i < k; i++) {
    const m = Math.floor(n / r[i]);
    const [d, x, y] = exgcd(m, r[i]);
    res = (res + a[i] * m * x % n) % n;
  }

  return res;
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

const rl = readline__default["default"].createInterface({
  input: process.stdin,
  output: process.stdout
});
const inputs = [];
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4];
const lcm = primes.reduce((a, b) => a * b, 1);

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)));
  });
}

void async function () {
  let t = await read();

  while (t--) {
    for (let i = 1; i <= 23; i++) {
      console.log(`? ${i} ${i + lcm}`);
      const res = await read();

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          inputs[j] = -i;
          break;
        }
      }
    }

    main(inputs, primes, lcm);
  }
}();

'use strict';

var readline = require('readline');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);

function main(answers, primes, lcm) {
  console.log(`! ${(crt(answers.length, answers, primes) + lcm) % lcm}`); // console.log(answers, primes)
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0];
  const [d, y, x] = exgcd(b, a % b);
  return [d, x, y - Math.floor(a / b) * x];
}

function crt(k, a, r) {
  let n = 1,
      res = 0;

  for (let num of r) n *= num;

  for (let i = 0; i < k; i++) {
    const m = Math.floor(n / r[i]);
    const [d, x, y] = exgcd(m, r[i]);
    res = (res + a[i] * m * x % n) % n;
  }

  return res;
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

// import fs from 'fs'
const rl = readline__default["default"].createInterface({
  input: process.stdin,
  output: process.stdout
});
const inputs = [];
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4];
const lcm = primes.reduce((a, b) => a * b, 1);

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)));
  });
}

void async function () {
  let t = await read();

  while (t--) {
    for (let i = 1; i <= 23; i++) {
      console.log(`? ${i} ${i + lcm}`);
      const res = await read(); // let res = gcd(i + 50, i + lcm + 50)

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          inputs[j] = -i;
          break;
        }
      }
    }

    main(inputs, primes, lcm);
  }
}();

'use strict'

var readline = require('readline')

function _interopDefaultLegacy(e) {
  return e && typeof e === 'object' && 'default' in e ? e : { default: e }
}

var readline__default = /*#__PURE__*/ _interopDefaultLegacy(readline)

function main(answers, primes) {
  console.log(`! ${crt(answers.length, answers, primes)}`) // console.log(answers, primes)
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0]
  const [d, y, x] = exgcd(b, a % b)
  return [d, x, y - Math.floor(a / b) * x]
}

function crt(k, a, r) {
  let n = 1,
    res = 0

  for (let num of r) n *= num

  for (let i = 0; i < k; i++) {
    const m = Math.floor(n / r[i])
    const [d, x, y] = exgcd(m, r[i])
    res = (res + ((a[i] * m * x) % n)) % n
  }

  return res
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

// import fs from 'fs'
const rl = readline__default['default'].createInterface({
  input: process.stdin,
  output: process.stdout,
})
const inputs = []
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4]
const lcm = primes.reduce((a, b) => a * b, 1)

function question(message) {
  return new Promise(function (resolve, reject) {
    rl.question(message, answer => {
      resolve(Number(answer))
    })
  })
}

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)))
  })
}

void (async function () {
  let t = await read()

  while (t--) {
    for (let i = 1; i <= 23; i++) {
      console.log(`? ${i} ${i + lcm}`)
      const res = await read() // let res = gcd(i + 23, i + lcm + 23)

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          inputs[j] = -i
          break
        }
      }
    }

    main(inputs, primes)
  }
})()

'use strict'

var readline = require('readline')

function _interopDefaultLegacy(e) {
  return e && typeof e === 'object' && 'default' in e ? e : { default: e }
}

var readline__default = /*#__PURE__*/ _interopDefaultLegacy(readline)

function main(answers, primes) {
  console.log(crt(answers.length, answers, primes)) // console.log(answers, primes)
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0]
  const [d, y, x] = exgcd(b, a % b)
  return [d, x, y - Math.floor(a / b) * x]
}

function crt(k, a, r) {
  let n = 1,
    res = 0

  for (let num of r) n *= num

  for (let i = 0; i < k; i++) {
    const m = Math.floor(n / r[i])
    const [d, x, y] = exgcd(m, r[i])
    res = (res + ((a[i] * m * x) % n)) % n
  }

  return res
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

// import fs from 'fs'
const rl = readline__default['default'].createInterface({
  input: process.stdin,
  output: process.stdout,
})
const inputs = []
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4]
const lcm = primes.reduce((a, b) => a * b, 1)

function question(message) {
  return new Promise(function (resolve, reject) {
    rl.question(message, answer => {
      resolve(Number(answer))
    })
  })
}

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)))
  })
}

void (async function () {
  let t = await read()

  while (t--) {
    for (let i = 1; i <= 23; i++) {
      console.log(`? ${i} ${i + lcm}`)
      const res = await read() // let res = gcd(i + 23, i + lcm + 23)

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          inputs[j] = -i
          break
        }
      }
    }
  }

  main(inputs, primes)
})()

'use strict'

var readline = require('readline')

function _interopDefaultLegacy(e) {
  return e && typeof e === 'object' && 'default' in e ? e : { default: e }
}

var readline__default = /*#__PURE__*/ _interopDefaultLegacy(readline)

function main(answers, primes) {
  console.log(crt(answers.length, answers, primes)) // console.log(answers, primes)
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0]
  const [d, y, x] = exgcd(b, a % b)
  return [d, x, y - Math.floor(a / b) * x]
}

function crt(k, a, r) {
  let n = 1,
    res = 0

  for (let num of r) n *= num

  for (let i = 0; i < k; i++) {
    const m = Math.floor(n / r[i])
    const [d, x, y] = exgcd(m, r[i])
    res = (res + ((a[i] * m * x) % n)) % n
  }

  return res
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

// import fs from 'fs'
const rl = readline__default['default'].createInterface({
  input: process.stdin,
  output: process.stdout,
})
const inputs = []
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4]
const lcm = primes.reduce((a, b) => a * b, 1)

function question(message) {
  return new Promise(function (resolve, reject) {
    rl.question(message, answer => {
      resolve(Number(answer))
    })
  })
}

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)))
  })
}

void (async function () {
  let t = await read()

  while (t--) {
    for (let i = 1; i <= 23; i++) {
      console.log(`? ${i} ${i + lcm}`)
      const res = await read() // let res = gcd(i + 23, i + lcm + 23)
      console.log(res)
      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          inputs[j] = -i
          break
        }
      }
    }
  }

  main(inputs, primes)
})()

'use strict';

var readline = require('readline');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);

function main(answers, primes) {
  console.log(crt(answers.length, answers, primes)); // console.log(answers, primes)
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0];
  const [d, y, x] = exgcd(b, a % b);
  return [d, x, y - Math.floor(a / b) * x];
}

function crt(k, a, r) {
  let n = 1,
      res = 0;

  for (let num of r) n *= num;

  for (let i = 0; i < k; i++) {
    const m = Math.floor(n / r[i]);
    const [d, x, y] = exgcd(m, r[i]);
    res = (res + a[i] * m * x % n) % n;
  }

  return res;
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

// import fs from 'fs'
const rl = readline__default["default"].createInterface({
  input: process.stdin,
  output: process.stdout
});
const inputs = [];
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4];
const lcm = primes.reduce((a, b) => a * b, 1);

function question(message) {
  return new Promise(function (resolve, reject) {
    rl.question(message, answer => {
      resolve(Number(answer));
    });
  });
}

function read() {
  return new Promise(function (resolve, reject) {
    rl.on('line', line => resolve(Number(line)));
  });
}

void async function () {
  let t = await read();
  console.log(t)
  while (t--) {
    for (let i = 1; i <= 23; i++) {
      const res = await question(`? ${i} ${i + lcm}`); // let res = gcd(i + 23, i + lcm + 23)

      for (let j = 0; j < primes.length; j++) {
        if (res % primes[j] === 0) {
          inputs[j] = -i;
          break;
        }
      }
    }
  }

  main(inputs, primes);
}();

'use strict';

var readline = require('readline');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);

function main(answers, primes) {
  console.log(crt(answers.length, answers, primes)); // console.log(answers, primes)
}

function exgcd(a, b) {
  if (b === 0) return [a, 1, 0];
  const [d, y, x] = exgcd(b, a % b);
  return [d, x, y - Math.floor(a / b) * x];
}

function crt(k, a, r) {
  let n = 1,
      res = 0;

  for (let num of r) n *= num;

  for (let i = 0; i < k; i++) {
    const m = Math.floor(n / r[i]);
    const [d, x, y] = exgcd(m, r[i]);
    res = (res + a[i] * m * x % n) % n;
  }

  return res;
} // console.log(crt(3, [2, 3, 2], [3, 5, 7]))

// import fs from 'fs'
const rl = readline__default["default"].createInterface({
  input: process.stdin,
  output: process.stdout
});
const inputs = [];
const primes = [23, 19, 17, 13, 11, 9, 7, 5, 4];
const lcm = primes.reduce((a, b) => a * b, 1);

function question(message) {
  return new Promise(function (resolve, reject) {
    rl.question(message, answer => {
      resolve(Number(answer));
    });
  });
}

void async function () {
  for (let i = 1; i <= 23; i++) {
    const res = await question(`? ${i} ${i + lcm}`); // let res = gcd(i + 23, i + lcm + 23)

    for (let j = 0; j < primes.length; j++) {
      if (res % primes[j] === 0) {
        inputs[j] = -i;
        break;
      }
    }
  }

  main(inputs, primes);
}();


A permutation is a sequence of integers p1, p2, ..., pn, consisting of n distinct positive integers, each of them doesn't exceed n. Let's denote the i-th element of permutation p as pi. We'll call number n the size of permutation p1, p2, ..., pn.Nickolas adores permutations. He likes some permutations more than the others. He calls such permutations perfect. A perfect permutation is such permutation p that for any i (1 ≤ i ≤ n) (n is the permutation size) the following equations hold ppi = i and pi ≠ i. Nickolas asks you to print any perfect permutation of size n for the given n.

A single line contains a single integer n (1 ≤ n ≤ 100) — the permutation size.

If a perfect permutation of size n doesn't exist, print a single integer -1. Otherwise print n distinct integers from 1 to n, p1, p2, ..., pn — permutation p, that is perfect. Separate printed numbers by whitespaces.

let inputString = '';
let currentLine = 0;
process.stdin.on('data', data => {
	inputString += data;
});
process.stdin.on('end', function () {
	inputString = inputString
		.trim()
		.split('\n')
		.map(str => str.trim());
	main();
});

function readLine() {
	return inputString[currentLine++];
}

function isPrime(x) {
	let s = Math.sqrt(x);
	let i = 2;
	while (i <= s) {
		if (x % i === 0) {
			return false;
		}
		i++;
	}
	return true;
}

function main() {
	let n = readLine() >> 0;
	if ((n & 1) === 1) {
		console.log(-1);
		return;
	}

	let arr = [];
	for (let i = 1; i <= n; i += 2) {
		arr[i - 1] = i + 1;
		arr[i] = i;
	}

	console.log(arr.join(' '));
}

process.stdin.resume();
process.stdin.setEncoding('utf-8');
let inputString = '';
let currentLine = 0;
process.stdin.on('data', (inputStd) => {
    inputString += inputStd;
});
process.stdin.on('end', function () {
    inputString = inputString
        .trim()
        .split('\n')
        .map((str) => {
            return str.trim();
        });
    main();
});
function readLine() {
    return inputString[currentLine++];
}

function main() {
    let input = parseInt(readLine());
    if (input % 2 !== 0) {
        console.log(-1);
        return;
    }
    let finalArray = [];

    for (let i = 1; i <= input; i++) {
        if (i % 2 === 0) {
            finalArray.push(i - 1);
        } else {
            finalArray.push(i + 1);
        }
    }
    let final = finalArray.join(' ');

    console.log(final);
}

var n=+readline();

if(n%2){
	print(-1);
}else{
	var p=[];
	for(var i=2; i<=n; i+=2){
		p.push(i);
		p.push(i-1);
	}
	print(p.join(' '));
}

;(function () {

	var n = +readline();

	if (n%2 !== 0) {
		print(-1);
		return;
	}

	var t = [];
	for (var i = 0; i < n; i += 2) t.push(i + 2, i + 1)
	print( t.join(' ') );

}).call(this);

function trim(s) {
	return s.replace(/^\s+|\s+$/gm, '');
}

function tokenize(s) {
	return trim(s).split(/\s+/);
}

function tokenizeIntegers(s) {
	var tokens = tokenize(s);
	for (var i = 0; i < tokens.length; i += 1) {
		tokens[i] = parseInt(tokens[i], 10);
	};
	return tokens;
}

function main() {
	var n = parseInt(readline());
	if (n%2 == 1) {
		print(-1);
	} else {
		var result = [];
		for (var i = 1; 2*i <= n; ++i) {
			result.push(2*i);
			result.push(2*i-1);
		}
		print(result.join(' '));
	}
}

main();

let inputString = "";
let currentLine = 0;
process.stdin.on("data", (data) => {
  inputString += data;
});
process.stdin.on("end", function () {
  inputString = inputString
    .trim()
    .split("\n")
    .map((str) => str.trim());
  main();
});
function readLine() {
  return inputString[currentLine++];
}
function main() {
  let len = +readLine();
  if (len % 2 !== 0) {
    console.log(-1);
    return;
  }
  let result = [];
  let [even, odd] = [2, 1];

  for (let i = 1; i <= len; i++) {
    if (i % 2 === 0) {
      result.push(odd);
      odd += 2;
    } else {
      result.push(even);
      even += 2;
    }
  }
  console.log(result.join(" "));
}

//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error('\n');
  var start = Date.now();
  Main();
  var end = Date.now() - start;
  myerr('time : ' + end + 'ms');
  myerr('memory : ' + Math.round(process.memoryUsage().heapTotal / 1024) + 'KB');
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){
  return {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}
  };
}
function myout(s){console.log(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
  var N = nextInt();
  if(N % 2 == 1){
    myout(-1);
    return;
  }
  var output = [];
  for(var i = 1; i <= N; i += 2){
    output.push(i + 1);
    output.push(i);
  }
  myout(myconv(output, 8));
}

//Perfect Permutation

const {EOL} = require('os');

let inp = '';

process.stdin.on('data', c => inp += c);

process.stdin.on('end', () => {
    let n = +inp.split(EOL)[0];

    if(n % 2 == 1)  {
    	process.stdout.write("-1");
    	return;
    }

    for(let i = 1; i <= n; i += 2)  {
    	process.stdout.write((i + 1) + " " + i + " ");
    }

    return;
});

const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});

rl.on('line', (d) => {
  const n = +d;

  if (n % 2 === 1) {
    console.log(-1);
    return;
  }

  let ans = [];
  for (let i = 1; i <= n; i++) {
    if (i % 2 === 1) {
      ans.push(i + 1);
    }
    else {
      ans.push(i - 1);
    }
  }

  console.log(ans.join(' '));
});

const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});

rl.on('line', (d) => {
  const n = +d;

  if (n === 1) {
    console.log(-1);
    return;
  }

  let ans = [];
  for (let i = 1; i <= n; i++) {
    if (i % 2 === 1) {
      ans.push(i + 1);
    }
    else {
      ans.push(i - 1);
    }
  }

  console.log(ans.join(' '));
});

//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error('\n');
  var start = Date.now();
  Main();
  var end = Date.now() - start;
  myerr('time : ' + end + 'ms');
  myerr('memory : ' + Math.round(process.memoryUsage().heapTotal / 1024) + 'KB');
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){
  return {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}
  };
}
function myout(s){console.log(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
  var N = nextInt();
  if(N == 1){
    myout(-1);
    return;
  }
  var output = [];
  for(var i = 2; i <= N; i++){
    output.push(i);
  }
  output.push(1);
  myout(myconv(output, 8));
}

const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});

rl.on('line', (d) => {
  const n = +d;

  if (n === 1) {
    console.log(-1);
    return;
  }

  const ans = [n];
  for (let i = 1; i < n; i++) {
    ans.push(i);
  }

  console.log(ans.join(' '));
});

const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});

rl.on('line', (d) => {
  const n = +d;

  if (n === 1) {
    console.log(-1);
    return;
  }

  const ans = [];
  for (let i = n; i > 0; i--) {
    ans.push(i);
  }

  console.log(ans.join(' '));
});