There is a sheet of paper that can be represented with a grid of size $$$n \times m$$$: $$$n$$$ rows and $$$m$$$ columns of cells. All cells are colored in white initially.$$$q$$$ operations have been applied to the sheet. The $$$i$$$-th of them can be described as follows:   $$$x_i$$$ $$$y_i$$$ — choose one of $$$k$$$ non-white colors and color the entire row $$$x_i$$$ and the entire column $$$y_i$$$ in it. The new color is applied to each cell, regardless of whether the cell was colored before the operation. The sheet after applying all $$$q$$$ operations is called a coloring. Two colorings are different if there exists at least one cell that is colored in different colors.How many different colorings are there? Print the number modulo $$$998\,244\,353$$$.

The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of the testcase contains four integers $$$n, m, k$$$ and $$$q$$$ ($$$1 \le n, m, k, q \le 2 \cdot 10^5$$$) — the size of the sheet, the number of non-white colors and the number of operations. The $$$i$$$-th of the following $$$q$$$ lines contains a description of the $$$i$$$-th operation — two integers $$$x_i$$$ and $$$y_i$$$ ($$$1 \le x_i \le n$$$; $$$1 \le y_i \le m$$$) — the row and the column the operation is applied to. The sum of $$$q$$$ over all testcases doesn't exceed $$$2 \cdot 10^5$$$.

For each testcase, print a single integer — the number of different colorings modulo $$$998\,244\,353$$$.

'use strict';

function solve(a, b) {
  let [n, m, k, q] = a;
  let visr = new Set(),
      visc = new Set(),
      res = 1,
      vx = new Set(),
      vy = new Set(),
      sx = 0,
      sy = 0;
  for (let i = q - 1; i >= 0; i--) {
    let [x, y] = b[i];
    x--, y--;
    if (!visr.has(x) && sx < m || !visc.has(y) && sy < n) {
      res = mul(res, k);
    }
    if (sx === m && sy === n) break;
    if (!visr.has(x)) visr.add(x);
    if (!visc.has(y)) visc.add(y);
    if (!vx.has(y)) {
      vx.add(y);
      sx++;
    }
    if (!vy.has(x)) {
      vy.add(x);
      sy++;
    }
  }
  return res;
}
const MOD = 998244353;
function mul(...args) {
  if (args.length === 0) throw new Error('参数不能为空');
  if (args.length === 1) return args[0];
  const [a, b] = args;
  if (args.length > 2) return mul(mul(a, b), ...args.slice(2));
  return ((a >> 16) * b % MOD * 65536 + (a & 65535) * b) % MOD;
}

async function main(read) {
  try {
    let t = Number(await read());
    let res = new Array(t);
    for (let i = 0; i < t; i++) {
      const a = (await read()).split(' ').map(Number);
      const b = [];
      let tmp = a[3];
      while (tmp--) {
        b.push((await read()).split(' ').map(Number));
      }
      res[i] = solve(a, b);
    }
    return res.join('\n');
  } catch (error) {
    console.log(error);
  }
}

let inputs,
    str = '';
function read() {
  return inputs.next().value.trim();
}
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', input => str += input);
process.stdin.on('end', async () => {
  inputs = str.split('\n').values();
  const output = await main(read);
  process.stdout.write(output);
});

'use strict';

function solve(a, b) {
  let [n, m, k, q] = a;
  let visr = new Set(),
      visc = new Set(),
      res = 0,
  vx = new Set(),
      vy = new Set(),
      sx = 0,
      sy = 0;
  for (let i = q - 1; i >= 0; i--) {
    let [x, y] = b[i];
    x--, y--;
    if (!visr.has(x) && sx < m || !visc.has(y) && sy < n) {
      res++;
    }
    if (sx === m && sy === n) break;
    if (!visr.has(x)) visr.add(x);
    if (!visc.has(y)) visc.add(y);
    if (!vx.has(y)) {
      vx.add(y);
      sx++;
    }
    if (!vy.has(x)) {
      vy.add(x);
      sy++;
    }
  }
  return power(k, res);
}
const MOD = 998244353;
function power(a, b) {
  let res = 1;
  while (b) {
    if (b & 1) res = mul(res, a);
    a = mul(a, a);
    b = b >> 1;
  }
  return res;
}
function mul(...args) {
  if (args.length === 0) throw new Error('参数不能为空');
  if (args.length === 1) return args[0];
  const [a, b] = args;
  if (args.length > 2) return mul(mul(a, b), ...args.slice(2));
  return ((a >> 16) * b % MOD * 65536 + (a & 65535) * b) % MOD;
}

async function main(read) {
  try {
    let t = Number(await read());
    let res = new Array(t);
    for (let i = 0; i < t; i++) {
      const a = (await read()).split(' ').map(Number);
      const b = [];
      let tmp = a[3];
      while (tmp--) {
        b.push((await read()).split(' ').map(Number));
      }
      res[i] = solve(a, b);
    }
    return res.join('\n');
  } catch (error) {
    console.log(error);
  }
}

let inputs,
    str = '';
function read() {
  return inputs.next().value.trim();
}
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', input => str += input);
process.stdin.on('end', async () => {
  inputs = str.split('\n').values();
  const output = await main(read);
  process.stdout.write(output);
});

const readline = require('readline')

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
})
const lines = []
rl.on('line', (input) => {
    lines.push(input);
})
rl.on('close', () => {
// (function() {
    // const lines = require('fs').readFileSync('test.in', 'utf8').split('\n')
    let l = 0;
    let t = +lines[l++]
    const output = []
    for (let i = 0; i < t; i++) {
        const [n, m, k, q] = lines[l++].trim().split(' ').map(Number)
        const qs = lines.slice(l, l + q).map(str => str.trim().split(' ').map(Number))
        l += q
        output[i] = solve(n, m, k, qs)
    }
    console.log(output.join('\n'))
// })()
})

function solve(n, m, k, qs) {
    const rows = {}
    const cols = {}
    let cr = 0
    let cc = 0
    let count = 0
    for (let i = qs.length - 1; i >= 0; i--) {
        let [x, y] = qs[i]
        x--; y--
        //
        let ok = 0
        if (!rows[x] && cc < m) {
            ok = 1
        }
        if (!cols[y] && cr < n) {
            ok = 1
        }
        if (ok) count++
        // if (n > 1 && m > 1) {
        // } else if (n > 1) {
        //     if (!rows[x] && cc < m) {
        //         count++
        //     }
        // // } else if (m > 1) {
        // } else {
        //     if (!cols[y] && cr < n) {
        //         count++
        //     }
        // }
        //
        if (!rows[x]) {
            rows[x] = 1
            cr++
        }
        if (!cols[y]) {
            cols[y] = 1
            cc++
        }
        // console.log(cr, cc)
    }
    return pow(k, count)
}

const MOD = 998244353
const MOD_CUT = ((1 << 20) * (1 << 20)) % MOD
function add(a, b) {
    return (a + b) % MOD
}
function minus(a, b) {
    return add(add(a, -b), MOD)
}
function mul(a, b) {
    let r = (a >> 20) * (b >> 20) * MOD_CUT
        + (a & 0xfff00000) * (b & 0xfffff)
        + (a & 0xfffff) * b
    return r % MOD
}
function pow(a, b) {
    let r = 1
    let base = a
    while (b) {
        if (b & 1) {
            r = mul(r, base)
        }
        b >>= 1
        base = mul(base, base)
    }
    return r
}

'use strict';

function solve(a, b) {
  let [n, m, k, q] = a;
  b = b.map(arr => arr.map(num => num - 1));
  let visr = new Array(n),
      visc = new Array(n),
      res = 1,
      v1 = new Array(n),
      v2 = new Array(n),
      sum1 = 0,
      sum2 = 0;
  for (let i = q - 1; i >= 0; i--) {
    const [x, y] = b[i];
    if (!visr[x] && sum1 < n || !visc[y] && sum2 < m) {
      res = mul(res, k);
    }
    visr[x] = 1;
    visc[y] = 1;
    if (!v1[y]) {
      v1[y] = 1;
      sum1++;
    }
    if (!v2[x]) {
      v2[x] = 1;
      sum2++;
    }
  }
  return res;
}
const MOD = 998244353;
function mul(...args) {
  if (args.length === 0) throw new Error('参数不能为空');
  if (args.length === 1) return args[0];
  const [a, b] = args;
  if (args.length > 2) return mul(mul(a, b), ...args.slice(2));
  return ((a >> 16) * b % MOD * 65536 + (a & 65535) * b) % MOD;
}

async function main(read) {
  try {
    let t = Number(await read());
    let res = new Array(t);
    for (let i = 0; i < t; i++) {
      const a = (await read()).split(' ').map(Number);
      const b = [];
      let tmp = a[3];
      while (tmp--) {
        b.push((await read()).split(' ').map(Number));
      }
      res[i] = solve(a, b);
    }
    return res.join('\n');
  } catch (error) {
    console.log(error);
  }
}

let inputs,
    str = '';
function read() {
  return inputs.next().value.trim();
}
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', input => str += input);
process.stdin.on('end', async () => {
  inputs = str.split('\n').values();
  const output = await main(read);
  process.stdout.write(output);
});


You are given an array $$$a$$$ consisting of $$$n$$$ ($$$n \ge 3$$$) positive integers. It is known that in this array, all the numbers except one are the same (for example, in the array $$$[4, 11, 4, 4]$$$ all numbers except one are equal to $$$4$$$).Print the index of the element that does not equal others. The numbers in the array are numbered from one.

The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$). Then $$$t$$$ test cases follow. The first line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$1 \le a_i \le 100$$$). It is guaranteed that all the numbers except one in the $$$a$$$ array are the same.

