process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    D();
});

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

function pi(a) {
    return parseInt(a);
}

function ti(a){
    for(let i = 0; i < a.length; i++)
        a[i] = pi(a[i]);

    return a;
}

function D(){

    let t = pi(readline());

    while(t > 0){
        t--;
        let [n,a,b,da,db] = ti(readline().split(' '));

        let adj = new Array(n);
        for(let i = 0; i < n; i++)
            adj[i] = [];

        for(let i = 0; i < n-1; i++){
            let [u,v] = ti(readline().split(' '));
            adj[u-1].push(v-1);
            adj[v-1].push(u-1);
        }

        let dist = new Array(n);
        let bfs = (st, n) => {
            let q = [st,null];
            let level = 0;
            let v = new Array(n);
            v.fill(false);
            dist.fill(-1);
            while(q.length > 0){
                let node = q.shift();
                if(node !== null){
                    v[node] = true;
                    dist[node] = level;
                    for(let i = 0; i < adj[node].length; i++){
                        if(!v[adj[node][i]])
                            q.push(adj[node][i]);
                    }
                }else{
                    level += 1;
                    if(q.length > 0)
                        q.push(null);
                }
            }
        }

        let farthest = (dist) => {
            let max = -1;
            let ans = -1;
            for(let i = 0; i < dist.length; i++){
                if(dist[i] > max){
                    max = dist[i];
                    ans = i;
                }
            }

            return ans;
        }

        bfs(a-1, n);
        if(dist[b-1] <= da){
            console.log('Alice');
            continue;
        }
        let f = farthest(dist);
        bfs(f, n);
        let ff = farthest(dist);
        let diameter = dist[ff];

        if(da*2 >= db){
            console.log('Alice');
            continue;
        }

        if(diameter <= da*2){
            console.log('Alice');
            continue;
        }

        console.log('Bob');
    }
}

function For(a, b, fn) {
  if (!fn) return For(0, a - 1, b);
  let res;
  for (let i = a; i <= b; i++) {
    if ((res = fn(i)) != null) return res;
  }
}
function ForR(a, b, fn) {
  if (!fn) return ForR(a - 1, 0, b);
  let res;
  for (let i = a; i >= b; i--) {
    if ((res = fn(i)) != null) return res;
  }
}

function Arr(a, b, fn, init) {
  if (typeof (b) == 'function') return Arr(0, a - 1, b, fn);
  if (b < a) return [];
  let arr = Array(b - a + 1).fill(0);
  if (init) init(arr);
  for (let i = a; i <= b; i++) arr[i] = fn(i, arr);
  return arr;
}

Object.defineProperty(Object.prototype, '$k', {
  value: function () { return Object.keys(this) }
});
Object.defineProperty(Object.prototype, '$v', {
  value: function () { return Object.values(this) }
});
Object.defineProperty(Object.prototype, '$kv', {
  value: function () { return Object.entries(this) }
});
Array.prototype.sum = function (fn) { return this.reduce((p, v) => p + (fn ? fn(v) : v), 0) }
Array.prototype.uniq = function (fn) {
  var set = new Set();
  return this.filter(v => {
    var newValue = !set.has(fn ? fn(v) : v);
    set.add(fn ? fn(v) : v);
    return newValue;
  });
}
Array.prototype.toObj = function (fn) {
  return this.map(v => fn ? fn(v) : v).reduce((p, v) => {
    p[v[0]] = v[1];
    return p;
  }, {})
}
Array.prototype.min = function (fn) {
  let min = 1e20, index = -1, x;
  for (let i = 0; i < this.length; i++) {
    x = fn ? fn(this[i], i, this) : this[i];
    if (x < min) { min = x; index = i }
  }
  return [this[index], index, min];
}
Array.prototype.max = function (fn) {
  let max = -1e20, index = -1, x;
  for (let i = 0; i < this.length; i++) {
    x = fn ? fn(this[i], i, this) : this[i];
    if (x > max) { max = x; index = i }
  }
  return [this[index], index, max];
}
Array.prototype.rev = function (first, last) {
  for (let i = first; i < (first + last) / 2; i++) {
    [this[i], this[last - 1 - i + first]] = [this[last - 1 - i + first], this[i]]
  }
}
Array.prototype.set = function (pos, arr) {
  for (let i = pos; i < pos + arr.length; i++) {
    this[i] = arr[i - pos];
  }
}
Array.prototype.for = function (a, b, fn) {
  let res
  for (let i = a; i <= b; i++) {
    if ((res = fn(this[i], i, this)) != null) return res;
  }
}
Array.prototype.forR = function (a, b, fn) {
  let res
  for (let i = a; i >= b; i--) {
    if ((res = fn(this[i], i, this)) != null) return res;
  }
}
Array.prototype.bin = function (comp, a, b) {
  let mid;
  while (a < b) {
    mid = (a + b) / 2 | 0;
    if (typeof comp == 'function' ? comp(this[mid]) : this[mid] < comp) a = mid + 1;
    else b = mid;
  }
  return mid;
}
Array.prototype.cut = function (fn, a, b) {
  let arr = [];
  let sub = [];
  a = a || 0;
  b = b || (this.length - 1);
  for (let i = a; i <= b; i++) {
    sub.push(this[i])
    if (fn(this[i], i, this)) {
      arr.push(sub);
      sub = [];
    }
  }
  return arr;
}

function gcd(a, b) {
  while (b) [a, b] = [b, a % b];
  return a;
}
function mul(a, b, m) {
  return ((a >> 16) * b % m * 65536 + (a & 65535) * b) % m
}
function pow(a, n, m) {
  let r = 1;
  while (n) n & 1 ? (r = mul(r, a, m), n--) : [a, n] = [mul(a, a, m), n >> 1]
  return r;
}
let MOD = 998244353
function inv(b) {
  for (var a = MOD, u = 0, v = 1, t; b; v = t)
    (t = a / b | 0, a -= t * b, u -= t * v, t = a, a = b, b = t, t = u, u = v);
  return (u + MOD) % MOD;
}

// let gt = Arr(n, (i, a) => i == 0 ? 1 : mul(a[i - 1], i, MOD));
// let rgt = Arr(n, (i, a) => i <= 1 ? 1 : MOD - mul((MOD / i | 0), a[998244353 % i], MOD));
// For(2, n - 1, i => { rgt[i] = mul(rgt[i], rgt[i - 1], MOD) });
// let nCk = (n, k) => mul(mul(gt[n], rgt[k], MOD), rgt[n - k], MOD);

// for (i = pos; i <= n; i += i & -i) fen[i]++; // start from index 1
// for (i = pos; i; i -= i & -i) ans += fen[i];

// let p = [2];
// for (let i = 3; i < 1e5; i += 2) {
//   let j, x = Math.sqrt(i);
//   for (j = 0; p[j] <= x; j++) if (i % p[j] == 0) break;
//   if (i % p[j] != 0) p.push(i);
// }

// let root = x => par[x] < 0 ? x : (par[x] = root(par[x]));
// let dsu = (x, y) => {
//   if ((x = root(x)) == (y = root(y))) return;
//   if (par[y] < par[x]) [x, y] = [y, x];
//   par[x] += par[y];
//   par[y] = x;
// }

let input = '';
process.stdin.on('data', c => input += c);
process.stdin.on('end', main);
async function main() {
  let inp = input.split(/\s+/).map(v => +v), _i = 0, $ = n => n != null ? inp.slice(_i, _i += n) : inp[_i++],
    out = [], log = console.log, asc = (a, b) => a - b, desc = (a, b) => b - a, min = Math.min, max = Math.max, abs = Math.abs;
  let t = $()
  while (t--) {
    let [n, a, b, da, db] = $(5)
    let e = Arr(n + 1, i => [])
    let u, v
    For(n - 1, i => {
      u = $(), v = $()
      e[u].push(v)
      e[v].push(u)
    })
    // log(e)
    if (da >= db / 2) { log('Alice'); continue }

    let t = 1;
    let mark = Array(n + 1).fill(0)
    let dfs = async (u, d) => {
      if (t++ % 1000 == 0) await Promise.resolve();
      if (mark[u]) return;
      mark[u] = d;
      for (let v of e[u]) await dfs(v, d + 1);
    }
    await dfs(a, 1)
    // log(mark)
    if (da >= mark[b] - 1) { log('Alice'); continue }
    let idm = mark.max()[1];
    mark.fill(0)
    await dfs(idm, 1);
    // log(mark)
    if (da >= (mark.max()[0] - 1) / 2) { log('Alice'); continue }
    log('Bob')
  }
}

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    D();
});

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

function pi(a) {
    return parseInt(a);
}

function ti(a){
    for(let i = 0; i < a.length; i++)
        a[i] = pi(a[i]);

    return a;
}