For each test case, output a single integer — the index of the element that is not equal to others.

var cases = parseInt(readline());
var t;
for(t=0; t <cases; t++){
var integer = readline();
var array = readline().split(" ");
var i;
var k;
var counter=0;
var item;
for(i=0; i <array.length; i++){
	counter=0;
	item = array[i];
	for(k=0; k <array.length;k++){
		if(k!=i && array[k] === item){
			counter++;
			break;
		}
	}

	if (counter==0){
		print(i+1);
		break;
	}

}
}

function readInt() {
  return parseInt(readline());
}

function readInts() {
  return readline()
    .split(' ')
    .map(function (e) {
      return parseInt(e);
    });
}

var t = readInt();

while (t--) {
  var n = readInt();
  var a = readInts().map(function (e, i) {
    return { e: e, i: i };
  });

  a.sort(function (a, b) {
    return a.e - b.e;
  });

  if (a[0].e !== a[1].e) {
    print(a[0].i + 1);
  } else {
    print(a[n - 1].i + 1);
  }
}

z = +readline();
y = 0;
for (j = 0; j < z; j++) {
  c = +readline();
  x = readline().split(" ").map(Number);
  for (i = 0; i <= c; i++) {
    if (x[i] !== x[i + 1] && x[i + 1] !== x[i + 2]) {
      y = x[i + 1];
      break;
    } else {
      y = x[0];
    }
  }
  index = x.indexOf(y);
  print(index + 1);
}

function PrintArray(arr)
{
    var str = ''
    for(var k=0;k<arr.length;k++)
    {
        str+=arr[k]+' ';
    }
    print(str);
}

function spy(n,arr)
{
    if(arr[0]!=arr[1] && arr[0]!=arr[2])
    {
        return 1;
    }

    if(arr[n-1]!=arr[n-2] && arr[n-1]!=arr[n-3])
    {
        return n;
    }

    for(var i=1;i<n-1;i++)
    {
        if(arr[i]!=arr[i+1] && arr[i]!=arr[i-1])
        {
            return i+1
        }
    }
}

var arr = []
var t = readline();

for(var indT=0;indT<t;indT++)
{
    var n = readline();

    var arr = readline();
    arr = arr.split(' ');

    print(spy(n,arr))

}

// 1512 A - Spy detected!

// number of test case
var numTests = parseInt( readline() );

for (var numTest = 0; numTest < numTests; numTest++) {

    // input data
    var n = parseInt( readline() );
    var array = readline().split(' ').map( e => parseInt(e));;
    var indexSpy = 0;
    var occorences = {};

    // count all occorence of two number in the array
    array.forEach( (e) => {
        occorences[e] = occorences[e] ? (occorences[e] += 1) : 1;
    });

    // find number with one occorence
    if( occorences[ Object.keys(occorences)[0] ] == 1){
        indexSpy = Object.keys(occorences)[0];
    } else {
        indexSpy = Object.keys(occorences)[1];
    }

    // print output
    print( array.indexOf( parseInt(indexSpy) ) + 1 );

}

// 1512 A - Spy detected!

// number of test case
var numTests = parseInt( readline() );

for (var numTest = 0; numTest < numTests; numTest++) {

    // input data
    var n = parseInt( readline() );
    var array = readline().split(' ').map( e => parseInt(e));;
    var indexSpy = 0;
    var occorences = {};

    array.forEach( (e) => {
        occorences[e] = occorences[e] ? (occorences[e] += 1) : 1;
    });

    // print(JSON.stringify(occorences));

    if( occorences[ Object.keys(occorences)[0] ] == 1){
        indexSpy = Object.keys(occorences)[0];
    } else {
        indexSpy = Object.keys(occorences)[1];
    }

    // print('spy: '+indexSpy);
    indexSpy = array.indexOf( parseInt(indexSpy) ) + 1 ;
    // print('index: '+indexSpy+'\n');

    print(indexSpy);

}

var testCases = readline();
var count;
var resultObj;
var result;
var length0;
for (var i = 0; i < testCases; i++) {
    resultObj = {};
    length0= readline();
    var arr = readline().split(' ');
    for (var val of arr) {
        if(!resultObj[val]) resultObj[val] = 1;
        else resultObj[val]++;
    }
    for (var key in resultObj) {
        if(resultObj[key] == 1) result = key;
    }
    print(arr.indexOf(result) + 1);
}

function solution() {
  var t = parseInt(readline());
  for (var i = 0; i < t; i++) {
    var n = parseInt(readline());
    var a = readline().split(" ");
    var nonSpy = a[0] === a[1] ? a[0] : a[2];
    for (var j = 0; j < n; j++) {
      if (a[j] !== nonSpy) {
        print(j+1);
      }
    }
  }
}

solution();

var t = readline();
    for(var i = 0 ; i < t ; i++){
        var n = readline(),
            a = readline().split(' ');
            valuesArray = [...new Set(a)],
            unexceptedValue = valuesArray[0]  , counter = 0;
            for(var j = 0 ; j < n ; j++){
                if(parseInt(valuesArray[0]) == parseInt(a[j]) ){
                    counter++;
                    if(counter > 1){
                     unexceptedValue = valuesArray[1];
                     break;
                    }
                }
            }
            print(parseInt(a.indexOf(unexceptedValue)) + 1);
    }

var t = parseInt(readline());

for (var i = 0; i < t; i++) {
    var n = parseInt(readline());
    var arr = readline().split(' ');

    if (arr[0] !== arr[1]) {
        if (arr[2] === arr[0]) {
            print(2);
        } else {
            print(1);
        }
    } else {
        for (var j = 2; j < n; j++) {
            if (arr[j] !== arr[0]) {
                print(j + 1);
                break;
            }
        }
    }
}

var numberOfTests =+(readline()),counter=0
for(var i=0;i<numberOfTests;i++){
    var a=[]
    var arrayLength=+readline()
    var array=readline().split(" ").map(node=>+node)
    for(var j=0;j<arrayLength;j++){
        for(var k=0;k<array.length;k++){
            if(array[j]===array[k]){
                counter++
            }
        }
        a.push(counter)
        counter=0
    }
    var min=a.reduce((a,b)=>{
        return Math.min(a,b)
    })

    print(a.indexOf(min)+1)
}

  var t = parseInt(readline());

  function solve() {
    var n = parseInt(readline());

    var inp = readline()
      .split(" ")
      .map((data) => +data);
    var hash = {};
    for (var i = 0; i < n; i++) {
      if (hash.hasOwnProperty(inp[i])) {
        hash[inp[i]]++;
      } else {
        hash[inp[i]] = 1;
      }
    }

    var ind = 0;
    for (var i in hash) {
      if (hash[i] === 1) {
        ind = i;
      }
    }
    return inp.indexOf(+ind) + 1;
  }

  while (t--) {
    print(solve());
  }

var test = parseInt(readline());
var inte = 0;

for(var i = 0; i < test; i++) {
    var foo = parseInt(readline());
    var bar = readline();
    var barSplited = bar.split(" ");
    for(var j = 0; j < barSplited.length; j++) {
        var counter = 0
        for(var k = 0; k < barSplited.length; k++) {
            if(barSplited[j] == barSplited[k] && j != k) {
                counter++
            }
        }
        if(counter == 0) {
            inte = j + 1;
        }
    }
    print(inte)
}

var tests = Number(readline());

for (var i = 0; i < tests; i++) {
    var len = Number(readline());
    var n = readline().split(" ");
    var index = 0;
    var check = 0;
    var is_first = false;

    for (var j = 0; j < len; j++) {
       var temp = n[j];

        if (j == 0 && n[j] != n[j+1]) {
            if (n[j + 1] == n[j + 2])
                is_first = true;
        }

        if (temp != n[j + 1])
            check++;

        if (check == 2) {
            index = j;
            break;
        }

    }

    is_first ? print(1) : print(index + 1);
}

var t=Number(readline());
for (var i=0; i<t; i++) {
    var n=Number(readline());
    var w=readline().split(" ").map(Number);
    var x=Array.from(new Set(w));
    if ((x[0]==w[1]&&x[0]==w[0])||(x[0]==w[1]&&x[0]==w[2])||(x[0]==w[0]&&x[0]==w[2])) {
        print(w.indexOf(x[1])+1);
    }
    else {
        print(w.indexOf(x[0])+1);
    }
}

var t = +readline();

for (var i = 0; i < t; i++) {
  var n = +readline();
  var a = readline().split(" ").map(Number);

  var first = a[0];
  var second = a[1];

  for(var j = 2; j < a.length; j++) {
      if(first === second && a[j] !== first) {
          print(j + 1);
          break;
      } else if(first !== second && a[j] === first) {
          print(a.indexOf(second) + 1);
          break;
      } else if(first !== second && a[j] === second){
          print(a.indexOf(first) + 1);
          break;
      }
  }
}

(function () {
    const count = readline();
    const n = Number(count);

    var i;
    var j;
    var result;
    for (i = 0; i < n; i++) {
        var length = readline();
        var l = Number(length);
        var line = readline();
        var items = line.split(' ');
        for (j = 0; j < l - 2; j++) {
            if (Number(items[j]) !== Number(items[j + 1]) && Number(items[j]) !== Number(items[j + 2])) {
                result = j + 1;
            }
            if (Number(items[j]) === Number(items[j + 1]) && Number(items[j]) !== Number(items[j + 2])) {
                result = j + 3;
            }
            if (Number(items[j]) === Number(items[j + 2]) && Number(items[j]) !== Number(items[j + 1])) {
                result = j + 2;
            }
        }

        print(result);
    }
})();

  '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() {
		///problem specific code start
let tc = readline();
while(tc--)
{
	let arraySize = readline();
	const array = readline().split(' ');
    const obj = {};
    for (let value of array)
    {
    	if(value in obj)
    	{
          obj[value]++;
    	}
    	else
    		obj[value]=1;
    }
    for(let key in obj)
    {
    	if(obj[key]==1)
    		console.log(array.indexOf(key)+1);
    }

}      //problem specific code end

}

    '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() {
    	///problem specific code start
        /*
    	var tc=readline();
    	while(tc--)
    	{
    		let size=readline();
    		const numbers=readline().split(' ');
    		for(let i=0;i<size;i++)
    		{
    			let cnt=0;
    			for(let j=0;j<size;j++)
    			{
    				if(numbers[i]==numbers[j])
    					cnt++;

    			}
    			if(cnt===1)
    			{
    				var index=i+1;
    				break;
    			}

    		}
    		console.log(index);

    	}
        */let testcase=readline();
while(testcase--)
{
    let arraySize=readline();
    const array=readline().split(' ');
    const tempObj={};
    for(let i of array)
    {
        if(!tempObj[i])
            tempObj[i]=1;
        else
            tempObj[i]++;
    }
   // console.log(Object.keys(tempObj));
   let result;
   for(let key in tempObj)
   {
    if(tempObj[key]==1)
        result=key;
   }
   console.log(array.indexOf(result)+1);
}
    	//problem specific code end

    }

    '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() {

       var tc=readline();
while(tc--)
{
	let size=readline();
	const numbers=readline().split(' ');
	for(let i=0;i<size;i++)
	{
		let cnt=0;
		for(let j=0;j<size;j++)
		{
          if(numbers[i]==numbers[j])
              cnt++;

		}
		if(cnt===1)
		{
			var index=i+1;
			break;
		}

	}
	console.log(index);

}

    }

'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++];
}
// Make a Snippet for the code above this and then write your logic in main();

function main() {
  const useCases = readline();

  for (let i = 0; i < useCases; i++) {
    const arrayLength = readline();
    const arrayContent = readline().split(' ');
    const arrayContentSorted = arrayContent.slice().sort((a,b) => a - b);
    let unique = 0;

    if (arrayContentSorted[0] === arrayContentSorted[1]) {
      unique = arrayContentSorted[arrayLength - 1];
    } else {
      unique = arrayContentSorted[0];
    }

    const uniqueIndex = arrayContent.indexOf(unique);

    print(uniqueIndex + 1);
  }
}

function print(x) {
    // process.stdout.write("hello: ");   // without auto '\n' (newline)
    console.log(x);  // with auto '\n' (newline)
}

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

// ********** Code Start **********

function main() {
    const t = parseInt(readline())
    const results = []
    const arrayInputs = []
    for(let i =0; i<t; i++) {
        const length = readline()
        arrayInputs[i] = readline().split(" ")
    }

    const check = (arr) => {
        if(arr[0] != arr[1]) {
            if(arr[1] == arr[2]) {
                results.push(1)
            }else {
                results.push(2)
            }
        }else {
            let cont = true
            i=2;
            while(cont && i<arr.length) {
                if(arr[i] == arr[i-1]) {
                    i++
                }else {
                    cont = false
                    results.push(i+1)
                }
            }

        }
    }

    arrayInputs.forEach((arrayInput) => {
        check(arrayInput)
    })

    results.forEach(result => console.log(result))
}

"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++];
}
// Make a Snippet for the code above this and then write your logic in main();

const getSpyIndex = (arrNum) => {
  // console.log("input string", arrNum);

  if (arrNum[0] === arrNum[2] && arrNum[1] !== arrNum[2]) {
    return 1;
  }
  for (let i = 2; i < arrNum.length; i++) {
    if (arrNum[0] !== arrNum[i]) {
      if (arrNum[1] === arrNum[i]) {
        return 0;
      } else {
        return i;
      }
    }
  }
};

function main() {
  const numberOfTestCases = 1 * readline();
  // console.log("number of test cases", numberOfTestCases);
  Array.from({ length: numberOfTestCases }).forEach(() => {
    const arrayLength = 1 * readline();
    const arrayString = readline();
    const arr = arrayString.split(" ");
    const arrNum = arr.map((x) => +x);

    console.log(getSpyIndex(arrNum) + 1);
  });
}

"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++];
}
// Make a Snippet for the code above this and then write your logic in main();

const getSpyIndex = (arrNum) => {
  let index;
  //   console.log("input string", arrNum);

  arrNum.forEach((x, i) => {
    if (i > 1) {
      if (arrNum[0] !== x) {
        if (arrNum[1] === x) {
          index = 0;
        } else {
          index = i;
        }
      } else if (i === 2) {
        index = 1;
      }
    }
  });

  console.log(index + 1);
};

function main() {
  const numberOfTestCases = 1 * readline();
  // console.log("number of test cases", numberOfTestCases);
  Array.from({ length: numberOfTestCases }).forEach(() => {
    const arrayLength = 1 * readline();
    const arrayString = readline();
    const arr = arrayString.split(" ");
    const arrNum = arr.map((x) => x * 1);

    getSpyIndex(arrNum);
  });
}
// const arrString = "3 3 3 3 10 3 3 3 3 3";

'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() {
  let tests = parseInt(readline());
  while (tests--) {
    let len = parseInt(readline());
    let arr = readline().split(' ');
    let key = {};
    for (let i = 0; i < len; i++) {
      if (key[arr[i]]) key[arr[i]].push(i + 1);
      else key[arr[i]] = [i + 1];
    }
    PrintMin(Object.values(key));
  }
}

function PrintMin(arr) {
  if (arr[0].length === 1) console.log(...arr[0]);
  else console.log(...arr[1]);
}

let i = '';
process.stdin.on('data', c => i += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = i.split(EOL); /*your input text, split by lines*/
    var n = lines[0];
    var answer = 0;
    for(var j = 1; j <= n * 2; j += 2){
        var num = lines[j + 1].split(' ');
        for(var k = 0; k < num.length; k++){
            var left = k - 1;
            var right = k + 1;
            if(left == -1){
                left = num.length -1;
            }
            if(right == num.length){
                right = 0;
            }
            if(num[k] != num[left] && num[k] != num[right]){
                console.log(k + 1);
            }
        }

    }
});

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

process.stdin.on('end', () => {
    const lines = input.split('\n');
    const cases = parseInt(lines[0]);

    let on = true;
    for (let i = 1; i < cases * 3; i++) {
        const line = lines[i];
     //   console.log(line);
        if (!line) {
            return;
        }
        if (on) {
        } else {
            const arr = lines[i].split(' ').map(t => t.trim());
            let t;
        //console.log(arr);
            const index = arr.findIndex((item, index) => {
                //console.log('t' + t + item);
                if (index === 0 && arr[index + 1] !== item && arr[index + 2] !== item) {
                    return true;
                }
                if (t === undefined) {
                    t = item;
                    return false;
                }

                if (item !== t) {
                    return true;
                }
            });

            console.log((index + 1));
        }

        on = !on;
    }
});

"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf-8");

function print(x) {
  console.log(x);
}
let inputString = "";
let currentLine = 0;

process.stdin.on("data", (inputStdin) => {
  inputString += inputStdin;
});
process.stdin.on("end", () => {
  inputString = inputString.split("\n");
  main();
});
function readline() {
  return inputString[currentLine++];
}

// ********** Code Start **********

function main() {
  var a=readline();
while(a--){
   var t=readline();
   var s=readline().split(" ");

   var c=[];
   var ex;

   for(let i=0;i<s.length;i++){
       if(c.indexOf(s[i])==-1){
           c.push(s[i])
       }else{
           ex=s[i]
       }
   }
//    console.log(c,'kkkk')
var ans=c.filter(data => data != ex);
   console.log(s.indexOf(ans[0])+1)
}
}

// Common Template Starts //
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) => string.trim())
    main()
})

const readline = () => inputString[currentLine++]
// Common Template Ends //

// Driver Function Starts //
const main = () => {
    console.clear()
    let t = parseInt(readline())
    while (t--) {
        let n = parseInt(readline())
        let arr = readline().split(' ').map( Number )
        console.log( solve(arr) )
    }
}
// Driver Function Ends //

// MAIN LOGIC
const solve = (arr) => {
    let min = minOfArray( arr )
    let max = maxOfArray( arr )
    let minArr = arr.filter( a => a === min )

    spy = ( minArr.length === 1 ) ? min : max

    for( a in arr ) {
        if( arr[a] === spy ) return parseInt( a ) + 1
    }
}

const isOdd         = (num) => num & 1
const isEven        = (num) => !(num & 1)
const minOfArray    = (arr) => Math.min.apply(null, arr)
const maxOfArray    = (arr) => Math.max.apply(null, arr)
const uniqueArray   = (arr) => [...new Set(arr)]
const sortArray     = (arr) => arr.sort((a, b) => a - b)
const sumOfArray    = (arr) => arr.reduce((partialSum, a) => partialSum + a, 0)

let q = '';
process.stdin.on('data', c => q += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = q.split(EOL);
    var n = lines[0];
    var e = 0;
    for(i = 1; i <= n * 2; i++){
        if(i % 2 == 1){
            e = lines[i];
        }else{
            var k = lines[i].split(' ').map(Number);
            for(j = 0; j < e; j++){
                var l = j - 1;
                var r = j + 1;
                l = l == -1 ? k.length - 1 : l;
                r = r == k.length ? 0 : r;
                if(k[l] != k[j] && k[j] != k[r]){
                    console.log(j + 1);
                    break;
                }
            }
        }
    }
});

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