function D(){

    let t = pi(readline());

    while(t > 0){
        t--;
        let [n,a,b,da,db] = ti(readline().split(' '));

        let adj = new Array(n);
        for(let i = 0; i < n; i++)
            adj[i] = [];

        for(let i = 0; i < n-1; i++){
            let [u,v] = ti(readline().split(' '));
            adj[u-1].push(v-1);
            adj[v-1].push(u-1);
        }

        let queue = [a-1, null];
        let visited = new Array(n);
        visited.fill(false);
        let dab = 0;
        while(queue.length > 0){
            let node = queue.shift();
            if(node !== null){
                visited[node] = true;
                if(node === b-1)
                    break;

                for(let i = 0; i < adj[node].length; i++){
                    if(!visited[adj[node][i]])
                        queue.push(adj[node][i]);
                }
            }else{
                dab += 1;
                if(queue.length > 0)
                    queue.push(null);
            }
        }

        if(dab <= da){
            console.log('Alice');
            continue;
        }

        let bfs = (st, n, en) => {
            let q = [st,null];
            let level = 0;
            let v = new Array(n);
            v.fill(false);
            while(q.length > 0){
                let node = q.shift();
                if(node !== null){
                    v[node] = true;
                    en.val = node;
                    for(let i = 0; i < adj[node].length; i++){
                        if(!v[adj[node][i]])
                            q.push(adj[node][i]);
                    }
                }else{
                    level += 1;
                    if(q.length > 0)
                        q.push(null);
                }
            }

            return level;
        }

        let en = {val: -1};
        bfs(a-1, n, en);
        let diameter = bfs(en.val, n, -1);

        if(da >= Math.ceil(diameter/2)){
            console.log('Alice');
            continue;
        }

        if(da >= Math.ceil(db/2)){
            console.log('Alice');
            continue;
        }

        console.log('Bob');
    }
}

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    D();
});

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

function pi(a) {
    return parseInt(a);
}

function ti(a){
    for(let i = 0; i < a.length; i++)
        a[i] = pi(a[i]);

    return a;
}

function D(){

    let t = pi(readline());

    while(t > 0){
        t--;
        let [n,a,b,da,db] = ti(readline().split(' '));

        let adj = new Array(n);
        for(let i = 0; i < n; i++)
            adj[i] = [];

        for(let i = 0; i < n-1; i++){
            let [u,v] = ti(readline().split(' '));
            adj[u-1].push(v-1);
            adj[v-1].push(u-1);
        }

        let queue = [a-1, null];
        let visited = new Array(n);
        visited.fill(false);
        let dab = 0;
        while(queue.length > 0){
            let node = queue.shift();
            if(node !== null){
                visited[node] = true;
                if(node === b-1)
                    break;

                for(let i = 0; i < adj[node].length; i++){
                    if(!visited[adj[node][i]])
                        queue.push(adj[node][i]);
                }
            }else{
                dab += 1;
                if(queue.length > 0)
                    queue.push(null);
            }
        }

        if(dab <= da){
            console.log('Alice');
            continue;
        }

        let bfs = (st, n, en) => {
            let q = [st,null];
            let level = 0;
            let v = new Array(n);
            v.fill(false);
            while(q.length > 0){
                let node = q.shift();
                if(node !== null){
                    v[node] = true;
                    en.val = node;
                    for(let i = 0; i < adj[node].length; i++){
                        if(!v[adj[node][i]])
                            q.push(adj[node][i]);
                    }
                }else{
                    level += 1;
                    if(q.length > 0)
                        q.push(null);
                }
            }

            return level;
        }

        let en = {val: -1};
        bfs(a-1, n, en);
        let diameter = bfs(en.val, n, -1);

        if(da*2 >= db){
            console.log('Alice');
            continue;
        }

        if(diameter <= da*2){
            console.log('Alice');
            continue;
        }

        console.log('Bob');
    }
}

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    D();
});

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

function pi(a) {
    return parseInt(a);
}

function ti(a){
    for(let i = 0; i < a.length; i++)
        a[i] = pi(a[i]);

    return a;
}

function D(){

    let t = pi(readline());

    while(t > 0){
        t--;
        let [n,a,b,da,db] = ti(readline().split(' '));

        let adj = new Array(n);
        for(let i = 0; i < n; i++)
            adj[i] = [];

        for(let i = 0; i < n-1; i++){
            let [u,v] = ti(readline().split(' '));
            adj[u-1].push(v-1);
            adj[v-1].push(u-1);
        }

        let queue = [a-1, null];
        let visited = new Array(n);
        visited.fill(false);
        let dab = 0;
        while(queue.length > 0){
            let node = queue.shift();
            if(node !== null){
                visited[node] = true;
                if(node === b-1)
                    break;

                for(let i = 0; i < adj[node].length; i++){
                    if(!visited[adj[node][i]])
                        queue.push(adj[node][i]);
                }
            }else{
                dab += 1;
                if(queue.length > 0)
                    queue.push(null);
            }
        }

        if(dab <= da){
            console.log('Alice');
            continue;
        }

        let bfs = (st, n, en) => {
            let q = [st,null];
            let level = 0;
            let v = new Array(n);
            v.fill(false);
            while(q.length > 0){
                let node = q.shift();
                if(node !== null){
                    v[node] = true;
                    en.val = node;
                    for(let i = 0; i < adj[node].length; i++){
                        if(!v[adj[node][i]])
                            q.push(adj[node][i]);
                    }
                }else{
                    level += 1;
                    if(q.length > 0)
                        q.push(null);
                }
            }

            return level;
        }

        let en = {val: -1};
        bfs(a-1, n, en);
        let diameter = bfs(en.val, n, {val: -1});

        if(da*2 >= db){
            console.log('Alice');
            continue;
        }

        if(diameter <= da*2){
            console.log('Alice');
            continue;
        }

        console.log('Bob');
    }
}


process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    B();
});

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

function pi(a) {
    return parseInt(a);
}

function ti(a){
    for(let i = 0; i < a.length; i++)
        a[i] = pi(a[i]);

    return a;
}

function A(){
    let t = pi(readline());
    while(t){
        t--;
        let n = pi(readline());
        let res = '';
        for(let i = 1; i <= n; i++){
            if(i !== n){
                res += ` ${i+1}`;
            }else{
                res += ` ${1}`;
            }
        }

        console.log(res.trim());
    }
}

function B(){
    let t = pi(readline());
    while(t > 0){
        t--;
        let n = pi(readline());
        let x = readline().split(' ');
        let a = new Array(n);
        let max = 0;
        for(let i = 0; i < n; i++)
            max = Math.max(max, pi(x[i]));
        let map = new Array(max+2);
        let rMap = new Array(max+2);

        for(let i = 0; i < n; i++){
            a[i] = pi(x[i]);
            if(map[a[i]] !== undefined){
                map[a[i]] += 1;
                rMap[a[i]] = i;
            }else{
                map[a[i]]  = 1;
                rMap[a[i]] = i;
            }
        }

        let min = 99999999999;
        for(let i = 0; i < a.length; i++){
            if(map[a[i]] === 1){
                min = Math.min(min, a[i]);
            }
        }

        console.log(min === 99999999999 ? -1 : rMap[min]+1);
    }
}

function C(){
    let t = pi(readline());
    while(t > 0){
        t--;
        let n = pi(readline());
        let a = ti(readline().split(' '));
        let map = new Array(200005);
        //map.fill(0);
        for(let i = 0; i < n; i++){
            if(i === 0){
                map[a[i]] = 1;
                continue;
            }

            if(a[i] !== a[i-1]){
                if(map[a[i]] !== undefined){
                    map[a[i]] += 1;
                }else{
                    map[a[i]]  = 1;
                }
            }
        }

        let min = 99999999;
        for(let i = 0; i < n; i++){
            if(map[a[i]] !== undefined){
                if(a[i] === a[0] && a[i] === a[n-1]){
                    min = Math.min(min, map[a[i]]-1);
                }else if(a[i] === a[0] || a[i] === a[n-1]){
                    min = Math.min(min, map[a[i]]);
                }else{
                    min = Math.min(min, map[a[i]]+1);
                }
            }
        }

        console.log(min === 99999999 ? 0 : min);
    }
}

let getFactors = (n) => {
    let i = 2;
    let res = [];
    while(i*i <= n){
        if(n%i === 0)
            res.push([i,n/i]);
        i++;
    }
    return res;
}