let inputString = "";
let currentLine = 0;
let max = 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() {
  let = i = 0;

  let x = readline();
  max = x;

  for (let i = 0; i < max * 2; i++) {
    let y = readline();
    if (i % 2 === 1) {
      execute(y.split(" "));
    }
  }
}

function execute(x) {
  // without auto '\n' (newline)
  // process.stdout.write("");
  // with auto '\n' (newline)
  // console.log(x);

  let data = {};
  let spy = null;

  if (x.length !== 1) {
    for (let i = 0; i < x.length; i++) {
      if (!data.hasOwnProperty(x[i])) {
        data[`${x[i]}`] = 1;
      } else {
        data[`${x[i]}`] += 1;
      }
    }

    for (const el in data) {
      if (data[el] === 1) {
        spy = el;
      }
    }

    for (let i = 0; i < x.length; i++) {
      if (x[i] === spy) {
        console.log(i + 1);
      }
    }
  }
}

function processInput(input) {
        let opt = {};
        let [first, ...second] = [...input.split("\n")];
        opt.n = parseInt(first);
        for(var i = 0; i < second.length; i++) {
            second[i] = second[i].split(" ").map(val => parseInt(val));
        }
        opt.testcases = second;
       // console.log(opt);
        return opt;
    }

    function iterateTC(TC) {
        var size = TC.n, arr = TC.testcases, k;
        for(var  i = 1; i<arr.length; i=i+2) {
            getSum(arr[i]);//main function call
        }
    }

    function getSum(ar) {
         if(isNaN(ar[ar.length-1])) ar.pop();
    	var a, b, key;
    	a = ar[0]; b = ar[1];
        if(ar[2] == a && ar[2] == b) {
        	key = a;
        	for(var i = 0; i<ar.length; i++) {
        		if(ar[i] !== key) {
        			console.log(i+1);
        			return;
        		}
        	}
        } else if(ar[2] == ar[1] && ar[2] !== ar[0]) {
        	console.log(1);
        } else if(ar[2] !== ar[1] && ar[2] == ar[0]) {
        	console.log(2);
        } else {
        	console.log(3);
        }
    }

process.stdin.resume();
process.stdin.setEncoding("ascii");
_input = "";
process.stdin.on("data", function (input) {
    _input += input;
});

process.stdin.on("end", function () {
   var TC = processInput(_input);
   iterateTC(TC);
});

function solve(arr, N) {
    const a = arr[0];
    const b = arr[1];
    const c = arr[2];
    if (a == b && b == c) {
        for (let i = 3; i < N; i++) {
            if (arr[i] != a) {
                return i + 1;
            }
        }
    } else if (a == b && b != c) {
        return 3;
    } else if (b == c && a != b) {
        return 1;
    } else {
        return 2;
    }
}

function processData(input) {
    //Enter your code here
    input = input.split('\n');
    const T = Number(input[0].trim());
    let i = 1;
    for (let t = 0; t < T; t++) {
        const N = Number(input[i++].trim());
        const arr = input[i++].trim().split(' ').map(Number);
        const ans = solve(arr, N);
        console.log(ans);
    }
}

process.stdin.resume();
process.stdin.setEncoding("ascii");
_input = "";
process.stdin.on("data", function (input) {
    _input += input;
});

process.stdin.on("end", function () {
    processData(_input);
});

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

let c = 0;

rl.on("line", (d) => {
  if (c === 0) {
    c++;
    return;
  }

  if (c % 2) {
    c++;
    return;
  }

  const arr = d.split(" ").map(Number);
  let guess = arr[0];

  if (guess === arr[1]) {
    let inc = 1;
    while (guess === arr[inc]) {
      inc++;
    }

    console.log(inc + 1);
  } else {
    if (guess === arr[2]) {
      console.log(2);
    } else {
      console.log(1);
    }
  }

  c++;
});

rl.on("close", () => {});

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

let input = [];
let ans = [];

readline.on('line', line => {
    input.push(line);
}).on('close', () => {
    for (let i = 2; i < input.length; i+=2) {
        let nums = input[i].split(' ');
        for (let j = 0; j < nums.length; j++) {
            if (nums.indexOf(nums[j]) === nums.lastIndexOf(nums[j])) {
                ans.push(j+1);
                break;
            }
        }
    }
    console.log(ans.join('\n'))
});

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

    const lines = i.split(EOL)
    const NoL = lines[0]*2

    let LoA = false
    let crewmate = 0

    let n = 1
    while(NoL >= n){
        if(!LoA){
            LoA = lines[n]

        }else{
            let number =  lines[n].split(" ")

            if(number[0] == number[1]){
                crewmate = number[0]

            }else if(number[0] == number[2]){
                crewmate = number[0]
            }else{
                crewmate = number[1]
            }

            let a = 0
            while(LoA > a){
                if(number[a] != crewmate){
                    console.log(number.indexOf(number[a])+1)
                    break;
                }
                a++
            }

            LoA = false
        }
         n++
    }
})

'use strict';
const readline = require('readline');
const util = require('util');
const rl = readline.createInterface({
    input: process.stdin,
});
let pos = 0;
const words = [];
rl.on('line', (line) => {
    words.push.apply(words, line.split(' ').filter(s => s != ''));
});
rl.on('close', main);
function check(b) {
    if (!b) {
        process.stderr.write(`${new Error().stack}\n`);
        process.exit(-1);
    }
}
function printf(...args) {
    process.stdout.write(util.format(...args));
}
function nextInt() {
    return Math.trunc(Number(words[pos++]));
}
function nextStr() {
    return words[pos++];
}
function af(l) {
    return Array.from({ length: l });
}
const INIT = -1;
function solve() {
    let n = nextInt();
    const cnt = af(101).fill(0);
    const a = af(n);
    for (let i = 0; i < n; i++) {
        a[i] = nextInt();
        cnt[a[i]]++;
    }
    for (let i = 1; i <= 100; i++) {
        if (cnt[i] == 1) {
            for (let j = 0; j < n; j++) {
                if (a[j] == i) {
                    return j + 1;
                }
            }
        }
    }
    return INIT;
}
function main() {
    let tc = nextInt();
    while (tc-- > 0) {
        printf("%d\n", solve());
    }
}

/**
 * Bismillahir Rahmanir Rahim
 * This code has been taken from: https://codeforces.com/blog/entry/69610
 */
 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++];
 }

 /****** BELOW HERE START WRITING YOUR CODE IN main() FUNCTION   ***************************************/
 /**
  * Use "readLine()" function for input, which will return a string consisting the entire line, so accordingly split the string
  * when required.
  *
  * I am using console.log() to output
  */
//  function main() {
//      let t = readLine();
//      t = parseInt(t);
//      console.log("mai yahan aaya")
//      while(t--) {
//          let line = readLine();
//          line = line.split(" ");
//          let n = parseInt(line[0]);
//          let m = parseInt(line[1]);
//          if(n === 1) {
//              console.log("0");
//          } else if (n === 2) {
//              console.log(m);
//          } else {
//              console.log(2*m);
//          }
//      }
//  }

function main() {

	let t = parseInt(readLine());
	// t = parseInt(t);
	while(t--) {
		let n = readLine();
		n = parseInt(n);
		let s = readLine().split(" ").map(item=>parseInt(item));
		console.log(solve(n,s)+1);

	}
    // console.log(t);
}

function solve(n, s) {
	for (let i = 0; i < n-2; i++) {
		if (s[i] == s[i+1] && s[i] == s[i+2]) {
			continue;
		}
		if (s[i] == s[i+1]) return i+2;
		if (s[i] == s[i+2]) return i+1;
		if (s[i+1] == s[i+2]) return i;
	}
}

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

function* nextLine() {
	let lines = data.trim().split(/\n/g);
	for(let l of lines){
		yield l.trim();
	}
}

let nl = nextLine();

nl.elem = function(funParse) {
		return funParse(this.next().value);
	};

nl.array = function(funParse) {
		return this.next().value.split(/\s/g).map(funParse||(x => x));
	};

nl.num = function() {
		return nl.elem(Number);
	};

nl.nums = function() {
		return nl.array(Number);
	};

nl.line = function() {
		return this.next().value;
	};

const sol = () => {
	let t = nl.num();
    let ans = [];
    for(let i = 0; i < t; i++){
		nl.num();
		let s = nl.nums();
		let a = s[0];
		let b = s[1];
		let c = s[2];
		let x = 0;
		if (a == b) {
			x = a;
		} else if (b == c) {
			x = b;
		} else {
			x = a;
		}

		let y = 0;
		s.forEach((e, i) => {
			if (e != x) {
				y = i + 1;
				return;
			}
		});
		ans.push(y);
    }

	console.log(ans.join("\n"));

};

process.stdin.on('end', sol);

input()
//-------------------

function input () {
  let i = ''
  process.stdin.on('data', c => i += c)
  process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL) /*your input text, split by lines*/
    //console.log(lines);
    solve(lines)
  })

}

function solve (arr) {
  var d =+arr[0]
  for (var i =1 ;i <=d ;i++){
    var mas =arr[2*i].split(" ")
    var mno =new Set(mas)

    for (var e of mno){
      var k =mas.indexOf(e)
      var kk =mas.lastIndexOf(e)
      if (k == kk){
        console.log(k+1)
        break

      }
    }

  }

}

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

let inputString = '';
let currentLine = 0;

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

process.stdin.on("end", a => {
	inputString = inputString.trim().split("\n").map(str => str.trim());
	main();
});

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

function main() {
	let t = parseInt(readLine().split(" ")[0]);

	while(t-->0) {
		let n = parseInt(readLine().split(" ")[0]);

		let arr = new Array(n);
		let num = readLine().split(" ");
		for(let i=0;i<n;i++) {
			arr[i] = parseInt(num[i]);
		}
		let ans = 0;
		for(let i=0;i<n-2;i++) {
			if(arr[i] !== arr[i+1] && arr[i+1] !== arr[i+2]) {
				console.log(i+2);
				break;
			} else if(arr[i] !== arr[i+1] && arr[i+1] === arr[i+2]) {
				console.log(i+1);
				break;
			} else if(arr[i] === arr[i+1] && arr[i+1] !== arr[i+2]){
				console.log(i+3);
				break;
			}
		}
	}
}

'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() {
    let t = readline();
    while(t--)
    {
        let num_of_elements = readline();
        let elements = readline();
        elements = elements.split(' ')
        let prev_occ = elements[0];
        for(let i=1;i<num_of_elements;i++)
        {
            if(prev_occ != elements[i])
            {
                if(elements[i] == elements[i+1])
                    console.log(i)
                else
                    console.log(i+1)
                break;
            }
        }
    }

}

var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
process.stdin.resume();
process.stdin.setEncoding('utf-8');
var inputString = [];
var s = "";
var currentLine = 0;
process.stdin.on('data', function (inputStdin) {
    s += inputStdin;
});
process.stdin.on('end', function (_) {
    inputString = s.trim().split('\n').map(function (string) {
        return string.trim();
    });
    s = null;
    main();
});
function readline() {
    return inputString[currentLine++];
}
function readIntLine() {
    return inputString[currentLine++].split(" ").map(function (e) { return parseInt(e); });
}
var println = console.log;
// -- SOLUTION
function main() {
    //get data
    var t = readIntLine()[0];
    var _loop_1 = function (i) {
        var n = readIntLine()[0];
        var arr = readIntLine();
        var m = {};
        arr.forEach(function (e, i) {
            m[e] = m[e] ? __assign(__assign({}, m[e]), { count: m[e].count + 1 }) : { firstPos: i, count: 1 };
        });
        println(m[Object.keys(m).filter(function (k) {
            return m[k].count == 1;
        })[0]].firstPos + 1);
    };
    for (var i = 0; i < t; i++) {
        _loop_1(i);
    }
}

'use-strict'

process.stdin.resume();
process.stdin.setEncoding('utf8');

let data = '';
let currentLine = 0;

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

process.stdin.on('end', () =>{
    data = data.replace(/\s*$/, '')
    .split('\n')
    .map(str => str.replace(/\s*$/, ''));

    let testCases = parseInt(readLine());
    while(testCases--)
    {
       let n = parseInt(readLine());
       let arr = get_ints();
       let my_map = new Map();
       for(let i = 0 ; i < n ; i++)
            my_map.get(arr[i]) ? my_map.set(arr[i], my_map.get(arr[i]) + 1) : my_map.set(arr[i], 1)
        let ans;
        for([key,value] of my_map){
            if(value === 1) ans = key;
        }
        for(let i = 0; i < n; i++){
            if(arr[i] === ans){
                console.log(i + 1);
                break;
            }
        }
    }
});

function get_ints() {
    return readLine().split(' ').map(Number);
}

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

function print(c){
    return console.log(c)
}

function isEqual(arr){
     let flag = true;
        for(let i = 0 ; i < arr.length - 1; i++){
            if(arr[i] !== arr[i + 1]){
                flag = false;
                break;
            }
        }
    return flag;
}

// https://codeforces.com/problemset/problem/1512/A

process.stdin.setEncoding('utf-8')
const readline = require('readline')

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

let count = -1
let inputArr = []

rl.on('line', data => {
  if (count === -1) {
    count = +data * 2
  } else if (count !== 0) {
    inputArr.push(data.trim())
    count--;
  }

  if (count === 0) {
    inputArr = inputArr.map(i => i.split(' ').map(j => +j))

    for (let i = 0; i < inputArr.length; i += 2) {
      solution(inputArr[i], inputArr[i + 1])
    }

    process.exit(0)
  }
})

/**
TEST CASES
4
4
11 13 11 11
5
1 4 4 4 4
10
3 3 3 3 10 3 3 3 3 3
3
20 20 10
 */
const solution = (n, arr) => {
    const key0 = arr[0];
    const key1 = arr[1];
    const key2 = arr[2];

    if (key0 === key1 && key0 !== key2) {
      console.log(3);
      return;
    } else if (key0 === key2 && key0 !== key1) {
      console.log(2);
      return;
    } else if (key1 === key2 && key0 !== key1) {
      console.log(1);
      return;
    }

    let result = 1;

    for (let i=1; i<arr.length; i++) {
      if (arr[i] !== key0) {
        result = i + 1;

        break;
      }
    }

    console.log(result);
};

function solution(scanner) {
    const T = scanner.readInt();
    const r = [];
    for (let tc = 0; tc < T; tc++) {
        const N = scanner.readInt();
        const db = scanner.readLine().split(' ').map(Number);
        let testNum;
        if (db[0] === db[1]) testNum = db[0];
        else if (db[0] === db[2]) testNum = db[0];
        else if (db[1] === db[2]) testNum = db[1];
        for (let i = 0; i < N; i++) {
            if (db[i] !== testNum) {
                r.push(i + 1);
                break;
            }
        }
    }
    return r.join('\n');
}

/////////////////////////////////////////////////////////////////////////////////
// Readiz JS Util Start
/////////////////////////////////////////////////////////////////////////////////
const scanner = {
    readInt: () => {
        return parseInt(__lineDB[__lineIdx++], 10);
    },
    readLine: () => {
        return __lineDB[__lineIdx++];
    }
};
let __lineDB = [];
let __lineIdx = 0;
const isDebug = process.argv[2] === 'readizDebug';
if (!isDebug) {
    global.console = {
        log: () => {},
        warn: () => {},
        info: () => {},
        debug: () => {},
        error: () => {}
    };
    const rl = require('readline').createInterface({
        input: process.stdin,
        output: process.stdout
    });
    rl.on('line', (line) => {
        __lineDB.push(line);
    });
    rl.on('close', () => {
        process.stdout.write(solution(scanner) + '\n');
    });
} else {
    __lineDB = require('fs').readFileSync(process.argv[1].replace('.js', '_input.txt')).toString().split('\n');
    while (__lineIdx < __lineDB.length) {
        process.stdout.write('--------------------------------------------\n');
        process.stdout.write('New Start + Log\n');
        process.stdout.write('--------------------------------------------\n');
        const start = __lineIdx;
        const answer = solution(scanner);
        const end = __lineIdx;
        process.stdout.write('----------------------\n');
        process.stdout.write('Input\n')
        process.stdout.write('----------------------\n');
        process.stdout.write(__lineDB.slice(start, end).join('\n') + '\n');
        process.stdout.write('----------------------\n');
        process.stdout.write('Answer\n')
        process.stdout.write('----------------------\n');
        process.stdout.write(answer + '\n');
    }
}