function D(){
    let t = pi(readline());
    while(t > 0){
        t--;
        let n = pi(readline());
        let dp = new Array(Math.floor(n+1));
        dp.fill(1);

        for(let i = 0; i < dp.length; i++){
            let f = getFactors(i);
            if(f.length !== 0){
                for(let j = 0; j < f.length; j++){
                    if(f[j][1] % f[j][0] === 0)
                        dp[i] = Math.max(dp[i], dp[f[j][0]]+dp[f[j][1]]);
                }
            }
        }

        let f = getFactors(n);
        let max = 1;
        if(f.length > 0){
            for(let i = 0; i < f.length; i++){
                if(f[i][1] % f[i][0] === 0)
                    max = Math.max(max, dp[f[i][0]]+dp[f[i][1]]);
            }
        }
        console.log(max);
    }
}

var t = +readline();

for (var i = 0; i < t; i++) {
  var l = +readline();
  var arr = readline().split(' ').map(i => +i);
  var tmp = {};
  var idx = -1;

  arr.forEach(item => {
    if (tmp[item] === undefined) {
      tmp[item] = 0;
    }
    tmp[item]++;
  });

  for (var k in tmp) {
    if (tmp[k] == 1) {
      idx = arr.indexOf(+k) + 1;
      break;
    }
  }

  print(idx || -1);
}

const solve = (n, game) => {
    let map = getRecord2(game);
    let u = game.filter(x => map.get(x) == 1);
    let min = Math.min.apply(Math, u);
    for (let i = 0; i < n; i++) {
        if (game[i] == min && map.get(game[i]) == 1) {
            console.log(i + 1);
            return;
        }
    }
    console.log(-1);
};

const getRecord2 = (arr) => {
    let map = new Map();
    for (const i of arr) {
        map.set(i, (map.get(i) + 1) || 1);
    }
    return map;
};

const main = () => {
    const readline = require('readline');
    const rl = readline.createInterface({
        input: process.stdin,
        output: process.stdout
    });
    let input = [];
    rl.on('line', (line) => {
        input.push(line.split(" ").map(x => Number(x)));
    });
    rl.on('close', () => {
        let t = Number(input[0][0]);
        for (let i = 1; t--; i += 2) {
            solve(input[i], input[i + 1]);
        }
    });
};

main()

const solve = (n, game) => {
    let map = getRecord2(game);
    let u = game.filter(x => map.get(x) == 1);
    let min = Math.min.apply(Math, u);
    for (let i = 0; i < n; i++) {
        if (game[i] == min && map.get(game[i]) == 1) {
            console.log(i + 1);
            return;
        }
    }
    console.log(-1);
};

const getRecord2 = (arr) => {
    let map = new Map();
    for (const i of arr) {
        map.set(i, (map.get(i) + 1) || 1);
    }
    return map;
};

const main = () => {
    const readline = require('readline');
    const rl = readline.createInterface({
        input: process.stdin,
        output: process.stdout
    });
    let input = [];
    rl.on('line', (line) => {
        input.push(line.split(" ").map(x => Number(x)));
    });
    rl.on('close', () => {
        let t = Number(input[0][0]);
        let i = 1;
        while (t > 0) {
            let data = input.slice(i, i + 2);
            solve(data[0][0], data[1]);
            t--;
            i += 2;
        }
    });
};

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++];
}

// utils
const MOD = 1e9 + 7;
const mod = (n) => ((n % MOD) + MOD) % MOD;
const add = (a, b) => mod(mod(a) + mod(b));
const sub = (a, b) => mod(mod(a) - mod(b));
function mul() {
  for (var a = arguments, r = a[0], i = a.length; --i; )
    r = ((((r >> 16) * a[i]) % MOD) * 65536 + (r & 65535) * a[i]) % MOD;
  return r;
}
function inv(b) {
  for (var a = MOD, u = 0, v = 1, t; b; v = t)
    (t = (a / b) | 0), (a -= t * b), (u -= t * v), (t = a), (a = b), (b = t), (t = u), (u = v);
  u %= MOD;
  return u < 0 ? u + MOD : u;
}
function pow(base, n) {
  if (n === 0) return 1;
  let p = pow(base, Math.floor(n / 2));
  let res = mul(mod(p), mod(p));
  if (n % 2 === 1) res = mul(mod(res), base);
  return res;
}
function highestOneBit(i) {
  i |= i >> 1;
  i |= i >> 2;
  i |= i >> 4;
  i |= i >> 8;
  i |= i >> 16;
  return i - (i >>> 1);
}
function permutation(arr, len, store = "", permutations = []) {
  if (store.length === len) {
    permutations.push(store);
    return;
  }
  for (let i = 0; i < arr.length; i++) {
    const newArr = [...arr];
    const newChar = newArr.splice(i, 1);
    permutation(newArr, len, store.concat(newChar), permutations);
  }
  return permutations;
}

function main() {
  let t = +readLine();
  while (t--) {
    const len = +readLine();
    const arr = readLine().split(" ").map(Number);
    const map = new Map();

    for (let i = 0; i < len; i++) {
      const n = arr[i];
      if (map.get(n)) {
        map.get(n).count++;
      } else {
        map.set(n, { count: 1, index: i + 1 });
      }
    }
    let [minVal, min] = [Infinity, Infinity];
    for (let [key, obj] of map) {
      const { count, index } = obj;
      if (count === 1 && key < minVal) {
        minVal = key;
        min = index;
      }
    }
    if (min === Infinity) {
      console.log(-1);
    } else {
      console.log(min);
    }
  }
}

//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){
	var tmp = input.split(' ');
	for(var i = 0; i < tmp.length; i++){
		inLine.push(tmp[i]);
	}
});
read.on('close', function(){
	obj = init(inLine);
	console.error('\n↑入力 ↓出力');
	Main();
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextArray(size, code){
	var ret = new Array(size);
	for(var i = 0; i < size; i++){
		if(code == 'int'){
			ret[i] = nextInt();
		}else{
			ret[i] = next();
		}
	}
	return ret;
}
function nextIntArray(size){return nextArray(size, 'int');} function nextStrArray(size){return nextArray(size, 'str');}
function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();} function nextInt(){return myconv(next(),1);}
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 t = nextInt();
	var output = new Array(t);
	for(var i = 0; i < t; i++){
		var N = nextInt();
		var list = nextIntArray(N);
		var map = {};
		for(var j = 0; j < N; j++){
			if(map[list[j]] == null){
				map[list[j]] = [];
			}
			map[list[j]].push(j);
		}
		var key = Object.keys(map);
		key.sort(function(a,b){
			return a - b;
		});
		var ans = -1;
		for(var j = 0; j < key.length; j++){
			if(map[key[j]].length == 1){
				ans = map[key[j]][0] + 1;
				break;
			}
		}
		output[i] = ans;
	}
	myout(myconv(output, 9));
}

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let stdinInput = '';

process.stdin.on('data', input => {
  stdinInput += input;
})

process.stdin.on('end', () => {
  main(stdinInput);
})

function main(data) {
    data = data.split('\n');
    const testCases = data[0] * 2;
    let i = 1;
    while (i <= testCases) {
      const s = data[i + 1].trim().split(' ');
      // let a = data[i].trim() * 1;
      // const n = data[i] * 1;
      // const p = BigInt(s[0]);
      // const q = BigInt(s[1]);
      // s.sort((a, b) => b - a);
      let obj = {};
      // console.log(p%q)
      // let first = true;
      for (let j = 0; j < s.length; j += 1) {
        if (obj[s[j]]) obj[s[j]] = -1;
        else {
          obj[s[j]] = {};
          obj[s[j]]['count'] = 1;
          obj[s[j]]['index'] = j + 1;
        }
      }
      let idx = -1;
      for (let key in obj) {
        if (obj[key]['count'] > 0) {idx = obj[key]['index']; break;}
      }
      // let j = n;
      console.log(idx);
      i += 2;
    }
}

"use strict";

(() => {

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

    let curLine = 0, allLines = [];

    let nextLine = () => {
        if(curLine == allLines.length) throw new ReferenceError("No more input in the buffer");
        return allLines[curLine++]
    };

    readline.on("line", line => { allLines.push(line); });
    readline.on("close", () => { main(nextLine) });

})();

function main(nextLine) {
    let t = Number(nextLine());

    while(t--) {
        let n = Number(nextLine());
        let ara = nextLine().split(" ").map((x, index) => [Number(x), index+1]);

        ara.sort((a, b) => a[0]-b[0]);

        let mn = -1;
        for(let i = 0; i < n; i++) {
            if((i === 0 || ara[i][0] !== ara[i-1][0]) && (i === n-1 || ara[i][0] !== ara[i+1][0])) {
                mn = ara[i][1];
                break;
            }
        }

        console.log(mn);
    }
}

/* this language fucking sucks */

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

let lines = [];

rl.on('line', (data) => {
    lines.push(data);
    if(lines.length > 0 && 2 * parseInt(lines[0]) === lines.length - 1) {
	rl.close();
	main();
    }
});