//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
	input: process.stdin, output: process.stdout
});
var obj; var inLine = []; var outputList = [];var retcode = new Set();
read.on('line', function(input){
	var tmp = input.split(' ');
	for(var i = 0; i < tmp.length; i++){
		inLine.push(tmp[i]);
		if(i == tmp.length - 1){
			retcode.add(inLine.length);
		}
	}
});
read.on('close', function(){
	obj = init(inLine);
	console.error('\n↑入力 ↓出力');
	Main();
	console.log(myconv(outputList, 9));
});
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 getCountMap(list){
	var map = {};
	for(var i = 0; i < list.length; i++){
		if(map[list[i]] == null){
			map[list[i]] = 0;
		}
		map[list[i]]++;
	}
	return map;
}
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';}},
		isReturn : function(){return retcode.has(this.index);}
	};
}
function myout(s){outputList.push(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
function isReturn(){return obj.isReturn();}
//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();
	for(var i = 0; i < t; i++){
		var N = nextInt();
		var list = nextStrArray(N);
		var map = {};
		for(var j = 0; j < N; j++){
			if(map[list[j]] == null){
				map[list[j]] = 0;
			}
			map[list[j]]++;
		}
		var key = Object.keys(map);
		var min;
		myerr(map);
		if(map[key[0]] < map[key[1]]){
			min = key[0];
		}else{
			min = key[1];
		}
		myerr(min);
		myout(list.indexOf(min) + 1);
	}
}

process.stdin.setEncoding('utf-8')
const readline = require('readline')

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

let count = -1
let inputArr = []

rl.on('line', data => {
    if (count === -1) {
        count = +data * 2
    } else if (count !== 0) {
        inputArr.push(data.trim())
        count--
    }
    // max number 2^(53) - 1 ~~ 10^(15)
    if (count === 0) {
        inputArr = inputArr.map(i => i.split(' ').map(j => +j))
        main()
        process.exit(0)
    }
})

function solve(n, arr) {
    const res = arr.filter((el, i, arr) => arr.indexOf(el) === arr.lastIndexOf(el))
    console.log(arr.indexOf(res[0]) + 1)
}

function main() {
    for (let i = 0; i < inputArr.length; i += 2) solve(inputArr[i], inputArr[i + 1])
}

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

var maxN = 21
var mod = 1000000007

// Make a Snippet for the code above this and then write your logic in main();

function main() {
  const xx = readline();

  Array(Number(xx)).fill(1).map((t, i) => {
    const n = parseInt(readline());
    // var [n, p, k] = readline().split(' ').map((x, iii) => {
    //   return parseInt(x)
    // });
    var a = readline().split(' ').map((x, iii) => {
      return parseInt(x)
    });
    var min = 0
    var object = {}
    for (let j = 0; j < n; j++) {
      if (!object[a[j]]) object[a[j]] = 0
      object[a[j]]++
    }
    for (let j = 0; j < n; j++) {
      if (object[a[j]] === 1) return console.log(j + 1)
    }

  })
}

var integer = readline();
var array = readline().split(" ");
var i;
var k;
var counter=0;
var item;
for(i=0; i <array.length; i++){
	counter=0;
	item = array[i];
	for(k=0; k <array.length;k++){
		if(k!=i && array[k] === item){
			counter++;
			break;
		}
	}

	if (counter==0){
		print(i+1);
		break;
	}

}

var integer = readline();
var array = readline().split(" ");
var i;
var k;
var counter=0;
var item;
for(i=0; i <array.length; i++){
	counter=0;
	item = array[i];
	for(k=0; k <array.length;k++){
		if(k!=i && array[k] === item){
			counter++;
			break;
		}
	}

	if (counter==0){
		i++;
		print(i);
		break;
	}

}

var integer = readline();
var array = readline().split(" ");
var i;
var counter=0;
var item;
for(i=0; i <array.length; i++){
	counter=0;
	item = array[i];
	for(k=0; k <array.length;k++){
		if(k!=i && array[k] === item){
			counter++;
			break;
		}
	}

	if (counter==0){
		print(i+1);
		break;
	}

}

var t = parseInt(readline());
while (t--) {
  var n = parseInt(readline());
  var a = readline()
    .split(' ')
    .map(function (e) {
      return parseInt(e);
    });
  var nonSpy = a[0] === a[1] ? a[0] : a[2];
  for (var j in a) {
    if (j !== nonSpy) {
      print(j + 1);
    }
  }
}

var t = parseInt(readline());
while (t--) {
  var n = parseInt(readline());
  var a = readline().split(' ');
  var nonSpy = a[0] === a[1] ? a[0] : a[2];
  for (var j in a) {
    if (j !== nonSpy) {
      print(j + 1);
    }
  }
}

z = +readline();
y = 0;
for (i = 0; i < z; i++) {
  c = +readline();
  x = readline().split(" ").map(Number);
  for (i = 0; i <= c; i++) {
    if (x[i] !== x[i + 1] && x[i + 1] !== x[i + 2]) {
      y = x[i + 1];
      break;
    } else {
      y = x[0];
    }
  }
  index = x.indexOf(y);
  print(index + 1);
}

y = 0;
z = +readline();
for (i = 0; i < z; i++) {
  c = +readline();
  x = readline().split(" ").map(Number);
  for (i = 0; i <= x.length; i++) {
    if (x[i] !== x[i + 1] && x[i + 1] !== x[i + 2]) {
      y = x[i + 1];
    } else {
      y = x[0];
    }
  }
  index = x.indexOf(y);
  print(index + 1);
}

y = 0;
z = +readline();
for (i = 0; i < z; i++) {
  c = +readline();
  x = readline().split(" ").map(Number);
  for (i = 0; i <= x.length; i++) {
    if (x[i] !== x[i + 1] && x[i + 1] !== x[i + 2]) {
      y = x[i + 1];
      break;
    } else {
      y = x[0];
    }
  }
  index = x.indexOf(y);
  print(index + 1);
}

//const { readline, print, console } = require('@ip-algorithmics/codeforces-io');

function PrintArray(arr)
{
    var str = ''
    for(var k=0;k<arr.length;k++)
    {
        str+=arr[k]+' ';
    }
    print(str);
}

function PalindromeBinaire(a,b,str) //https://codeforces.com/problemset/problem/69/A
{
    b = parseInt(b)
    a = parseInt(a)

    str = str.split("");

    var n = str.length-1
    if(n==1 && a==1 && b==0)
    {
        return '0'
    }
    else if(n==1 && b==1 && a==0)
    {
        return '1'
    }

    for(var i=0;i<n;i++)
    {

       if(i<Math.ceil(n/2))
       {
            var inversed = n-i-1
            var current = i
       }
       else
       {
            var inversed = i
            var current = n-i-1
       }

       var next = a>b?'0':'1'
       if(str[current] == '?')
       {
            if(str[inversed]!='?')
            {
                str[current] = str[inversed];
                if(str[inversed] == '0')
                {
                    a = parseInt(a) - 1
                }
                else
                {
                    b = parseInt(b) - 1
                }
            }
            else
            {
                str[current] = next;
                str[inversed] = next;
                if(a>b)
                {
                    a = parseInt(a) - 2
                }
                else
                {
                    b = parseInt(b) - 2
                }
            }
       }
       else if(str[current] == '0')
       {
            if(str[inversed] == '1')
            {
                return "-1";
            }
            else if(str[inversed] == '?')
            {
                str[inversed] =  '0';
                a = parseInt(a) - 1;
            }
       }
       else if(str[current] == '1')
       {
            if(str[inversed] == '0')
                {
                    return "-1";
                }
                else if(str[inversed] == '?')
                {
                    str[inversed] = '1';
                    b = parseInt(b) - 1;
                }
       }
       if(a<0 || b<0)
       {
            return "-1";
       }
    }

    return str.join("");
}

var arr = []
var t = readline();

for(var indT=0;indT<t;indT++)
{
    var abLine = readline().split(" ");

    var a = parseInt(abLine[0]);
    var b = parseInt(abLine[1]);

    var str = readline();

    arr.push([a,b,str])

}

arr.forEach(function(element){
    print(PalindromeBinaire(element[0],element[1],element[2]))
})

var testCases = readline();
var count;
var resultObj;
var result;
for (var i = 0; i < testCases; i++) {
    resultObj = {};
    var length = readline();
    var arr = readline().split(' ');
    for (const val of arr) {
        if(!resultObj[val]) resultObj[val] = 1;
        else resultObj[val]++;
    }
    for (const key in resultObj) {
        if(resultObj[key] == 1) result = key;
    }
    print(arr.indexOf(result) + 1);
}

function solution() {
  var t = parseInt(readline());
  for (var i = 0; i < t; i++) {
    var n = parseInt(readline());
    var a = readline().split(" ");
    var nonSpy = a[0] === a[1] ? a[0] : a[2];
    for (var j = 0; j < n; j++) {
      if (a[j] !== nonSpy) {
        print(j);
      }
    }
  }
}

solution();

    "use strict";
    process.stdin.resume();
    process.stdin.setEncoding("utf-8");

    function print(x) {
      console.log(x);
    }
    let inputString = "";
    let currentLine = 0;

    process.stdin.on("data", (inputStdin) => {
      inputString += inputStdin;
    });
    process.stdin.on("end", () => {
      inputString = inputString.split("\n");
      main();
    });
    function readline() {
      return inputString[currentLine++];
    }

    // ********** Code Start **********

    function main() {
    	/*
      var a=readline();
    while(a--){
       var t=readline();
       var s=readline().split(" ");

       var c=[];
       var ex;

       for(let i=0;i<s.length;i++){
           if(c.indexOf(s[i])==-1){
               c.push(s[i])
           }else{
               ex=s[i]
           }
       }
    //    console.log(c,'kkkk')
    var ans=c.filter(data => data != ex);
       console.log(s.indexOf(ans[0])+1)
    }
    */
    var tc=readline();
while(tc--)
{
	let size=readline();
	const numbers=readline().split(' ');
	for(let i=0;i<size;i++)
	{
		let cnt=0;
		for(let j=0;j<size;j++)
		{
          if(numbers[i]==numbers[j])
              cnt++;

		}
		if(cnt==1)
		{
	      console.log(i+1);

		}

	}

}

    }

    "use strict";
    process.stdin.resume();
    process.stdin.setEncoding("utf-8");

    function print(x) {
      console.log(x);
    }
    let inputString = "";
    let currentLine = 0;

    process.stdin.on("data", (inputStdin) => {
      inputString += inputStdin;
    });
    process.stdin.on("end", () => {
      inputString = inputString.split("\n");
      main();
    });
    function readline() {
      return inputString[currentLine++];
    }

    // ********** Code Start **********

    function main() {
    	/*
      var a=readline();
    while(a--){
       var t=readline();
       var s=readline().split(" ");

       var c=[];
       var ex;

       for(let i=0;i<s.length;i++){
           if(c.indexOf(s[i])==-1){
               c.push(s[i])
           }else{
               ex=s[i]
           }
       }
    //    console.log(c,'kkkk')
    var ans=c.filter(data => data != ex);
       console.log(s.indexOf(ans[0])+1)
    }
    */
    var tc=readline();
while(tc--)
{
	let size=readline();
	const numbers=readline().split(' ');
	for(let i=0;i<size;i++)
	{
		let cnt=0;
		for(let j=0;j<size;j++)
		{
          if(numbers[i]==numbers[j])
              cnt++;

		}
		if(cnt==1)
		{
			var index=i+1;
			break;

		}

	}
	console.log(index);

}

    }

    "use strict";
    process.stdin.resume();
    process.stdin.setEncoding("utf-8");

    function print(x) {
      console.log(x);
    }
    let inputString = "";
    let currentLine = 0;

    process.stdin.on("data", (inputStdin) => {
      inputString += inputStdin;
    });
    process.stdin.on("end", () => {
      inputString = inputString.split("\n");
      main();
    });
    function readline() {
      return inputString[currentLine++];
    }

    // ********** Code Start **********

    function main() {
    	/*
      var a=readline();
    while(a--){
       var t=readline();
       var s=readline().split(" ");

       var c=[];
       var ex;

       for(let i=0;i<s.length;i++){
           if(c.indexOf(s[i])==-1){
               c.push(s[i])
           }else{
               ex=s[i]
           }
       }
    //    console.log(c,'kkkk')
    var ans=c.filter(data => data != ex);
       console.log(s.indexOf(ans[0])+1)
    }
    */
    var tc=readline();
while(tc--)
{
	let size=readline();
	const numbers=readline().split(' ');
	for(let i=0;i<size;i++)
	{
		let cnt=0;
		for(let j=0;j<size;j++)
		{
          if(numbers[i]==numbers[j])
              cnt++;

		}
		if(cnt===1)
		{
			var index=i+1;

		}

	}
	console.log(index);

}

    }

    "use strict";
    process.stdin.resume();
    process.stdin.setEncoding("utf-8");

    function print(x) {
      console.log(x);
    }
    let inputString = "";
    let currentLine = 0;

    process.stdin.on("data", (inputStdin) => {
      inputString += inputStdin;
    });
    process.stdin.on("end", () => {
      inputString = inputString.split("\n");
      main();
    });
    function readline() {
      return inputString[currentLine++];
    }

    // ********** Code Start **********

    function main() {
    	/*
      var a=readline();
    while(a--){
       var t=readline();
       var s=readline().split(" ");

       var c=[];
       var ex;

       for(let i=0;i<s.length;i++){
           if(c.indexOf(s[i])==-1){
               c.push(s[i])
           }else{
               ex=s[i]
           }
       }
    //    console.log(c,'kkkk')
    var ans=c.filter(data => data != ex);
       console.log(s.indexOf(ans[0])+1)
    }
    */
    var tc=readline();
while(tc--)
{
	let size=readline();
	const numbers=readline().split(' ');
	for(let i=0;i<size;i++)
	{
		let cnt=0;
		for(let j=0;j<size;j++)
		{
          if(numbers[i]==numbers[j])
              cnt++;

		}
		if(cnt===1)
		{
			var index=i+1;
			break;
		}

	}
	console.log(index);

}

    }

function main() {
  const useCases = readline();

  for (let i = 0; i < useCases; i++) {
    const arrayLength = readline();
    let unique = 0
    const arrayContent = readline().split(' ')
    const arrayContentSorted = arrayContent.slice().sort((a,b) => a - b);
    if (arrayContentSorted[0] === arrayContentSorted[1]) {
      unique = arrayContentSorted[arrayLength - 1]
    } else {
      unique = arrayContentSorted[0]
    }
    const uniqueIndex = arrayContent.indexOf(unique)
    console.log(uniqueIndex + 1)
  }
}

function main() {
  const useCases = readline();

  for (let i = 0; i < useCases; i++) {
    const arrayLength = readline();
    let unique = 0
    const arrayContent = readline().split(' ')
    const arrayContentSorted = arrayContent.slice().sort((a,b) => a - b);
    if (arrayContentSorted[0] === arrayContentSorted[1]) {
      unique = arrayContentSorted[arrayLength - 1]
    } else {
      unique = arrayContentSorted[0]
    }
    const uniqueIndex = arrayContent.indexOf(unique)
    print(uniqueIndex + 1)
  }
}

"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++];
}
// Make a Snippet for the code above this and then write your logic in main();