async function main() {
    let t = parseInt(lines[0]);
    for(let i = 1; i <= 2 * t; i += 2) {
	let n = parseInt(lines[i]);
	const arr = lines[i + 1].split(' ').map(x => parseInt(x));

	let dict = {};
	for(const v of arr) {
	    if(!dict.hasOwnProperty(v)) {
		dict[v] = 1;
	    }
	    else {
		dict[v]++;
	    }
	}

	let num = -1;
	for(let j = 1; j <= n; j++) {
	    if(dict[j] === 1) {
		num = j;
		break;
	    }
	}

	let ok = false;
	for(let j = 0; j < n; j++) {
	    if(arr[j] === num) {
		console.log(j + 1);
		ok = true;
	    }
	}

	if(!ok) {
	    console.log(-1);
	}
    }
}

(()=>{"use strict";var t={675:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),Array.numbersMatrix=(t,e,r)=>{let n=[];null==t&&(e=t),null==r&&(r=0);for(let o=0;o<t;++o){let t=[];for(let n=0;n<e;++n)t.push(r);n.push(t)}return n},Array.prototype.sortAsc=function(){return this.sort(((t,e)=>t-e))},Array.prototype.sortDesc=function(){return this.sort(((t,e)=>e-t))},Array.prototype.max=function(){if(0==this.length)return 0;let t=this[0];for(let e=1;e<this.length;++e)t=Math.max(t,this[e]);return t},Array.prototype.min=function(){if(0==this.length)return 0;let t=this[0];for(let e=1;e<this.length;++e)t=Math.min(t,this[e]);return t},Array.prototype.sum=function(){let t=0;for(let e=0;e<this.length;++e)t+=this[e];return t},Array.prototype.modSum=function(t){let e=0;for(let r=0;r<this.length;++r)e+=this[r],e%=t;return e},Array.prototype.avg=function(){return this.sum()/this.length},Array.prototype.groupBy=function(t){let e=new Map;for(let r=0;r<this.length;++r){const n=t(this[r]);e.has(n)?e.get(n).push(this[r]):e.set(n,[this[r]])}return e},Array.prototype.deepCopy=function(){let t=[];if(0==this.length)return t;let e=!1;Array.isArray(this[0])&&(e=!0);for(let r=0;r<this.length;++r)e?t.push(this[r].deepCopy()):t.push(this[r]);return t},Array.prototype.transpose=function(){let t=[];if(0==this.length)return[[]];for(let e=0;e<this[0].length;++e){let r=[];for(let t=0;t<this.length;++t)r.push(this[t][e]);t.push(r)}return t},Array.prototype.toString=function(){if(0==this.length)return"";if(!Array.isArray(this[0]))return this.join(" ");let t="";for(let e=0;e<this.length;++e)t+=this[e].join(" "),e!=this.length-1&&(t+="\n");return t}},312:function(t,e,r){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=n(r(747));let s="",i=[],u=0,l="";const a="local"===process.argv[2],p=t=>{if(a){if(i=o.default.readFileSync("input.txt").toString().trim().split("\n").map((t=>t.trim())),t(),o.default.writeFileSync("output.txt",l),console.log(l),o.default.readFileSync("expected.txt").toString().trim()==l.trim()){const{exec:t}=r(129);t("osascript -e 'display notification \"✅ AC!!\"'")}}else process.stdin.resume(),process.stdin.setEncoding("utf-8"),process.stdin.on("data",(t=>{s+=t})),process.stdin.on("end",(e=>{i=s.trim().split("\n").map((t=>t.trim())),t(),console.log(l)}))};function f(){return i[u++]}function h(){return f().split(" ").map((t=>parseFloat(t)))}function c(){return f().split("")}e.default={runMain:p,runEachTest:t=>{p((()=>{let[e]=h();for(;e>0;)t(),e--}))},readline:f,nextNumbers:h,nextBigNumbers:function(){return f().split(" ").map((t=>BigInt(t)))},nextNumbersMatrix:function(t){let e=[];for(let r=0;r<t;++r)e.push(h());return e},nextCharacters:c,nextCharacterMatrix:function(t){let e=[];for(let r=0;r<t;++r)e.push(c());return e},nextIntervalArray:function(t){let e=[];for(let r=0;r<t;++r){const[t,r]=h();e.push({a:t,b:r})}return e},put:function(t){l+=t},puts:function(t){l+=t+"\n"},debug:function(t){a&&console.log(t)}}},965:function(t,e,r){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),r(675);const o=n(r(312));o.default.runEachTest((function(){let[t]=o.default.nextNumbers(),e=o.default.nextNumbers(),r={};for(let n=0;n<t;++n){let t=e[n];r[t]={val:null==r[t]?1:r[t].val+1,ndx:n}}e.sortAsc();for(let t of e)if(1==r[t].val)return void o.default.puts(r[t].ndx+1);o.default.puts(-1)}))},129:t=>{t.exports=require("child_process")},747:t=>{t.exports=require("fs")}},e={};!function r(n){if(e[n])return e[n].exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}(965)})();

// Solution written in typescript and compiled via webpack. Original source code below
// Happy Hacking 😜

// import './array'
//
// import io from './io'
//
// function main() {
//   let [n] = io.nextNumbers()
//   let a = io.nextNumbers()
//
//   let cnt: any = {}
//
//   for (let i = 0; i < n; ++i) {
//     let x = a[i]
//     cnt[x] = { val: cnt[x] == undefined ? 1 : cnt[x].val + 1, ndx: i }
//   }
//
//   // io.debug(cnt)
//
//   a.sortAsc()
//
//   for (let x of a) {
//     if (cnt[x].val == 1) {
//       io.puts(cnt[x].ndx + 1)
//       return
//     }
//   }
//
//   io.puts(-1)
// }
//
// io.runEachTest(main)
// // io.runMain(main)

(()=>{"use strict";var t={675:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),Array.numbersMatrix=(t,e,r)=>{let n=[];null==t&&(e=t),null==r&&(r=0);for(let o=0;o<t;++o){let t=[];for(let n=0;n<e;++n)t.push(r);n.push(t)}return n},Array.prototype.sortAsc=function(){return this.sort(((t,e)=>t-e))},Array.prototype.sortDesc=function(){return this.sort(((t,e)=>e-t))},Array.prototype.max=function(){if(0==this.length)return 0;let t=this[0];for(let e=1;e<this.length;++e)t=Math.max(t,this[e]);return t},Array.prototype.min=function(){if(0==this.length)return 0;let t=this[0];for(let e=1;e<this.length;++e)t=Math.min(t,this[e]);return t},Array.prototype.sum=function(){let t=0;for(let e=0;e<this.length;++e)t+=this[e];return t},Array.prototype.modSum=function(t){let e=0;for(let r=0;r<this.length;++r)e+=this[r],e%=t;return e},Array.prototype.avg=function(){return this.sum()/this.length},Array.prototype.groupBy=function(t){let e=new Map;for(let r=0;r<this.length;++r){const n=t(this[r]);e.has(n)?e.get(n).push(this[r]):e.set(n,[this[r]])}return e},Array.prototype.deepCopy=function(){let t=[];if(0==this.length)return t;let e=!1;Array.isArray(this[0])&&(e=!0);for(let r=0;r<this.length;++r)e?t.push(this[r].deepCopy()):t.push(this[r]);return t},Array.prototype.transpose=function(){let t=[];if(0==this.length)return[[]];for(let e=0;e<this[0].length;++e){let r=[];for(let t=0;t<this.length;++t)r.push(this[t][e]);t.push(r)}return t},Array.prototype.toString=function(){if(0==this.length)return"";if(!Array.isArray(this[0]))return this.join(" ");let t="";for(let e=0;e<this.length;++e)t+=this[e].join(" "),e!=this.length-1&&(t+="\n");return t}},312:function(t,e,r){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=n(r(747));let i="",s=[],u=0,l="";const a="local"===process.argv[2],p=t=>{if(a){if(s=o.default.readFileSync("input.txt").toString().trim().split("\n").map((t=>t.trim())),t(),o.default.writeFileSync("output.txt",l),console.log(l),o.default.readFileSync("expected.txt").toString().trim()==l.trim()){const{exec:t}=r(129);t("osascript -e 'display notification \"✅ AC!!\"'")}}else process.stdin.resume(),process.stdin.setEncoding("utf-8"),process.stdin.on("data",(t=>{i+=t})),process.stdin.on("end",(e=>{s=i.trim().split("\n").map((t=>t.trim())),t(),console.log(l)}))};function f(){return s[u++]}function h(){return f().split(" ").map((t=>parseFloat(t)))}function c(){return f().split("")}e.default={runMain:p,runEachTest:t=>{p((()=>{let[e]=h();for(;e>0;)t(),e--}))},readline:f,nextNumbers:h,nextBigNumbers:function(){return f().split(" ").map((t=>BigInt(t)))},nextNumbersMatrix:function(t){let e=[];for(let r=0;r<t;++r)e.push(h());return e},nextCharacters:c,nextCharacterMatrix:function(t){let e=[];for(let r=0;r<t;++r)e.push(c());return e},nextIntervalArray:function(t){let e=[];for(let r=0;r<t;++r){const[t,r]=h();e.push({a:t,b:r})}return e},put:function(t){l+=t},puts:function(t){l+=t+"\n"},debug:function(t){a&&console.log(t)}}},965:function(t,e,r){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),r(675);const o=n(r(312));o.default.runEachTest((function(){let[t]=o.default.nextNumbers(),e=o.default.nextNumbers(),r={};for(let n=0;n<t;++n){let t=e[n];r[t]={val:null==r[t]?1:r[t].val+1,ndx:n}}e.sort();for(let t of e)if(1==r[t].val)return void o.default.puts(r[t].ndx+1);o.default.puts(-1)}))},129:t=>{t.exports=require("child_process")},747:t=>{t.exports=require("fs")}},e={};!function r(n){if(e[n])return e[n].exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}(965)})();

// Solution written in typescript and compiled via webpack. Original source code below
// Happy Hacking 😜

// import './array'
//
// import io from './io'
//
// function main() {
//   let [n] = io.nextNumbers()
//   let a = io.nextNumbers()
//
//   let cnt: any = {}
//
//   for (let i = 0; i < n; ++i) {
//     let x = a[i]
//     cnt[x] = { val: cnt[x] == undefined ? 1 : cnt[x].val + 1, ndx: i }
//   }
//
//   // io.debug(cnt)
//
//   a.sort()
//
//   for (let x of a) {
//     if (cnt[x].val == 1) {
//       io.puts(cnt[x].ndx + 1)
//       return
//     }
//   }
//
//   io.puts(-1)
// }
//
// io.runEachTest(main)
// // io.runMain(main)

var t = +readline();

for (var i = 0; i < t; i++) {
  var l = +readline();
  var arr = readline().split(' ').map(i => +i);
  var tmp = {};
  var idx;

  arr.forEach(item => {
    if (tmp[item] === undefined) {
      tmp[item] = 0;
    }
    tmp[item]++;
  });

  for (var k in tmp) {
    idx = arr.indexOf(tmp[k]) + 1;
    break;
  }

  print(idx || -1);
}


'use strict'

const k = parseInt(readline().split(' ')[1]);

const res = readline().split(' ').reduce((r, i) => {
    if (r.indexOf(i) === -1) {
        if (r.length === k) r.pop();
        r.unshift(i);
    }
    return r;
}, []);

write(res.length + '\n' + res.join(' '));

process.stdin.resume()
process.stdin.setEncoding('utf-8')

var arr = ''
process.stdin.on('data', (i) => {
  arr += i
})

process.stdin.on('end', () => {
  arr = arr.split('\n')
  const l1 = arr.shift().split(' ')
  const n = parseInt(l1[0])
  const k = parseInt(l1[1])
  const messages = arr.shift().split(' ')
  messages[messages.length - 1] = parseInt(messages[messages.length - 1])

  let map = {}
  let current = 0, left = 1, right = 0
  let reverseMap = {}

  for(let i = 0; i < n; i++) {
    const m = messages[i]
    if(!map[m]){
      if(current == k){
        delete map[reverseMap[left]]
        reverseMap[left ++] = null
      }
      else{
        current ++
      }
      map[m] = ++ right
      reverseMap[right] = m
      // console.log(m, map, reverseMap, left, right, current)
    }
  }
  // if(k == 3) console.log(map, reverseMap)

  console.log(current)

  for(let i = right; i >= left; i --){
    process.stdout.write(reverseMap[i] + ' ')
  }
  console.log()

})

var readline = require('readline');
var rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});
var STATE = 1;
var n, k, params, ids, item;
rl.on('line', function (input) {
  switch (STATE) {
    case 1:
      params = input.split(' ');
      n = parseInt(params[0], 10);
      k = parseInt(params[1], 10);
      STATE = 2;
      break;
    case 2:
      params = input.split(' ');
      ids = new Array()
      for (var i = 0; i < n; i++) {
        item = params[i];
        if (!ids.includes(item)) {
          ids.push(item)
        }
        if (ids.length > k) {
          ids.shift()
        }
      }
      console.log(ids.length);
      console.log(ids.reverse().join(' '));
      STATE = 1;
      break;
    default:
      // code
  }
}).on('close', function() {
  process.exit(0);
});

process.stdin.resume()
process.stdin.setEncoding('utf-8')

var arr = ''
process.stdin.on('data', (i) => {
  arr += i
})

process.stdin.on('end', () => {
  arr = arr.split('\n')
  const l1 = arr.shift().split(' ')
  const n = parseInt(l1[0])
  const k = parseInt(l1[1])
  const messages = arr.shift().split(' ')
  messages[messages.length - 1] = parseInt(messages[messages.length - 1])

  let map = {}
  let current = 0
  let q = []

  for(let i = 0; i < n; i++) {
    const m = messages[i]
    if(!map[m]){
      q.unshift(m)
      if(current == k) map[q.pop()] = false
      else{
        current ++
      }
      map[m] = true
    }
  }
  // if(k == 4) console.log(map, q)

  console.log(q.length)
  for(let i = 0, len = q.length; i < len; i++) {
    process.stdout.write(q[i] + ' ')
  }
  console.log()

})

let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL);

    function foo (data, k) {
        let result = data.reduce((acc, value) => {
            if (~acc.indexOf(value)) return acc;
            else if (acc.length < k) {
                acc.unshift(value)
            } else {
                acc.pop();
                acc.unshift(value);
            }
            return acc;
        }, [])

        return result;

    }

    let k = lines[0].split(" ").map(Number)[1];
    let data = lines[1].split(" ").map(Number);

    let result = foo(data, k);
    let answer = '';
    answer += result.length + "\n";
    answer += result.join(" ")
    console.log(answer);
})

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

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

function main() {
    const firstLine = readline().split(" ");
    const n = parseInt(firstLine[0]);
    const k = parseInt(firstLine[1]);
    const ids = readline().split(" ").map((value,index,array)=>{return parseInt(value)});

    let screen = [];
    for(let i = 0;i<n;i++){
        if(screen.indexOf(ids[i]) != -1){
            continue;
        }
        if(screen.length == k){
            screen.pop();
        }
        screen.unshift(ids[i]);
    }
    console.log(screen.length);
    let output = "";
    screen.forEach((element)=>{output += element +" ";});
    console.log(output);
}

'use strict'

const k = parseInt(readline().split(' ')[1]);
const d = {};
let r = [];

readline().split(' ').forEach((i) => {
    if (d[i]) return;
    if (r.length >= k) d[r[r.length - k]] = undefined;
    r.push(i);
    d[i] = true;
});
r = r.slice(-k);
write(r.length + '\n' + r.reverse().join(' '));

var stats = readline().split(' ').map(function (num) {
  return parseInt(num);
})

var messages = readline().split(' ').map(function (num) {
  return parseInt(num);
})
// var stats = [1, 2];
// var messages = [1, 2, 3, 2, 1, 3, 2];

var currIds = [];
var dict = {}

for (var i = 0; i < messages.length; i++) {
  if (dict[(messages[i]) + ''])
    continue;
  else if (currIds.length === stats[1]) {
    var toPop = currIds[0];
    dict[toPop + ''] = undefined;
    dict[messages[i]] = 'exist';
    currIds.push(messages[i]);
    currIds.shift();
  } else {
    dict[messages[i]] = 'exist';
    currIds.push(messages[i]);
  }
}

currIds.reverse();
write(currIds.length + '\n')
write(currIds.join(' '))

var stats = readline().split(' ').map(function (num) {
  return parseInt(num);
})

var messages = readline().split(' ').map(function (num) {
  return parseInt(num);
})
// var stats = [1, 2];
// var messages = [1, 2, 3, 2, 1, 3, 2];

var currIds = [];

for (var i = 0; i < messages.length; i++) {
  if (currIds.includes(messages[i]))
    continue;
  else if (currIds.length === stats[1]) {
    currIds.push(messages[i]);
    currIds.shift()
  } else {
    currIds.push(messages[i]);
  }
}

currIds.reverse();
write(currIds.length + '\n')
write(currIds.join(' '))

'use strict'

const k = parseInt(readline().split(' ')[1]);

const res = readline().split(' ').reduce((r, i) => {
    if (r.slice(-k).indexOf(i) === -1) r.push(i);
    return r;
}, []).slice(-k);

write(res.length + '\n' + res.join(' '));

'use strict'