const getSpyIndex = (arrNum) => {
  let index;
  //   console.log("input string", arrNum);

  for (let i = 2; i < arrNum.length; i++) {
    if (arrNum[0] !== arrNum[i]) {
      if (arrNum[1] === arrNum[i]) {
        index = 0;
      } else {
        index = i;
      }
      break;
    } else if (i === 2) {
      index = 1;
      break;
    }
  }

  console.log(index + 1);
};

function main() {
  const numberOfTestCases = 1 * readline();
  // console.log("number of test cases", numberOfTestCases);
  Array.from({ length: numberOfTestCases }).forEach(() => {
    const arrayLength = 1 * readline();
    const arrayString = readline();
    const arr = arrayString.split(" ");
    const arrNum = arr.map((x) => +x);

    getSpyIndex(arrNum);
  });
}

'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() {
  let tests = parseInt(readline());
  while (tests--) {
    let len = parseInt(readline());
    let arr = readline().split(' ').map(Number);
    let left = 0;
    let right = len - 1;
    for (let i = 0; i < len; i++) {
      if (arr[left] === arr[right]) {
        left++;
        right--;
      } else {
        if (arr[left] === arr[left + 1]) {
          console.log(right + 1);
          break;
        }
        console.log(left + 1);
        break;
      }
    }
  }
}

'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() {
  let tests = parseInt(readline());
  while (tests--) {
    let len = parseInt(readline());
    let arr = readline().split(' ').map(Number);
    let left = 0;
    let right = len - 1;
    for (let i = 0; i < len; i++) {
      if (arr[left] === arr[right]) {
        left++;
        right--;
      } else {
        if (arr[left + 1] !== arr[right]) {
          console.log(right + 1);
          break;
        }
        console.log(left + 1);
        break;
      }
    }
  }
}

let i = '';
process.stdin.on('data', c => i += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = i.split(EOL); /*your input text, split by lines*/
    var number = lines[0].split(' ');
    var boyGirl = lines[1].split('');
    var answer = '';
    while(number[1]--){
        for(j = 1; j < number[0]; j++){
            if(boyGirl[j] == 'G' && boyGirl[j - 1] == 'B'){
                boyGirl[j] = 'B';
                boyGirl[j - 1] = 'G';
                j++;
            }
        }
    }
    answer = boyGirl.toString();
    answer.split(',');
    var a = '';
    for(k = 0; k < Number(number[0]) * 2 - 1;k++){
        if(k % 2 === 0){
            a += answer[k];
        }
    }
    console.log(a);
});

let i = '';
process.stdin.on('data', c => i += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = i.split(EOL); /*your input text, split by lines*/
    for(var j = 1; j <= lines[0] * 2; j += 2){
        var a = lines[j].split(' ');
        for(var k = 0; k <= a.length; k++){
            var l = k - 1;
            var r = k + 1;
            if(l == -1){
                l = a.length;
            }
            if(r == a.length){
                r = 0;
            }
            if(a[k] != a[l] && a[k] != a[r]){
                console.log(k + 1);
            }
        }

    }
});

"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf-8");

function print(x) {
  console.log(x);
}
let inputString = "";
let currentLine = 0;

process.stdin.on("data", (inputStdin) => {
  inputString += inputStdin;
});
process.stdin.on("end", () => {
  inputString = inputString.split("\n");
  main();
});
function readline() {
  return inputString[currentLine++];
}

// ********** Code Start **********

function main() {
  var a=readline();
while(a--){
   var t=readline();
   var s=readline().split(" ");

   var c=[];
   var ex;

   for(let i=0;i<s.length;i++){
       if(c.indexOf(s[i])==-1){
           c.push(s[i])
       }else{
           ex=s[i]
       }
   }
//    console.log(c,'kkkk')
var ans=c.filter(data => data != ex);
   console.log(s.indexOf(ans[0]))
}
}

"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf-8");

function print(x) {
  console.log(x);
}
let inputString = "";
let currentLine = 0;

process.stdin.on("data", (inputStdin) => {
  inputString += inputStdin;
});
process.stdin.on("end", () => {
  inputString = inputString.split("\n");
  main();
});
function readline() {
  return inputString[currentLine++];
}

// ********** Code Start **********

function main() {
  var a=readline();
while(a--){
   var t=readline();
   var s=readline().split(" ");
   var c=[];
   var ex;

   for(let i=0;i<s.length;i++){
       if(c.indexOf(s[i])==-1){
           c.push(s[i])
       }else{
           ex=s[i]
       }
   }
//    console.log(c,'kkkk')
var ans=c.filter(data => data != ex);
   console.log(ans[0])
}
}

// Common Template Starts //
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) => string.trim())
    main()
})

const readline = () => inputString[currentLine++]
// Common Template Ends //

// Driver Function Starts //
const main = () => {
    console.clear()
    let t = parseInt(readline())
    while (t--) {
        let n = parseInt(readline())
        let arr = readline().split(' ').map( Number )
        console.log( solve(arr) )
    }
}
// Driver Function Ends //

// MAIN LOGIC
const solve = (arr) => {
    let freq = new Array( 100 ).fill( 0 )

    for( let a of arr ) {
        freq[a]++
    }

    return ( arr.indexOf( freq.indexOf(1) )  + 1 )
}

const isOdd         = (num) => num & 1
const isEven        = (num) => !(num & 1)
const minOfArray    = (arr) => Math.min.apply(null, arr)
const maxOfArray    = (arr) => Math.max.apply(null, arr)
const uniqueArray   = (arr) => [...new Set(arr)]
const sortArray     = (arr) => arr.sort((a, b) => a - b)
const sumOfArray    = (arr) => arr.reduce((partialSum, a) => partialSum + a, 0)

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

let inputString = "";
let currentLine = 0;
let maxLine = 8;

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++];
}
// Make a Snippet for the code above this and then write your logic in main();

function main() {
  for (let i = 0; i <= maxLine; i++) {
    let x = readline();
    execute(x.split(" "));
  }
}

function execute(x) {
  // without auto '\n' (newline)
  // process.stdout.write("");
  // with auto '\n' (newline)
  // console.log(x);

  let data = {};
  let spy = null;

  if (x.length !== 1) {
    for (let i = 0; i < x.length; i++) {
      if (!data.hasOwnProperty(x[i])) {
        data[`${x[i]}`] = 1;
      } else {
        data[`${x[i]}`] += 1;
      }
    }

    for (const el in data) {
      if (data[el] === 1) {
        spy = el;
      }
    }

    for (let i = 0; i < x.length; i++) {
      if (x[i] === spy) {
        console.log(i + 1);
      }
    }
  }
}

function solve(arr, N) {
    const a = arr[0];
    const b = arr[1];
    const c = arr[2];
    if (a == b && b == c) {
        for (let i = 4; i < N; i++) {
            if (arr[i] != a) {
                return i + 1;
            }
        }
    } else if (a == b && b != c) {
        return 3;
    } else if (b == c && a != b) {
        return 1;
    } else {
        return 2;
    }
}