const k = parseInt(readline().split(' ')[1]);

const res = readline().split(' ').reduce((r, i) => {
    if (r.indexOf(i) === -1) {
        if (r.length === k) r.pop();
        r.unshift(i);
    }
    return r;
}, []);

write(res.length + '\n' + res.reverse().join(' '));

process.stdin.resume()
process.stdin.setEncoding('utf-8')

var arr = ''
process.stdin.on('data', (i) => {
  arr += i
})

process.stdin.on('end', () => {
  arr = arr.split('\n')
  const l1 = arr.shift().split(' ')
  const n = parseInt(l1[0])
  const k = parseInt(l1[1])
  const messages = arr[0].split(' ')

  let map = {}
  let current = 0
  let q = []

  for(let i = 0; i < n; i++) {
    const m = messages[i]
    if(!map[m]){
      q.unshift(m)
      if(current == k) map[q.pop()] = false
      else{
        current ++
      }
      // console.log(map, q)
      map[m] = true
    }
  }

  console.log(q.length)
  for(let i = 0, len = q.length; i < len; i++) {
    process.stdout.write(q[i] + ' ')
  }
  console.log()

})

process.stdin.resume()
process.stdin.setEncoding('utf-8')

var arr = ''
process.stdin.on('data', (i) => {
  arr += i
})

process.stdin.on('end', () => {
  arr = arr.split('\n')
  const l1 = arr.shift().split(' ')
  const n = parseInt(l1[0])
  const k = parseInt(l1[1])
  const messages = arr[0].split(' ')

  let map = {}
  let current = 0
  let q = []

  for(let i = 0; i < n; i++) {
    const m = messages[i]
    if(!map[m]){
      q.unshift(m)
      if(current == k) map[q.pop()] = false
      else{
        current ++
      }
      // console.log(map, q)
      map[m] = true
    }
  }

  for(let i = 0, len = q.length; i < len; i++) {
    process.stdout.write(q[i] + ' ')
  }
  console.log()

})

process.stdin.resume()
process.stdin.setEncoding('utf-8')

var arr = ''
process.stdin.on('data', (i) => {
  arr += i
})

process.stdin.on('end', () => {
  arr = arr.split('\n')
  const l1 = arr.shift().split(' ')
  const n = parseInt(l1[0])
  const k = parseInt(l1[1])
  const messages = arr.shift().split(' ')

  let map = {}
  let current = 0
  let q = []

  for(let i = 0; i < n; i++) {
    const m = messages[i]
    if(!map[m]){
      q.unshift(m)
      if(current == k) map[q.pop()] = false
      else{
        current ++
      }
      map[m] = true
    }
  }
  if(k == 4) console.log(map, q)

  console.log(q.length)
  for(let i = 0, len = q.length; i < len; i++) {
    process.stdout.write(q[i] + ' ')
  }
  console.log()

})

process.stdin.resume()
process.stdin.setEncoding('utf-8')

var arr = ''
process.stdin.on('data', (i) => {
  arr += i
})

process.stdin.on('end', () => {
  arr = arr.split('\n')
  const l1 = arr.shift().split(' ')
  const n = parseInt(l1[0])
  const k = parseInt(l1[1])
  const messages = arr[0].split(' ')

  let map = {}
  let current = 0
  let q = []

  for(let i = 0; i < n; i++) {
    const m = messages[i]
    if(!map[m]){
      q.unshift(m)
      if(current == k) map[q.pop()] = false
      else{
        current ++
      }
      map[m] = true
    }
  }
  if(k == 4) console.log(map, q)

  console.log(q.length)
  for(let i = 0, len = q.length; i < len; i++) {
    process.stdout.write(q[i] + ' ')
  }
  console.log()

})

let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL);

    function foo (data, k) {
        let result = data.reduce((acc, value) => {
            if (~acc.indexOf(value)) return acc;
            else if (acc.length < k) {
                acc.unshift(value)
            } else {
                acc.pop();
                acc.unshift(value);
            }
            return acc;
        }, []);
        return result;
    }

    let k = lines[0].split(" ").map(Number)[1];
    let data = lines[1].split(" ").map(Number);

    let result = foo(data, k);
    console.log(result);
})

let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL);

    function foo (data, k) {
        let result = data.reduce((acc, value) => {
            if (~acc.indexOf(value)) return acc;
            else if (acc.length < k) {
                acc.unshift(value)
            } else {
                acc.pop();
                acc.unshift(value);
            }
            return acc;
        }, [])

        return result.join(" ");

    }

    let k = lines[0].split(" ").map(Number)[1];
    let data = lines[1].split(" ").map(Number);

    let result = foo(data, k);
    console.log(result);
})


var n = readline();

var arr = [];

for( var i=1; i<=n; i++ ) {
    arr.push(readline().split(' ').map(Number))
}

var prev = Math.min( arr[n-1][0], arr[n-1][1]);

var flg = true;

for( var i=n-2; i>=0; i-- ) {
    //print(arr[i][0]+ " " + arr[i][1]);
    var mn1 = Math.min( arr[i][0], arr[i][1] );
    var mn2;

    if( mn1 == arr[i][0] ) mn2 = arr[i][1];
    else mn2 = arr[i][0];

    if( prev <= mn1 ) {
        prev = mn1;
    } else if( prev <= mn2 ) {
        prev = mn2;
    } else {
        flg = false;
    }

}

if( flg ) {
    print('YES');
} else {
    print('NO');
}

function main() {
  const is = new Scanner();
  const n = is.nextLine();
  const rectangles = new Array(n);
  for (let i = 0; i < n; i += 1) {
    rectangles[i] = is.nextArray().map(Number);
  }

  const sequence = [Math.max(rectangles[0][0], rectangles[0][1])];
  let answer = true;
  for (let i = 1; i < n; i += 1) {

    if (rectangles[i][0] > rectangles[i][1]) {
      if (rectangles[i][0] > sequence[i - 1])
        sequence.push(rectangles[i][1]);
      else
        sequence.push(rectangles[i][0]);
    } else {
      if (rectangles[i][1] > sequence[i - 1])
        sequence.push(rectangles[i][0]);
      else
        sequence.push(rectangles[i][1]);
    }

    if (sequence[i] > sequence[i - 1])
      answer = false;
  }

  console.log(answer ? 'YES' : 'NO');

}

/*
 *  api stdin
 */

class Scanner {
  constructor() {
    this.index = 0;
    this.lines = stdinInput.trim().split('\n');
  }

  nextLine() {
    return this.lines[this.index++];
  }

  nextInt() {
    return parseInt(this.nextLine(), 10);
  }

  nextDouble() {
    return parseFloat(this.nextLine());
  }

  nextArray() {
    return this.nextLine().split(' ');
  }

  hasNext() {
    return this.index < this.lines.length;
  }
}

let stdinInput = '';
process.stdin.resume();
process.stdin.setEncoding('utf-8');
process.stdin.on('data', input => { stdinInput += input; });
process.stdin.on('end', () => { main(); });


'use strict';

var fs = require('fs');

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

var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);

function _defineProperty(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, {
      value: value,
      enumerable: true,
      configurable: true,
      writable: true
    });
  } else {
    obj[key] = value;
  }

  return obj;
}

function solve(read) {
  const [rn, rb, rns, re, rbs] = convertInput(read);
  const n = rn(),
        a = rns();
  const queue = new Heap((a, b) => a[1] !== b[1] ? b[1] - a[1] : b[0] - a[0]);
  for (let i = n - 1; i > 0; i--) {
    if (a[i] < a[i - 1]) queue.push([i + 1, a[i - 1] - a[i]]);
  }
  const res = [];
  for (let i = n - 1; i >= 0; i--) {
    if (queue.size()) {
      const cur = queue.pop();
      res[i] = cur[0];
      if (cur[1] > i + 1) {
        cur[1] -= i + 1;
        queue.push(cur);
      }
    } else {
      res[i] = 1;
    }
  }
  return res.join(' ');
}
class Heap {
  constructor(_comparator = (a, b) => a - b, arr) {
    _defineProperty(this, "_heap", []);
    this._comparator = _comparator;
    if (arr) {
      this._heap = [...arr];
      for (let i = arr.length >> 1; i; i--) this.down(i);
    }
  }
  swap(i, j) {
    [this._heap[i], this._heap[j]] = [this._heap[j], this._heap[i]];
  }
  _has(i) {
    return Object.prototype.hasOwnProperty.call(this._heap, i);
  }
  comparator(i, j) {
    return this._comparator(this._heap[i], this._heap[j]) < 0;
  }
  parent(i) {
    return i - 1 >> 1;
  }
  children(i) {
    return [2 * i + 1, 2 * i + 2];
  }
  up(i) {
    let parent = this.parent(i);
    while (i > 0 && this.comparator(i, parent)) {
      this.swap(i, parent);
      [i, parent] = [parent, parent - 1 >> 1];
    }
  }
  down(i) {
    let [left, right] = this.children(i);
    while (left < this._heap.length) {
      if (!this._has(right)) right = left;
      if (this.comparator(right, left)) [left, right] = [right, left];
      if (this.comparator(i, left)) break;
      this.swap(i, left);
      i = left;
      [left, right] = [2 * i + 1, 2 * i + 2];
    }
  }
  push(node) {
    this._heap.push(node);
    this.up(this._heap.length - 1);
  }
  pop() {
    if (this.size() === 0) return null;
    let res = this._heap[0];
    this.swap(0, this._heap.length - 1);
    this._heap.pop();
    this.down(0);
    return res;
  }
  remove(i) {
    if (i >= this.size()) return;
    let res = this._heap[i];
    this.swap(i, this._heap.length - 1);
    this._heap.pop();
    this.down(i);
    this.up(i);
    return res;
  }
  modify(i, val) {
    if (i >= this.size()) return;
    let res = this._heap[i];
    this._heap[i] = val;
    this.down(i);
    this.up(i);
    return res;
  }
  top() {
    if (this.size() === 0) return null;
    return this._heap[0];
  }
  size() {
    return this._heap.length;
  }
}
function convertInput(read) {
  const rn = () => Number(read());
  const rb = () => BigInt(read());
  const rns = () => read().split(/\s+/).map(Number);
  const re = () => read().split(/\s+/).map(s => Number(s) - 1);
  const rbs = () => read().split(/\s+/).map(BigInt);
  return [rn, rb, rns, re, rbs];
}
function main(r) {
  try {
    let t = Number(r());
    let res = new Array(t);
    let limit = 0;
    for (let i = 0; i < t; i++) {
      var _solve;
      const s = (_solve = solve(r)) !== null && _solve !== void 0 ? _solve : '';
      if (t < limit) {
        process.stdout.write(s.toString());
        process.stdout.write('\n');
      } else {
        res[i] = s;
      }
    }
    if (t >= limit) {
      return res.join('\n');
    } else {
      return '';
    }
  } catch (error) {
    console.log(error);
  }
}

const inputs = fs__default["default"].readFileSync(0, 'utf-8').split(/\r?\n/);
void function () {
  const read = ((i = 0) => () => inputs[i++])();
  const output = main(read);
  process.stdout.write(output);
}();

function solve() {
    var n = Number(read());
    var a = readArray(Number);
    var ans = [];
    var nextFree = [];
    for (var i = 1; i < n; i++) {
        if (a[i] > a[i - 1]) {
            continue;
        }
        var diff = a[i - 1] - a[i];
        var start = diff;
        while(ans[diff]) {
            diff = nextFree[diff] || (diff + 1);
        }
        nextFree[start] = diff + 1;
        ans[diff] = i + 1;
    }
    for (i = 0; i < n; i++) {
        ans[i] = ans[i + 1] || 1;
    }
    write(ans.slice(0, n).join(' '));
}

function start() {
    var T = 1;
    T = Number(read());
    for (var t = 0; t < T; t++) {
        solve();
    }
    writeAns();
}

var MEMORY;
var MEMORY_INDEX = 0;
var ANS = '';

try {
    initInput(start);
} catch (e) {
    console.log(e);
}
function readArray(f) {
    return read().split(' ').map(f);
}

function sortNumbers(a, b) {
    return a - b;
}
function sortNumbersDec(a, b) {
    return b - a;
}
var ANS;
// вывод через ANS быстрее, но ест кучу памяти.
// К тому же, максимальная длина строки - 2097151.
function write(value) {
    // console.log(value);
    ANS += value + '\n';
}
function writeAns() {
    if (ANS) {
        console.log(ANS);
    }
}
function read() {
    return MEMORY[MEMORY_INDEX++];
}
function initInput(callback) {
    var fs = require('fs');
    var isLocalStart = process.argv[2] === 'lorelvate';
    if (!isLocalStart) {
        MEMORY = fs.readFileSync(0, 'utf-8').split('\r\n');
        callback();
        return;
    }
    var path = require('path');
    fs.readFile(path.join(__dirname, 'input.txt'), 'utf8', (err, data) => {
        if (err) {
            write(err);
            return;
        }
        MEMORY = data.split('\r\n');
        callback();
    });
}

"use strict";
const fs = require("fs");
//let filename = "0.txt";
let filename = 0;
const input = fs.readFileSync(filename, "utf8").trim().split("\n");
let line = 0;
function readline() {
  return input[line++];
}
function iInpArr() {
  return readline()
    .trim()
    .split(" ")
    .map((cur) => parseInt(cur));
}
function BInpArr() {
  return readline()
    .trim()
    .split(" ")
    .map((cur) => BigInt(cur));
}
function string() {
  return readline().trim();
}
function stringArr() {
  return readline().trim().split("");
}

function stringArr1() {
  return readline().trim().split(" ");
}
function getValue() {
  return parseInt(readline());
}
function iInpArr1() {
  return readline()
    .trim()
    .split("")
    .map((cur) => parseInt(cur));
}
let mod = 1e9 + 7;
mod = BigInt(mod);
const pow = (num, exp, mod) => {
  if (exp === BigInt(0)) return BigInt(1);
  let x = pow(num, exp / BigInt(2), mod);
  if (exp % BigInt(2)) return (((x * x) % mod) * num) % mod;
  else return (x * x) % mod;
};
const inverse = (num, exp) => {
  return pow(BigInt(num), BigInt(exp), BigInt(mod));
};
const sqrt = (n) => {
  let low = 1n,
    high = n,
    ans;
  while (low <= high) {
    let mid = (low + high) / 2n;
    if (mid * mid <= n) {
      ans = mid;
      low = mid + 1n;
    } else high = mid - 1n;
  }
  return ans;
};

const solve = () => {
  let t = getValue();
  while (t--) {
    let n = getValue();
    let arr = iInpArr();
    for (let i = 0; i < n; i++) arr[i] = [arr[i], i + 1];
    arr.sort((a, b) => a[0] - b[0]);
    let ans = new Array(n).fill(0);
    for (let i = 0; i < n; i++) {
      ans[n - i - 1] = arr[i][1];
    }
    console.log(ans.join(" "));
  }
};
solve();

"use strict";
const fs = require("fs");
//let filename = "0.txt";
let filename = 0;
const input = fs.readFileSync(filename, "utf8").trim().split("\n");
let line = 0;
function readline() {
  return input[line++];
}
function iInpArr() {
  return readline()
    .trim()
    .split(" ")
    .map((cur) => parseInt(cur));
}
function BInpArr() {
  return readline()
    .trim()
    .split(" ")
    .map((cur) => BigInt(cur));
}
function string() {
  return readline().trim();
}
function stringArr() {
  return readline().trim().split("");
}

function stringArr1() {
  return readline().trim().split(" ");
}
function getValue() {
  return parseInt(readline());
}
function iInpArr1() {
  return readline()
    .trim()
    .split("")
    .map((cur) => parseInt(cur));
}
let mod = 1e9 + 7;
mod = BigInt(mod);
const pow = (num, exp, mod) => {
  if (exp === BigInt(0)) return BigInt(1);
  let x = pow(num, exp / BigInt(2), mod);
  if (exp % BigInt(2)) return (((x * x) % mod) * num) % mod;
  else return (x * x) % mod;
};
const inverse = (num, exp) => {
  return pow(BigInt(num), BigInt(exp), BigInt(mod));
};
const sqrt = (n) => {
  let low = 1n,
    high = n,
    ans;
  while (low <= high) {
    let mid = (low + high) / 2n;
    if (mid * mid <= n) {
      ans = mid;
      low = mid + 1n;
    } else high = mid - 1n;
  }
  return ans;
};

const solve = () => {
  let t = getValue();
  while (t--) {
    let n = getValue();
    let arr = iInpArr();
    let ans = new Array(n).fill(1);
    let maxArr = [];
    maxArr.push(arr[0]);
    for (let i = 1; i < n; i++)
      maxArr.push(Math.max(maxArr[maxArr.length - 1], arr[i]));
    for (let i = n - 2; i >= 0; i--) {
      if (maxArr[i] > arr[i + 1]) {
        ans[maxArr[i] - arr[i + 1]] = i + 2;
      }
    }
    console.log(ans.join(" "));
  }
};
solve();

"use strict";
const fs = require("fs");
//let filename = "0.txt";
let filename = 0;
const input = fs.readFileSync(filename, "utf8").trim().split("\n");
let line = 0;
function readline() {
  return input[line++];
}
function iInpArr() {
  return readline()
    .trim()
    .split(" ")
    .map((cur) => parseInt(cur));
}
function BInpArr() {
  return readline()
    .trim()
    .split(" ")
    .map((cur) => BigInt(cur));
}
function string() {
  return readline().trim();
}
function stringArr() {
  return readline().trim().split("");
}