function processData(input) {
    //Enter your code here
    input = input.split('\n');
    const T = Number(input[0].trim());
    let i = 1;
    for (let t = 0; t < T; t++) {
        const N = Number(input[i++].trim());
        const arr = input[i++].trim().split(' ').map(Number);
        const ans = solve(arr, N);
        console.log(ans);
    }
}

process.stdin.resume();
process.stdin.setEncoding("ascii");
_input = "";
process.stdin.on("data", function (input) {
    _input += input;
});

process.stdin.on("end", function () {
    processData(_input);
});


We saw the little game Marmot made for Mole's lunch. Now it's Marmot's dinner time and, as we all know, Marmot eats flowers. At every dinner he eats some red and white flowers. Therefore a dinner can be represented as a sequence of several flowers, some of them white and some of them red.But, for a dinner to be tasty, there is a rule: Marmot wants to eat white flowers only in groups of size k.Now Marmot wonders in how many ways he can eat between a and b flowers. As the number of ways could be very large, print it modulo 1000000007 (109 + 7).

Input contains several test cases. The first line contains two integers t and k (1 ≤ t, k ≤ 105), where t represents the number of test cases. The next t lines contain two integers ai and bi (1 ≤ ai ≤ bi ≤ 105), describing the i-th test.

Print t lines to the standard output. The i-th line should contain the number of ways in which Marmot can eat between ai and bi flowers at dinner modulo 1000000007 (109 + 7).

Note  For K = 2 and length 1 Marmot can eat (R).  For K = 2 and length 2 Marmot can eat (RR) and (WW).  For K = 2 and length 3 Marmot can eat (RRR), (RWW) and (WWR).  For K = 2 and length 4 Marmot can eat, for example, (WWWW) or (RWWR), but for example he can't eat (WWWR).

var input = readline().split(' ').map(Number), t = input[0], k = input[1];
var res = [];
var sum = [];
res[0] = 1;
for (var i = 1; i <= 100000; i++) {
    res[i] = (i - k >= 0) ? ((res[i-1] + res[i-k]) % 1000000007) : res[i-1];
}
var currentSum = 0;
sum[0] = 0;
for (var i = 1; i <= 100000; i++) {
    currentSum = (currentSum  + res[i]) % 1000000007;
    sum[i] = currentSum;
}
var ans = '';
for (var i = 0; i < t; i++) {
    input = readline().split(' ').map(Number), a = input[0], b = input[1];
    var diff = sum[b] - sum[a-1];
    if (diff < 0) diff += 1000000007;
    ans += (diff + '\n');
}

write(ans);

var xx = readline().split(' ');
var t = parseInt(xx[0]);
var k = parseInt(xx[1]);
var MOD = 1000000007;
var a = new Array();
var b = new Array();
var n = 100000;
for(var i=1;i<k;i++)
{
    b[i]=1;
}
b[k]=2;
for(var i=k+1;i<=n;i++)
{
    b[i]=(b[i-1]+b[i-k])%MOD;
}
a[0]=0;
for(var i=1;i<=n;i++)
{
    a[i]=(a[i-1]+b[i])%MOD;
}
while(t--)
{
    var xxx = readline().split(' ');
	var ans = a[parseInt(xxx[1])]-a[parseInt(xxx[0])-1];
	if(ans<0)
	{
	    ans+=MOD;
	}
	print(ans);
}

var input = readline().split(' ').map(Number), t = input[0], k = input[1];
var res = [];
var sum = [];
res[0] = 1;
for (var i = 1; i < 100000; i++) {
    res[i] = (i - k >= 0) ? ((res[i-1] + res[i-k]) % 1000000007) : res[i-1];
}
var currentSum = 0;
sum[0] = 0;
for (var i = 1; i < 100000; i++) {
    currentSum = (currentSum  + res[i]) % 1000000007;
    sum[i] = currentSum;
}
var ans = '';
for (var i = 0; i < t; i++) {
    input = readline().split(' ').map(Number), a = input[0], b = input[1];
    var diff = sum[b] - sum[a-1];
    ans += (diff + '\n');
}

write(ans);

var input = readline().split(' ').map(Number), t = input[0], k = input[1];
var res = [];
var sum = [];
res[0] = 1;
for (var i = 1; i < 100000; i++) {
    res[i] = (i - k >= 0) ? ((res[i-1] + res[i-k]) % 1000000007) : res[i-1];
}
var currentSum = 0;
sum[0] = 0;
for (var i = 1; i < 100000; i++) {
    currentSum = (currentSum  + res[i]) % 1000000007;
    sum[i] = currentSum;
}
var ans = '';
for (var i = 0; i < t; i++) {
    input = readline().split(' ').map(Number), a = input[0], b = input[1];
    var diff = sum[b] - sum[a-1];
    if (diff < 0) diff += 1000000007;
    ans += (diff + '\n');
}

write(ans);


You are given two arrays $$$a$$$ and $$$b$$$ of $$$n$$$ elements, each element is either $$$0$$$ or $$$1$$$.You can make operations of $$$2$$$ kinds.   Pick an index $$$i$$$ and change $$$a_i$$$ to $$$1-a_i$$$.  Rearrange the array $$$a$$$ however you want. Find the minimum number of operations required to make $$$a$$$ equal to $$$b$$$.

Each test contains multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 400$$$) — the number of test cases. Description of the test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 100$$$) — the length of the arrays $$$a$$$ and $$$b$$$. The second line of each test case contains $$$n$$$ space-separated integers $$$a_1,a_2,\ldots,a_n$$$ ($$$a_i$$$ is $$$0$$$ or $$$1$$$), representing the array $$$a$$$. The third line of each test case contains $$$n$$$ space-separated integers $$$b_1,b_2,\ldots,b_n$$$ ($$$b_i$$$ is $$$0$$$ or $$$1$$$), representing the array $$$b$$$.

For each test case, print the minimum number of operations required to make $$$a$$$ equal to $$$b$$$.

NoteIn the first case, we need only one operation: change $$$a_1$$$ to $$$1-a_i$$$. Now $$$a = [0, 0]$$$ which is equal to $$$b$$$.In the second case, the optimal way is to rearrange $$$a$$$ to get the array $$$[0, 1, 11$$$. Now $$$a = [0, 0, 1]$$$ which is equal to $$$b$$$.In the second case, one of optimal ways would be to first change $$$a_3$$$ to $$$1 - a_3$$$, then rearrange $$$a$$$.In the third case, no operation is needed.In the fourth case, the optimal way is to rearrange $$$a$$$ to get the array $$$[0, 1, 1, 0]$$$.

// Common Template Starts //
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) => string.trim())
    main()
})

const readline = () => inputString[currentLine++]
// Common Template Ends //

// Driver Function Starts //
const main = () => {
    console.clear()
    let t = parseInt(readline())
    while (t--) {
        let n = parseInt(readline())
        let a = readline()
        let b = readline()
        console.log( solve( n, a, b ) )
    }
}
// Driver Function Ends //

// MAIN LOGIC
const solve = (n, a, b) => {
    if( a === b ) return 0
    if( n === 1 && a !== b ) return 1

    a = a.split(' ').map( Number )
    b = b.split(' ').map( Number )

    let ones_a = 0
    for(let i = 0; i < n; i++) {
        if( a[i] == 1 ) ones_a++
    }

    let ones_b = 0
    for(let i = 0; i < n; i++) {
        if( b[i] == 1 ) ones_b++
    }

    let diff = Math.abs(ones_a - ones_b)

    let res = 0
    for(let i = 0; i < n; i++) {
        if(a[i] != b[i]) res++
    }

    return Math.min( res, diff + 1 )
}

const isOdd         = (num) => num & 1
const isEven        = (num) => !(num & 1)
const minOfArray    = (arr) => Math.min.apply(null, arr)
const maxOfArray    = (arr) => Math.max.apply(null, arr)
const uniqueArray   = (arr) => [...new Set(arr)]
const sortArray     = (arr) => arr.sort((a, b) => a - b)
const sumOfArray    = (arr) => arr.reduce((partialSum, a) => partialSum + a, 0)

'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(n),
        b = rns(n);
  let x = a.reduce((a, b) => a + b, 0),
      y = b.reduce((a, b) => a + b, 0);
  let dif = x - y;
  let res = Math.abs(dif);
  for (let i = 0; i < n && dif; i++) {
    if (dif > 0) {
      if (a[i] !== b[i] && a[i]) {
        a[i] = 0;
        dif--;
      }
    } else if (dif < 0) {
      if (a[i] !== b[i] && !a[i]) {
        a[i] = 1;
        dif++;
      }
    }
  }
  for (let i = 0; i < n; i++) {
    if (a[i] !== b[i]) {
      res++;
      break;
    }
  }
  return res;
}
function convertInput(read) {
  const rn = () => Number(read());
  const rb = () => BigInt(read());
  const rns = n => {
    let res = new Array(n);
    for (let i = 0; i < n; i++) res[i] = rn();
    return res;
  };
  const re = n => {
    let res = new Array(n);
    for (let i = 0; i < n; i++) res[i] = rn() - 1;
    return res;
  };
  const rbs = n => {
    let res = new Array(n);
    for (let i = 0; i < n; i++) res[i] = rb();
    return res;
  };
  return [rn, rb, rns, re, rbs];
}
function main(r) {
  const [rn, rb, rns, re, rbs] = convertInput(r);
  try {
    let t = rn();
    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(/\s+/);
void function () {
  const read = ((i = 0) => () => inputs[i++])();
  const output = main(read);
  process.stdout.write(output);
}();