function stringArr1() {
  return readline().trim().split(" ");
}
function getValue() {
  return parseInt(readline());
}
function iInpArr1() {
  return readline()
    .trim()
    .split("")
    .map((cur) => parseInt(cur));
}
let mod = 1e9 + 7;
mod = BigInt(mod);
const pow = (num, exp, mod) => {
  if (exp === BigInt(0)) return BigInt(1);
  let x = pow(num, exp / BigInt(2), mod);
  if (exp % BigInt(2)) return (((x * x) % mod) * num) % mod;
  else return (x * x) % mod;
};
const inverse = (num, exp) => {
  return pow(BigInt(num), BigInt(exp), BigInt(mod));
};
const sqrt = (n) => {
  let low = 1n,
    high = n,
    ans;
  while (low <= high) {
    let mid = (low + high) / 2n;
    if (mid * mid <= n) {
      ans = mid;
      low = mid + 1n;
    } else high = mid - 1n;
  }
  return ans;
};

const solve = () => {
  let t = getValue();
  while (t--) {
    let n = getValue();
    let arr = iInpArr();
    let ans = new Array(n).fill(1);
    let maxArr = [];
    maxArr.push(arr[0]);
    for (let i = 1; i < n; i++)
      maxArr.push(Math.max(maxArr[maxArr.length - 1], arr[i]));
    for (let i = n - 2; i >= 0; i--) {
      if (arr[i] > arr[i + 1]) {
        ans[maxArr[i] - arr[i + 1]] = i + 2;
      }
    }
    console.log(ans.join(" "));
  }
};
solve();

"use strict";
const fs = require("fs");
//let filename = "0.txt";
let filename = 0;
const input = fs.readFileSync(filename, "utf8").trim().split("\n");
let line = 0;
function readline() {
  return input[line++];
}
function iInpArr() {
  return readline()
    .trim()
    .split(" ")
    .map((cur) => parseInt(cur));
}
function BInpArr() {
  return readline()
    .trim()
    .split(" ")
    .map((cur) => BigInt(cur));
}
function string() {
  return readline().trim();
}
function stringArr() {
  return readline().trim().split("");
}

function stringArr1() {
  return readline().trim().split(" ");
}
function getValue() {
  return parseInt(readline());
}
function iInpArr1() {
  return readline()
    .trim()
    .split("")
    .map((cur) => parseInt(cur));
}
let mod = 1e9 + 7;
mod = BigInt(mod);
const pow = (num, exp, mod) => {
  if (exp === BigInt(0)) return BigInt(1);
  let x = pow(num, exp / BigInt(2), mod);
  if (exp % BigInt(2)) return (((x * x) % mod) * num) % mod;
  else return (x * x) % mod;
};
const inverse = (num, exp) => {
  return pow(BigInt(num), BigInt(exp), BigInt(mod));
};
const sqrt = (n) => {
  let low = 1n,
    high = n,
    ans;
  while (low <= high) {
    let mid = (low + high) / 2n;
    if (mid * mid <= n) {
      ans = mid;
      low = mid + 1n;
    } else high = mid - 1n;
  }
  return ans;
};

const solve = () => {
  let t = getValue();
  while (t--) {
    let n = getValue();
    let arr = iInpArr();
    let ans = new Array(n).fill(1);
    for (let i = n - 2; i >= 0; i--) {
      if (arr[i] > arr[i + 1]) {
        ans[arr[i] - arr[i + 1]] = i + 2;
      }
    }
    console.log(ans.join(" "));
  }
};
solve();

'use strict';

var fs = require('fs');

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

var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);

function solve(read) {
  const [rn, rb, rns, re, rbs] = convertInput(read);
  const n = rn(),
        a = rns();
  let res = [];
  for (let i = n - 1; i > 0; i--) {
    if (a[i] < a[i - 1]) {
      for (let j = 0; j < a[i - 1] - a[i] && res.length < n; j++) {
        res.push(i + 1);
      }
    }
  }
  for (let i = res.length; i < n; i++) res[i] = 1;
  return res.join(' ');
}
function convertInput(read) {
  const rn = () => Number(read());
  const rb = () => BigInt(read());
  const rns = () => read().split(/\s+/).map(Number);
  const re = () => read().split(/\s+/).map(s => Number(s) - 1);
  const rbs = () => read().split(/\s+/).map(BigInt);
  return [rn, rb, rns, re, rbs];
}
function main(r) {
  try {
    let t = Number(r());
    let res = new Array(t);
    let limit = 0;
    for (let i = 0; i < t; i++) {
      var _solve;
      const s = (_solve = solve(r)) !== null && _solve !== void 0 ? _solve : '';
      if (t < limit) {
        process.stdout.write(s.toString());
        process.stdout.write('\n');
      } else {
        res[i] = s;
      }
    }
    if (t >= limit) {
      return res.join('\n');
    } else {
      return '';
    }
  } catch (error) {
    console.log(error);
  }
}

const inputs = fs__default["default"].readFileSync(0, 'utf-8').split(/\r?\n/);
void function () {
  const read = ((i = 0) => () => inputs[i++])();
  const output = main(read);
  process.stdout.write(output);
}();

'use strict';

var fs = require('fs');

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

var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);

function solve(read) {
  const [rn, rb, rns, re, rbs] = convertInput(read);
  const n = rn(),
        a = rns();
  let res = [];
  for (let i = n - 1; i > 0; i--) {
    if (a[i] < a[i - 1]) res.push([i + 1, a[i - 1] - a[i]]);
  }
  res.sort((a, b) => b[1] - a[1]);
  const ans = [];
  for (let i = 0; i < n; i++) {
    while (res.length && res[res.length - 1][1] === 0) res.pop();
    if (res.length) {
      ans[i] = res[res.length - 1][0];
      res[res.length - 1][1]--;
    } else {
      ans[i] = 1;
    }
  }
  return ans.join(' ');
}
function convertInput(read) {
  const rn = () => Number(read());
  const rb = () => BigInt(read());
  const rns = () => read().split(/\s+/).map(Number);
  const re = () => read().split(/\s+/).map(s => Number(s) - 1);
  const rbs = () => read().split(/\s+/).map(BigInt);
  return [rn, rb, rns, re, rbs];
}
function main(r) {
  try {
    let t = Number(r());
    let res = new Array(t);
    let limit = 0;
    for (let i = 0; i < t; i++) {
      var _solve;
      const s = (_solve = solve(r)) !== null && _solve !== void 0 ? _solve : '';
      if (t < limit) {
        process.stdout.write(s.toString());
        process.stdout.write('\n');
      } else {
        res[i] = s;
      }
    }
    if (t >= limit) {
      return res.join('\n');
    } else {
      return '';
    }
  } catch (error) {
    console.log(error);
  }
}

const inputs = fs__default["default"].readFileSync(0, 'utf-8').split(/\r?\n/);
void function () {
  const read = ((i = 0) => () => inputs[i++])();
  const output = main(read);
  process.stdout.write(output);
}();

'use strict';

var fs = require('fs');

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

var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);

function solve(read) {
  const [rn, rb, rns, re, rbs] = convertInput(read);
  const n = rn(),
        a = rns();
  let res = [1];
  for (let i = n - 1; i > 0; i--) {
    if (a[i] < a[i - 1]) {
      for (let j = 0; j < a[i - 1] - a[i]; j++) {
        res.push(i + 1);
      }
    }
  }
  return res.join(' ');
}
function convertInput(read) {
  const rn = () => Number(read());
  const rb = () => BigInt(read());
  const rns = () => read().split(/\s+/).map(Number);
  const re = () => read().split(/\s+/).map(s => Number(s) - 1);
  const rbs = () => read().split(/\s+/).map(BigInt);
  return [rn, rb, rns, re, rbs];
}
function main(r) {
  try {
    let t = Number(r());
    let res = new Array(t);
    let limit = 0;
    for (let i = 0; i < t; i++) {
      var _solve;
      const s = (_solve = solve(r)) !== null && _solve !== void 0 ? _solve : '';
      if (t < limit) {
        process.stdout.write(s.toString());
        process.stdout.write('\n');
      } else {
        res[i] = s;
      }
    }
    if (t >= limit) {
      return res.join('\n');
    } else {
      return '';
    }
  } catch (error) {
    console.log(error);
  }
}

const inputs = fs__default["default"].readFileSync(0, 'utf-8').split(/\r?\n/);
void function () {
  const read = ((i = 0) => () => inputs[i++])();
  const output = main(read);
  process.stdout.write(output);
}();