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.

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	var (
		t   int
		n   int
		nsl []int
		tn  int
	)
	buffer := bufio.NewReader(os.Stdin)
	ts, _, _ := buffer.ReadLine()
	t, _ = strconv.Atoi(string(ts))
	for i := 0; i < t; i++ {
		nsl = nil
		n = 0
		ns, _, _ := buffer.ReadLine()
		n, _ = strconv.Atoi(string(ns))
		tempstr, _, _ := buffer.ReadLine()
		sl := strings.Split(string(tempstr), " ")
		for j := 0; j < n; j++ {
			tn, _ = strconv.Atoi(sl[j])
			nsl = append(nsl, tn)
		}
		count := CountValue(nsl)
		uniq := UniqueValue(count)
		fmt.Println(IndexOf(uniq, nsl) + 1)
	}
}

func CountValue(arr []int) (res map[int]int) {
	dict := make(map[int]int)
	for _, num := range arr {
		dict[num] = dict[num] + 1
	}
	res = dict
	return
}
func UniqueValue(dict map[int]int) int {
	for k, v := range dict {
		if 1 == v {
			return k
		}
	}
	return -1
}

func IndexOf(element int, slice []int) int {
	for k, v := range slice {
		if element == v {
			return k
		}
	}
	return -1
}

package main

import (
	"bufio"
	. "fmt"
	"os"
	"strconv"
	"strings"
)

type arrWithIndex struct {
	count int
	idx   int
}

func (in *A) run(out *bufio.Writer) {
	T := in.nextInt()
	for t := 0; t < T; t++ {
		n := in.nextInt()
		mp := map[int]arrWithIndex{}
		for i := 0; i < n; i++ {
			x := in.nextInt()
			mp[x] = arrWithIndex{count: mp[x].count + 1, idx: i}
		}

		for _, v := range mp {
			if v.count == 1 {
				Fprintln(out, v.idx+1)
				Println(v.idx + 1)
				break
			}
		}
	}
}

func main() {
	var F *bufio.Reader
	var W *bufio.Writer
	in, inErr := os.Open("in.txt")
	out, outErr := os.Open("out.txt")
	if inErr == nil {
		F = bufio.NewReader(in)
	} else {
		F = bufio.NewReader(os.Stdin)
	}
	if outErr == nil {
		W = bufio.NewWriter(out)
	} else {
		W = bufio.NewWriter(os.Stdout)
	}
	defer func(file *os.File) {
		_ = file.Close()
	}(in)
	defer func(file *os.File) {
		_ = file.Close()
	}(out)
	NewA(F).run(W)
}

func NewA(r *bufio.Reader) *A {
	return &A{
		in:        r,
		split:     []string{},
		index:     0,
		separator: " ",
	}
}

type A struct {
	in        *bufio.Reader
	split     []string
	index     int
	separator string
}

func (in *A) GetLine() string {
	line, err := in.in.ReadString('\n')
	if err != nil {
		Println("error line:", line, " err: ", err)
	}
	in.split = []string{}
	in.index = 0
	return line
}

func (in *A) load() {
	if len(in.split) <= in.index {
		in.split = strings.Split(in.GetLine(), in.separator)
		in.index = 0
	}
}

func (in *A) nextInt() int {
	in.load()
	val, _ := strconv.Atoi(strings.TrimSpace(in.split[in.index]))
	in.index++
	return val
}

func (in *A) nextInt64() int64 {
	in.load()
	val, _ := strconv.ParseInt(strings.TrimSpace(in.split[in.index]), 10, 64)
	in.index++
	return val
}

func (in *A) nextString() string {
	in.load()
	val := strings.TrimSpace(in.split[in.index])
	in.index++
	return val
}

package main

import (
	"bufio"
	. "fmt"
	"os"
	"strconv"
	"strings"
)

type arrWithIndex struct {
	count int
	idx   int
}

func (in *A) run(out *bufio.Writer) {
	T := in.nextInt()
	for t := 0; t < T; t++ {
		n := in.nextInt()
		mp := map[int]arrWithIndex{}
		for i := 0; i < n; i++ {
			x := in.nextInt()
			mp[x] = arrWithIndex{count: mp[x].count + 1, idx: i}
		}

		for _, v := range mp {
			if v.count == 1 {
				Fprintln(out, v.idx+1)
				Println(v.idx + 1)
				break
			}
		}
	}
}

func main() {
	var F *bufio.Reader
	var W *bufio.Writer
	in, inErr := os.Open("in.txt")
	out, outErr := os.Open("out.txt")
	if inErr == nil {
		F = bufio.NewReader(in)
	} else {
		F = bufio.NewReader(os.Stdin)
	}
	if outErr == nil {
		W = bufio.NewWriter(out)
		defer W.Flush()
	} else {
		W = bufio.NewWriter(os.Stdout)
	}
	defer func(file *os.File) {
		_ = file.Close()
	}(in)
	defer func(file *os.File) {
		_ = file.Close()
	}(out)
	NewA(F).run(W)
}

func NewA(r *bufio.Reader) *A {
	return &A{
		in:        r,
		split:     []string{},
		index:     0,
		separator: " ",
	}
}

type A struct {
	in        *bufio.Reader
	split     []string
	index     int
	separator string
}

func (in *A) GetLine() string {
	line, err := in.in.ReadString('\n')
	if err != nil {
		Println("error line:", line, " err: ", err)
	}
	in.split = []string{}
	in.index = 0
	return line
}

func (in *A) load() {
	if len(in.split) <= in.index {
		in.split = strings.Split(in.GetLine(), in.separator)
		in.index = 0
	}
}

func (in *A) nextInt() int {
	in.load()
	val, _ := strconv.Atoi(strings.TrimSpace(in.split[in.index]))
	in.index++
	return val
}

func (in *A) nextInt64() int64 {
	in.load()
	val, _ := strconv.ParseInt(strings.TrimSpace(in.split[in.index]), 10, 64)
	in.index++
	return val
}

func (in *A) nextString() string {
	in.load()
	val := strings.TrimSpace(in.split[in.index])
	in.index++
	return val
}

package main

import (
	"bufio"
	. "fmt"
	"os"
	"strconv"
	"strings"
)

type arrWithIndex struct {
	count int
	idx   int
}

func (in *A) run() {
	out := bufio.NewWriter(os.Stdout)
	T := in.nextInt()
	for t := 0; t < T; t++ {
		n := in.nextInt()
		mp := map[int]arrWithIndex{}
		for i := 0; i < n; i++ {
			x := in.nextInt()
			mp[x] = arrWithIndex{count: mp[x].count + 1, idx: i}
		}

		for _, v := range mp {
			if v.count == 1 {
				Fprintln(out, v.idx+1)
				Println(v.idx + 1)
				break
			}
		}
	}
}

func main() {
	file, err := os.Open("input.txt")
	var F *bufio.Reader
	if err == nil {
		F = bufio.NewReader(file)
		os.Stdin = file
	} else {
		F = bufio.NewReader(os.Stdin)
	}
	defer func(file *os.File) {
		_ = file.Close()
	}(file)
	NewA(F).run()
}

func NewA(r *bufio.Reader) *A {
	return &A{
		in:        r,
		split:     []string{},
		index:     0,
		separator: " ",
	}
}

type A struct {
	in        *bufio.Reader
	split     []string
	index     int
	separator string
}

func (in *A) GetLine() string {
	line, err := in.in.ReadString('\n')
	if err != nil {
		Println("error line:", line, " err: ", err)
	}
	in.split = []string{}
	in.index = 0
	return line
}

func (in *A) load() {
	if len(in.split) <= in.index {
		in.split = strings.Split(in.GetLine(), in.separator)
		in.index = 0
	}
}

func (in *A) nextInt() int {
	in.load()
	val, _ := strconv.Atoi(strings.TrimSpace(in.split[in.index]))
	in.index++
	return val
}

func (in *A) nextInt64() int64 {
	in.load()
	val, _ := strconv.ParseInt(strings.TrimSpace(in.split[in.index]), 10, 64)
	in.index++
	return val
}

func (in *A) nextString() string {
	in.load()
	val := strings.TrimSpace(in.split[in.index])
	in.index++
	return val
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

type arrWithIndex struct {
	count int
	idx   int
}

func (in *A) run() {
	T := in.nextInt()
	for t := 0; t < T; t++ {
		n := in.nextInt()
		mp := map[int]arrWithIndex{}
		for i := 0; i < n; i++ {
			x := in.nextInt()
			mp[x] = arrWithIndex{count: mp[x].count + 1, idx: i}
		}

		for _, v := range mp {
			if v.count == 1 {
				fmt.Println(v.idx + 1)
				break
			}
		}
	}
}

func main() {
	file, err := os.Open("input.txt")
	var F *bufio.Reader
	if err == nil {
		F = bufio.NewReader(file)
		os.Stdin = file
	} else {
		F = bufio.NewReader(os.Stdin)
	}
	defer func(file *os.File) {
		_ = file.Close()
	}(file)
	NewA(F).run()
}

func NewA(r *bufio.Reader) *A {
	return &A{
		in:        r,
		split:     []string{},
		index:     0,
		separator: " ",
	}
}

type A struct {
	in        *bufio.Reader
	split     []string
	index     int
	separator string
}

func (in *A) GetLine() string {
	line, err := in.in.ReadString('\n')
	if err != nil {
		fmt.Println("error line:", line, " err: ", err)
	}
	in.split = []string{}
	in.index = 0
	return line
}

func (in *A) load() {
	if len(in.split) <= in.index {
		in.split = strings.Split(in.GetLine(), in.separator)
		in.index = 0
	}
}

func (in *A) nextInt() int {
	in.load()
	val, _ := strconv.Atoi(strings.TrimSpace(in.split[in.index]))
	in.index++
	return val
}

func (in *A) nextInt64() int64 {
	in.load()
	val, _ := strconv.ParseInt(strings.TrimSpace(in.split[in.index]), 10, 64)
	in.index++
	return val
}

func (in *A) nextString() string {
	in.load()
	val := strings.TrimSpace(in.split[in.index])
	in.index++
	return val
}

package main

import (
	"fmt"
	"sort"
)

func solve() {
	var n int
	fmt.Scanf("%d\n", &n)
	arr := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scanf("%d", &arr[i])
	}
	fmt.Scanf("\n")

	temp := make([]int, n)
	copy(temp, arr)

	sort.Ints(temp)

	for i := 0; i < n; i++ {
		if arr[i] != temp[1] {
			fmt.Println(i + 1)
		}
	}
}

func main() {
	var t int
	fmt.Scanf("%d\n", &t)

	for ; t > 0; t-- {
		solve()
	}
}

package main

import "fmt"

func main()  {
	var cases uint
	fmt.Scanln(&cases)

	for cases > 0 {

		cases--

		var n uint
		na, err := fmt.Scanln(&n)
		if err != nil {
			fmt.Println("::",na, err)
		}
		numbers := []int{}
		for n > 0 {
			n--
			var number int
			num, err := fmt.Scanf("%d", &number)
			if err != nil {
				fmt.Println(num, err)
			}
			numbers = append(numbers, number)
		}
		var nLine string
		fmt.Scanf("%s", &nLine)

		var target int
		if numbers[0] == numbers[1] || numbers[0] == numbers[2] {
			target = numbers[0]
		}

		if numbers[1] == numbers[2] {
			target = numbers[1]
		}

		for index, number := range numbers {
			if number != target {
				fmt.Println(index + 1)
				break
			}
		}
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

type CF1512A struct {
	sc        *bufio.Reader
	split     []string
	index     int
	separator string
}

func (in *CF1512A) GetLine() string {
	line, err := in.sc.ReadString('\n')
	if err != nil {
		fmt.Println("error line:", line, " err: ", err)
	}
	in.split = []string{}
	in.index = 0
	return line
}
func (in *CF1512A) load() {
	if len(in.split) <= in.index {
		in.split = strings.Split(in.GetLine(), in.separator)
		in.index = 0
	}
}

func (in *CF1512A) NextInt() int {
	in.load()
	val, _ := strconv.Atoi(strings.TrimSpace(in.split[in.index]))
	in.index++
	return val
}

func (in *CF1512A) NextInt64() int64 {
	in.load()
	val, _ := strconv.ParseInt(strings.TrimSpace(in.split[in.index]), 10, 64)
	in.index++
	return val
}

func (in *CF1512A) NextString() string {
	in.load()
	val := strings.TrimSpace(in.split[in.index])
	in.index++
	return val
}

/**
 Run solve the problem CF1512A
 Date: 16/05/21
 User: pepradere
 URL: https://codeforces.com/problemset/problem/1512/A
 Problem: CF1512A
**/
func (in *CF1512A) Run() {
	t := in.NextInt()
	for ; t > 0; t-- {
		n := in.NextInt()
		data := map[int][]int{}
		for i := 0; n > 0; n-- {
			val := in.NextInt()
			_, ok := data[val]
			if !ok {
				data[val] = []int{0, i}
			}
			data[val][0] = data[val][0] + 1
			i++
		}

		for d := range data {
			if data[d][0] == 1 {
				fmt.Println(data[d][1]+1)
			}
		}

	}
}

func NewCF1512A(r *bufio.Reader) *CF1512A {
	return &CF1512A{
		sc:        r,
		split:     []string{},
		index:     0,
		separator: " ",
	}
}

func main() {
	NewCF1512A(bufio.NewReader(os.Stdin)).Run()
}

package main

import (
	"fmt"
	"log"
)

type Element struct {
	Order int
	Count int
}

func main()  {
	var num int
	_, err := fmt.Scan(&num)
	if err != nil {
		log.Fatal("t scan error")
	}
	for i := 0; i < num; i++ {
		var arrayValues int
		_, err := fmt.Scan(&arrayValues)
		if err != nil {
			log.Fatal("n scan error")
		}
		counter := map[int] *Element{}
		values := make([]int, arrayValues, arrayValues)
		for j := 0; j < arrayValues; j++ {
			_, err := fmt.Scan(&values[j])
			if err != nil {
				log.Fatal("array scanning error")
			}
		}

		for index, value := range values {
			_, ok := counter[value]
			if ok {
				counter[value].Count += 1
			} else {
				counter[value] = &Element{Order: index + 1, Count: 1}
			}
		}
		for _, value := range counter {
			if value.Count == 1 {
				fmt.Printf("%d\n", value.Order)
				break
			}
		}
	}
}

package main

import (
	"fmt"
)

func question01(arr []int, arrSize int) int {
	index := -1
	for i :=0 ; i< arrSize - 2; i++ {
		if arr[i] != arr[i+1] || arr[i] != arr[i+2] {			// 4 =/= 5
			if arr[i] == arr[i+2] {
				index = i+1
			}	else if arr[i] == arr[i+1] {
				index = i +2
			} else {
				index = i
			}
		}
	}
	return index+1
}

func main() {
	var testCases int
	fmt.Scanf("%d\n", &testCases)
	for i:=0; i< testCases ; i++ {
		var arrSize int
		fmt.Scanf("%d\n", &arrSize)
		arrs := make([]int, arrSize)
		for i, _ := range arrs {
			if i == arrSize -1 {
				fmt.Scanf("%d\n", &arrs[i])
			} else {
				fmt.Scanf("%d", &arrs[i])
			}

		}
		fmt.Println(question01(arrs, arrSize))
	}
}

package main

import (
	"fmt"
	//"os"
	"sort"
)

func main() {

	var n int
	fmt.Scan(&n)

	var list [][]int = make([][]int,n)
	for i:=0;i<n;i++{
		var holder int
		fmt.Scan(&holder)
		list[i] = make([]int,0,holder)
		for j:=0;j<holder;j++{
			var inner_holder int
			fmt.Scan(&inner_holder)
			list[i] = append(list[i], inner_holder)
		}
	}

	newlist := duplicate_2d_slice(n, list)

	for i:=0;i<len(list);i++{

		sort.Ints(newlist[i])

		var smallest int = smallest_int(newlist[i])
		var largest int = largest_int(newlist[i])

		var other int
		if smallest != newlist[i][1] {
			other = smallest
		} else {
			other = largest
		}

		for key,value := range list[i] {
			if value == other {
				fmt.Println(key+1)
				break
			}
		}
	}
}

func duplicate_2d_slice(length int, original_slice [][]int) [][]int {
    var newlist [][]int = make([][]int,length)
    for i:=0;i<length;i++{
        newlist[i] = make([]int,0,len(original_slice[i]))
        for j:=0;j<len(original_slice[i]);j++{
            newlist[i] = append(newlist[i], original_slice[i][j])
        }
    }
    return newlist
}

func smallest_int(list []int) int {
    for i:=0;i<len(list);i++{
        if list[0] > list[i] {
            list[0] = list[i]
        }
    }
    return list[0]
}

func largest_int(list []int) int {
    for i:=0;i<len(list);i++{
        if list[0] < list[i] {
            list[0] = list[i]
        }
    }
    return list[0]
}

package main

import "fmt"

func main() {
	var T int
	fmt.Scan(&T)

	for t := 0; t < T; t++ {
		var n, d int
		fmt.Scan(&n)

		var pos [101]int
		mp := make(map[int]int)

		for i := 0; i < n; i++ {
			fmt.Scan(&d)
			pos[d] = i + 1
			mp[d]++
		}

		for key, val := range mp {
			if val == 1 {
				fmt.Println(pos[key])
				break
			}
		}
	}
}

package main

import "fmt"

func main() {

	var T int
	fmt.Scan(&T)
	for T > 0 {
		T--
		var size int
		fmt.Scan(&size)

		counter := map[int]int{}
		indexer := map[int]int{}

		for i := 0; i < size; i++ {
			var num int
			fmt.Scan(&num)
			counter[num]++
			indexer[num] = i + 1
		}

		for k, v := range counter {
			if v == 1 {
				fmt.Println(indexer[k])
			}
		}

	}
}

package main

import "fmt"

func findSpy(arr []int) int {
	counts := make(map[int]int)
	for i := 0; i < 3; i++ {
		counts[arr[i]]++
	}
	if len(counts) > 1 {
		for k, v := range counts {
			if v == 1 {
				for i := 0; i < 3; i++ {
					if k == arr[i] {
						return i + 1
					}
				}
			}
		}
	}
	var okVal int
	for k, _ := range counts {
		okVal = k
	}
	for i, v := range arr {
		if v != okVal {
			return i + 1
		}
	}
	return -1
}

func main() {
	var nTests int
	fmt.Scanf("%d\n", &nTests)
	for i := 0; i < nTests; i++ {
		var len int
		fmt.Scanf("%d\n", &len)
		arr := make([]int, len)
		for j := 0; j < len; j++ {
			fmt.Scanf("%d", &arr[j])
		}
		fmt.Scanf("\n")
		fmt.Println(findSpy(arr))
	}
}

package main

import "fmt"
var cnt[101] int
var a[101] int

func solve()  {
	var n int
	for j := 0; j <= 100; j++ {cnt[j] = 0;}
	fmt.Scan(&n)
	for j := 1; j <= n; j++ {
		fmt.Scan(&a[j]); cnt[a[j]]++;
	}
	for j := 1; j <= n; j++ {
		if(cnt[a[j]] == 1) {fmt.Println(j); break;}
	}
}
func main()  {
	var t int
	fmt.Scanf("%d", &t)
	for i := 1; i <= t; i++ {solve()}
}

package main

import (
	"bufio"
	. "fmt"
	"os"
)

var in *bufio.Reader = bufio.NewReader(os.Stdin)
var out *bufio.Writer = bufio.NewWriter(os.Stdout)

func main() {
	defer out.Flush()

	var t int
	Fscan(in, &t)

	for i := 0; i < t; i++ {
		var n int
		m := make(map[int]int)
		idx := make(map[int]int)

		Fscan(in, &n)
		for j := 0; j < n; j++ {
			var temp int
			Fscan(in, &temp)
			m[temp]++
			idx[temp] = j + 1
		}

		for k, v := range m {
			if v == 1 {
				Fprintln(out, idx[k])
			}
		}
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }

func main() {
	defer writer.Flush()

	var t int
	scanf("%d\n", &t)

	for i := 0; i < t; i++ {
		var n int
		m := make(map[int]int)
		idx := make(map[int]int)

		scanf("%d\n", &n)

		for j := 0; j < n; j++ {
			var temp int
			if j != n-1 {
				scanf("%d ", &temp)
			} else {
				scanf("%d\n", &temp)
			}
			m[temp]++
			idx[temp] = j + 1
		}

		for k, v := range m {
			if v == 1 {
				printf("%d\n", idx[k])
			}
		}
	}
}

package main

import "fmt"

func main() {
	var t int
	_, _ = fmt.Scan(&t)

	for i := 1; i <= t; i++ {
		var n int
		_, _ = fmt.Scan(&n)

		arr := make([]int, n)

		for j := 0; j < n; j++ {
			_, _ = fmt.Scan(&arr[j])
		}

		for j := 1; j < n; j++ {
			if j == 1 && arr[j] != arr[0] && arr[j] == arr[j+1] {
				fmt.Println(1)
				break
			}
			if arr[j] != arr[0] {
				fmt.Println(j + 1)
				break
			}
		}
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

type float = float32
type double = float64
type long = int64
type ulong = uint64

type Readable interface {
	bool | int | uint64 | int64 | double | float | byte
}

var (
	in  = bufio.NewReader(os.Stdin)
	out = bufio.NewWriter(os.Stdout)
)

func print(arg ...interface{})            { fmt.Fprint(out, arg...) }
func println(arg ...interface{})          { fmt.Fprintln(out, arg...) }
func printf(f string, arg ...interface{}) { fmt.Fprintf(out, f, arg...) }
func scanf(f string, arg ...interface{})  { fmt.Fscanf(in, f, arg...) }

func readLn() string {
	ln, err := in.ReadString('\n')
	if err != nil {
		panic(err)
	}

	return strings.Trim(ln, " \n\r")
}

func readString() string {
	return readLn()
}

func readStrings() []string {
	return strings.Split(readLn(), " ")
}

func read[T Readable](f func(string) (T, error), input ...string) T {
	if len(input) == 0 {
		input = []string{readLn()}
	}

	res, err := f(input[0])
	if err != nil {
		panic(err)
	}

	return res
}

func readMany[T Readable](f func(...string) T) []T {
	input := readStrings()
	arr := make([]T, len(input))
	for i := 0; i < len(arr); i++ {
		arr[i] = f(input[i])
	}

	return arr
}

func readBool(input ...string) bool {
	return read(strconv.ParseBool, input...)
}

func readInt(input ...string) int {
	return read(strconv.Atoi, input...)
}

func readByte(input ...string) byte {
	return byte(read(func(s string) (uint64, error) {
		return strconv.ParseUint(s, 10, 8)
	}, input...))
}

func readDouble(input ...string) double {
	return read(func(s string) (float64, error) {
		return strconv.ParseFloat(s, 64)
	}, input...)
}

func readFloat(input ...string) float {
	return float32(read(func(s string) (float64, error) {
		return strconv.ParseFloat(s, 32)
	}, input...))
}

func readLong(input ...string) long {
	return read(func(s string) (int64, error) {
		return strconv.ParseInt(s, 10, 64)
	}, input...)
}

func readULong(input ...string) ulong {
	return read(func(s string) (uint64, error) {
		return strconv.ParseUint(s, 10, 64)
	}, input...)
}

func readBinary(input ...string) long {
	return read(func(s string) (int64, error) {
		return strconv.ParseInt(s, 2, 64)
	}, input...)
}

func readBools() []bool {
	return readMany(readBool)
}

func readInts() []int {
	return readMany(readInt)
}

func readBytes() []byte {
	return readMany(readByte)
}

func readDoubles() []double {
	return readMany(readDouble)
}

func readFloats() []float {
	return readMany(readFloat)
}

func readLongs() []long {
	return readMany(readLong)
}

func readULongs() []ulong {
	return readMany(readULong)
}

func main() {
	defer out.Flush()

	// solution
	t := readInt()
	ans := make([]int, t)
	for i := 0; i < t; i++ {
		n := readInt()
		arr := readInts()
		for j := 0; j < n; j++ {
			if j == 0 {
				if arr[j] != arr[j+1] && arr[j] != arr[j+2] {
					ans[i] = j
					break
				}
			} else if j == n-1 {
				if arr[j] != arr[j-1] && arr[j] != arr[j-2] {
					ans[i] = j
					break
				}
			} else if arr[j-1] != arr[j] && arr[j] != arr[j+1] {
				ans[i] = j
				break
			}
		}
	}
	for i := 0; i < t; i++ {
		println(ans[i] + 1)
	}
}

func abs(x int) int {
	if x < 0 {
		return -x
	}

	return x
}

func max(x, y int) int {
	if x > y {
		return x
	}

	return y
}

func min(x, y int) int {
	if x > y {
		return y
	}

	return x
}

/*
You are given an array a consisting of n (n≥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.
Input

The first line contains a single integer t
(1≤t≤100). Then t

test cases follow.

The first line of each test case contains a single integer n
(3≤n≤100) — the length of the array a

.

The second line of each test case contains n
integers a1,a2,…,an (1≤ai≤100

).

It is guaranteed that all the numbers except one in the a

array are the same.
Output

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

package main

import "fmt"

func main() {
	var t int
	fmt.Scan(&t)
	for i := 0; i < t; i++ {
		var n int
		fmt.Scan(&n)
		a := make([]int, n)
		for j := 0; j < n; j++ {
			fmt.Scan(&a[j])
		}
		var correct int
		if a[0] != a[1] {
			if a[0] != a[2] {
				correct = a[1]
			} else {
				correct = a[0]
			}
		} else {
			correct = a[0]
		}
		for j := 0; j < n; j++ {
			if a[j] != correct {
				fmt.Println(j + 1)
				break
			}
		}
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func Fprintf(format string, x ...interface{}) {
	fmt.Fprintf(writer, format, x...)
}

func Fscanf(format string, x ...interface{}) {
	fmt.Fscanf(reader, format, x...)
}

func Solution() {
	var caseCount int
	Fscanf("%d\n", &caseCount)

	var numCount, num int

	for caseIndex := 0; caseIndex < caseCount; caseIndex++ {
		Fscanf("%d\n", &numCount)

		counter := map[int]int{}
		indices := map[int]int{}

		Fscanf("%d", &num)
		counter[num]++
		indices[num] = 1

		Fscanf("%d", &num)
		counter[num]++
		indices[num] = 2

	nextCase:
		for numIndex := 3; numIndex <= numCount; numIndex++ {
			Fscanf("%d", &num)

			counter[num]++
			indices[num] = numIndex

			for oneKey, oneValue := range counter {
				if oneValue >= 2 {
					for otherKey := range counter {
						if otherKey != oneKey {
							Fprintf("%d\n", indices[otherKey])
							for newIndex := numIndex + 1; newIndex <= numCount; newIndex++ {
								Fscanf("%d", &num)
							}
							Fscanf("\n")

							break nextCase
						}
					}
				}
			}
		}
	}
}

func main() {
	Solution()
	writer.Flush()
}

// 1512A. Spy Detected!
package main

import (
	"fmt"
)

func main() {
	var T, n, curr, first, second int
	fmt.Scan(&T)
	for t := 1; t <= T; t++ {
		fmt.Scan(&n)
		equal := -1
		ans := -1
		for i := 1; i <= n; i++ {
			if i == 1 {
				fmt.Scan(&first)
			} else if i == 2 {
				fmt.Scan(&second)
				if first == second {
					equal = first
				}
			} else {
				fmt.Scan(&curr)
				if equal == -1 {
					if first == curr {
						equal = first
						ans = 2
					} else {
						equal = second
						ans = 1
					}
				} else {
					if curr != equal {
						ans = i
					}
				}
			}
		}
		fmt.Println(ans)
	}

}

package main

import (
	"bufio"
	"fmt"
	"os"
)

var reader = bufio.NewReader(os.Stdin)

func ri() int {
	var x int
	c, _ := reader.ReadByte()
	for c < '0' || c > '9' {
		c, _ = reader.ReadByte()
	}
	for '0' <= c && c <= '9' {
		x = (x << 3) + (x << 1) + int(c) - '0'
		c, _ = reader.ReadByte()
	}
	return x
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

const MAXN = 2e5 + 5

func Solve() {
	var a []int
	n := ri()
	for i := 0; i < n; i++ {
		a = append(a, ri())
	}
	for i := 0; i < n; i++ {
		cnt := 0
		for j := 0; j < n; j++ {
			if a[i] != a[j] {
				cnt++
			}
		}
		if cnt == n-1 {
			fmt.Println(i + 1)
			return
		}
	}
}

func main() {
	var T = 0
	if T == 0 {
		fmt.Scan(&T)
	}
	for t := 1; t <= T; t++ {
		Solve()
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

func solve() {
	f := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)
	N, n := 0, 0
	fmt.Fscan(f, &N)
	for i := 0; i < N; i++ {
		fmt.Fscan(f, &n)
		p, m := 0, map[int][2]int{}
		for j := 0; j < n; j++ {
			fmt.Fscan(f, &p)
			v, ok := m[p]
			if ok {
				v[0]++
				m[p] = v
			} else {
				m[p] = [2]int{1, j + 1}
			}
		}
		for _, v := range m {
			if v[0] == 1 {
				fmt.Fprintln(w, v[1])
			}
		}
	}
	w.Flush()
}

func main() {
	solve()
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	var t int
	r, w := bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)
	defer w.Flush()

	fmt.Fscan(r, &t)
	for i := 0; i < t; i++ {
		var n int
		fmt.Fscan(r, &n)
		numbers := make([]int, n)

		for j := 0; j < n; j++ {
			fmt.Fscan(r, &numbers[j])
		}

		for j := range numbers {
			if numbers[j] != numbers[(j+1)%n] && numbers[j] != numbers[(j+2)%n] {
				fmt.Fprintln(w, j+1)
				break
			}
		}
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

func main() {
	var cases int
	fmt.Scanln(&cases)
	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)

	for ; cases > 0; cases-- {
		n := parseInt(getString(reader))

		array := getIntln(reader)

		writer.WriteString(fmt.Sprintf("%d\n", getDiffindex(array, n)))
	}
	writer.Flush()
}

func getDiffindex(A []int, n int) int {
	first, last, lastSecond := A[0], A[n-1], A[n-2]

	if last != lastSecond {
		if last == first {
			return n - 1
		} else {
			return n
		}
	}

	for i := 0; i < n; i++ {
		if A[i] != last {
			return i + 1
		}
	}

	return -1
}

func getString(in *bufio.Reader) string {
	res, _ := in.ReadString('\n')
	res = strings.ReplaceAll(res, "\n", "")
	res = strings.ReplaceAll(res, "\r", "")
	res = strings.TrimSpace(res)
	return res
}

func parseInt(str string) int {
	var res int
	size := len(str)
	for i := 0; i < size; i++ {
		digit := int(str[i] - '0')
		for j := (i + 1); j < size; j++ {
			digit = digit<<3 + digit<<1
		}
		res += digit
	}
	return res
}

func getIntln(in *bufio.Reader) []int {
	b := strings.Split(getString(in), " ")
	res := make([]int, len(b))
	for k, v := range b {
		res[k] = parseInt(v)
	}
	return res
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func scan() string {
	for sc.Scan() {
		break
	}
	return sc.Text()
}

func scanInt() int {
	i, err := strconv.Atoi(scan())
	if err != nil {
		panic(err)
	}
	return i
}

func scanInt8() int8 {
	i, err := strconv.ParseInt(scan(), 10, 8)
	if err != nil {
		panic(err)
	}
	return int8(i)
}

func scanInt64() int64 {
	i, err := strconv.ParseInt(scan(), 10, 64)
	if err != nil {
		panic(err)
	}
	return i
}

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func min(ints ...int) int {
	a := ints[0]
	n := len(ints)
	for i := 1; i < n; i++ {
		if ints[i] < a {
			a = ints[i]
		}
	}
	return a
}

func max(ints ...int) int {
	a := ints[0]
	n := len(ints)
	for i := 1; i < n; i++ {
		if ints[i] > a {
			a = ints[i]
		}
	}
	return a
}

type Noop struct{}

var noop = Noop{}

func proc() {
	n := scanInt()
	mas := make([]int, n)
	for i := 0; i < n; i++ {
		mas[i] = scanInt()
	}
	if mas[0] != mas[1] && mas[0] != mas[n-1] {
		fmt.Println(1)
		return
	}
	if mas[0] != mas[n-1] && mas[1] != mas[n-1] {
		fmt.Println(n)
		return
	}
	for i := 1; i+1 < n; i++ {
		if mas[0] != mas[i] && mas[i] != mas[n-1] {
			fmt.Println(i + 1)
			return
		}
	}
}

func main() {
	sc.Split(bufio.ScanWords)
	t := scanInt()
	for i := 0; i < t; i++ {
		proc()
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	r := bufio.NewReader(os.Stdin)
	n := mustReadInt(r)
	for i := int64(0); i < n; i++ {
		k := mustReadInt(r)
		nums := mustReadNNumbs(r, k)
		if nums[0] != nums[1] {
			if nums[0] == nums[2] {
				fmt.Println(2)
			} else {
				fmt.Println(1)
			}
		} else {
			for p := 2; p < int(k); p++ {
				if nums[0] != nums[p] {
					fmt.Println(p + 1)
					break
				}
			}
		}
	}
}

func mustReadNNumbs(r *bufio.Reader, n int64) []int64 {
	nums := make([]int64, n)
	var err error
	for i, s := range strings.Split(mustReadLine(r), " ") {
		nums[i], err = strconv.ParseInt(s, 10, 64)
		checkError(err)
	}
	return nums
}
func mustReadInt(r *bufio.Reader) int64 {
	numb, err := strconv.ParseInt(mustReadLine(r), 10, 64)
	checkError(err)
	return numb
}

func mustReadLine(r *bufio.Reader) string {
	s, _, err := r.ReadLine()
	checkError(err)
	return string(s)
}

func checkError(err error) {
	if err != nil {
		panic(err)
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

var (
	reader = bufio.NewReader(os.Stdin)
	t, n   int
)

func solve(n int, a []int) int {
	for i := range a {
		if i == 0 {
			if a[i] != a[i+1] && a[i] != a[i+2] {
				return i + 1
			}
			continue
		}
		if i == n-1 {
			if a[i] != a[i-1] && a[i] != a[i-2] {
				return i + 1
			}
			continue
		}
		if a[i] != a[i-1] && a[i] != a[i+1] {
			return i + 1
		}
	}
	return -1
}

func main() {
	fmt.Fscan(reader, &t)
	for ; t > 0; t-- {
		fmt.Fscan(reader, &n)
		a := make([]int, n)
		for i := 0; i < n; i++ {
			fmt.Fscan(reader, &a[i])
		}
		fmt.Println(solve(n, a))
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

func getLeftValue(n int32, i int32) int32 {
	if i == 0 {
		return n - 1
	} else {
		return i - 1
	}
}

func getRightValue(n int32, i int32) int32 {
	if i == n-1 {
		return 0
	} else {
		return i + 1
	}
}

func solve(n int32, arr []int32) int32 {
	for i := int32(0); i < n; i++ {
		left := getLeftValue(n, i)
		right := getRightValue(n, i)
		if arr[i] != arr[left] && arr[i] != arr[right] {
			return i + 1
		}
	}
	return -1
}

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)

	tt := int32(0)
	fmt.Fscanf(in, "%d\n", &tt)
	for tt > 0 {
		n := int32(0)
		m := int32(0)
		arr := []int32{}
		fmt.Fscanf(in, "%d\n", &n, &m)
		for i := int32(0); i < n; i++ {
			if i > 0 {
				fmt.Fscanf(in, " ")
			}
			fmt.Fscanf(in, "%d", &m)
			arr = append(arr, m)
		}
		fmt.Fscanf(in, "\n")
		fmt.Fprintf(out, "%d\n", solve(n, arr))
		tt--
	}
	out.Flush()
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

func main() {
	r := bufio.NewReader(os.Stdin)
	var tt int
	fmt.Fscanf(r, "%d\n", &tt)
	for tt > 0 {
		var n int
		fmt.Fscanf(r, "%d\n", &n)
		arr := make([]int, n)
		for i := 0; i < n; i++ {
			fmt.Fscanf(r, "%d ", &arr[i])
		}
		fmt.Fscanf(r, "\n")

		fmt.Println(solve(n, arr) + 1)
		tt--
	}
}

func solve(n int, arr []int) int {
	b := make([]int, len(arr))
	copy(b, arr)
	sort.Ints(b)
	if b[0] == b[1] {
		return (check(b[len(b)-1], arr))
	} else {
		return (check(b[0], arr))
	}
}

func check(n int, arr []int) int {
	for i, v := range arr {
		if v == n {
			return i
		}
	}
	return -1
}

package main

import (
    "fmt"
    "sort"
)

func main() {
    var t int
    fmt.Scan(&t)
    for i := 0; i < t; i++ {
        var n int
        fmt.Scan(&n)
        values := make([]int, n)
        for v := range(values) {
            fmt.Scan(&values[v])
        }

        var some = make([]int, 3)
        copy(some, values[0:3])
        sort.Ints(some)

        for i, value := range(values) {
            if value != some[1] {
                fmt.Println(i + 1)
                break
            }
        }
    }
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var t int
	fmt.Scan(&t)
	for T := 0; T < t; T++ {
		var n int
		fmt.Scan(&n)
		array := make([]int, n)
		for i := range(array) {
			fmt.Scan(&array[i])
		}
		med := make([]int, 3)
		copy(med, array[0 : 3])
		sort.Ints(med)
		for i, val := range(array) {
			if val != med[1] {
				fmt.Println(i + 1)
				break
			}
		}
	}
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

func run(or io.Reader, ow io.Writer) {
	in := bufio.NewReader(or)
	out := bufio.NewWriter(ow)
	defer out.Flush()

	solve := func() {
		var n int
		Fscan(in, &n)
		a := make([]int, n)
		for i := 0; i < n; i++ {
			Fscan(in, &a[i])
		}
		cur := 0
		var ans int
		for i := 1; i < n; i++ {
			if a[0] != a[i] {
				cur++
				ans = i
			}
		}
		if cur != n-1 {
			Fprintln(out, ans+1)
		} else {
			Fprintln(out, 0+1)
		}
	}

	var T int
	Fscan(in, &T)
	for o := 0; o < T; o++ {
		solve()
	}

}

func main() { run(os.Stdin, os.Stdout) }

package main

import (
	"bufio"
	"fmt"
	"os"
)

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{})  { fmt.Fscanf(reader, f, a...) }

func main() {
	defer writer.Flush()

	var T int = 0
	scanf("%d\n", &T)

	for t := 0; t < T; t++ {

		var n int = 0
		scanf("%d\n", &n)
		a_vec := make([]int, n)

		for i := 0; i < n; i++ {
			if i != n - 1 {
				scanf("%d ", &a_vec[i])
			} else {
				scanf("%d\n", &a_vec[i])
			}
		}

		numbers := make(map[int]int)
		for i := 0; i < n; i++ {
			if _, key := numbers[a_vec[i]]; key {
				numbers[a_vec[i]] += 1
			} else {
				numbers[a_vec[i]] = 1
			}
		}

		var spy int = 0
		for key, element := range numbers {
			if element == 1 {
				spy = key
			}
		}

		var index int = 0
		for i := 0; i < n; i++ {
			if a_vec[i] == spy {
				index = i + 1
			}
		}

		printf("%d\n", index)
	}
}

package main

import (
	"fmt"
	"bufio"
	"os"
)

func main() {
	in := bufio.NewReader(os.Stdin)
	var t int
	fmt.Fscan(in, &t)
	for t > 0 {
		t--
		var n int
		fmt.Fscan(in, &n)
		v := make([]int, n)
		for i := range v {
			fmt.Fscan(in, &v[i])
		}
		for i := range v {
			if v[i] != v[(i+1)%n] && v[i]!=v[(i+2)%n] {
				fmt.Println(i+1)
				break
			}
		}
	}
}

package main

import (
	"bufio"
	. "fmt"
	"os"
)

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var T, N, a int
	Fscan(in, &T)
	for t := 0; t < T; t++ {
		Fscan(in, &N)
		ns := make([]int, N)
		counter := make(map[int]int, 0)
		for n := 0; n < N; n++ {
			Fscan(in, &a)
			ns[n] = a
			v, _ := counter[a]
			counter[a] = v + 1
		}
		for i := 0; i < N; i++ {
			v, _ := counter[ns[i]]
			if v == 1 {
				Fprintln(out, i+1)
				break
			}
		}
	}
}

package main
import (
    "os"
    "fmt"
    "bufio"
)
var rd = bufio.NewReader(os.Stdin);
func main() {
    q := 0
    fmt.Fscan(rd, &q)
    for t := 0; t < q; t++ {
        n := 0
        fmt.Fscan(rd, &n)
        a := make([]int, n)
        for i := range a {
            fmt.Fscan(rd, &a[i])
        }
        if a[0] == a[1] {
            for i := 0; i < n; i++ {
                if a[i] != a[0] {
                    fmt.Println(i + 1)
                }
            }
        } else {
            if a[0] == a[2] {
                fmt.Println(2)
            } else {
                fmt.Println(1)
            }
        }
    }
}

package main

import (
	"bufio"
	"fmt"
	"io"
	"math"
	"os"
)

// var m []int
// err = json.Unmarshal([]byte(r.FormValue("example")), &m)

// for i := 0; i < len(m); i++ {
// 	fmt.Println(m[i])
// }

func MIN(x, y int64) int64 {
	if x > y {
		return y
	} else {
		return x
	}
}

func MKO(x, y int64) int64 {
	if x < y {
		return 0
	} else {
		return x - y + 1
	}
}

func MAX(x, y int64) int64 {
	if x > y {
		return x
	} else {
		return y
	}
}

func LCM(x, y int) int {
	if x >= y {
		initial := x
		for i := 1; i < y+2; i++ {
			if initial%y == 0 {
				break
			} else {
				initial = initial + x
			}

		}
		return initial
	} else {
		initial := y
		for i := 1; i < x+2; i++ {
			if initial%x == 0 {
				break
			} else {
				initial = initial + y
			}

		}
		return initial
	}
}

func GCD(x, y int64) int64 {
	var l, q int64
	l = MAX(x, y)
	q = MIN(x, y)
	var m int64
	for l*q > 0 {
		a := l % q
		b := l - a
		cc := int64(b / q)
		remain := l - cc*q
		l = MAX(remain, q)
		q = MIN(remain, q)
		if l*q == 0 {
			m = l + q
			break
		}

	}
	return m

}

func IsItPrime(x int) bool {
	if x < 10 {
		if x == 2 || x == 3 || x == 5 || x == 7 {
			return true
		} else {
			return false
		}
	} else {
		j := 0
		k := math.Sqrt(float64(x))
		for m := 3; m <= int(k); {
			if x%m == 0 {
				j = 1
				break
			}
			m = m + 2
		}
		if j == 1 {
			return false
		} else {
			return true
		}
	}

}

// sort.Slice(arr, func(i, j int) bool {
// 	return arr[i] > arr[j]
// })
var t int

func main() {
	var input io.Reader = bufio.NewReader(os.Stdin)
	fmt.Fscan(input, &t)

	for i := 0; i < t; i++ {
		var n int
		fmt.Fscan(input, &n)

		array := make([]int, n)
		for i := 0; i < n; i++ {
			fmt.Fscan(input, &array[i])

		}

		for j := 0; j < n; j++ {
			if j > 0 && j < n-1 {
				if array[j] != array[j-1] && array[j] != array[j+1] {
					fmt.Println(j + 1)
					break
				}
			} else {
				if j == 0 {
					if array[j] != array[1] && array[j] != array[2] {
						fmt.Println(1)
						break
					}
				} else {
					if array[j] != array[j-1] && array[j] != array[j-2] {
						fmt.Println(n)
						break
					}
				}
			}
		}

	}
}

package main

import (
	"bufio"
	"fmt"
	"io/ioutil"
	"os"
	"strings"
)

var bytes []byte

func nextByte() byte {
	b := bytes[0]
	bytes = bytes[1:]
	return b
}

func ScanInt64() int64 {
	var negative bool
	var result int64

	b := nextByte()

	for ; b < '0' || b > '9'; b = nextByte() {
		if b == '-' {
			negative = true
		}
	}

	for ; '0' <= b && b <= '9'; b = nextByte() {
		result = (result << 3) + (result << 1) + int64(b-'0')
	}

	if negative {
		return -result
	} else {
		return result
	}
}

func ScanInt() int {
	return int(ScanInt64())
}

func ScanString() string {
	builder := strings.Builder{}

	for b := nextByte(); b != '\r'; b = nextByte() {
		if b != '\n' {
			builder.WriteByte(b)
		}
	}

	return builder.String()
}

func init() {
	f, err := os.Open("in.txt")

	if err == nil {
		defer f.Close()
	} else {
		f = os.Stdin
	}

	bytes, _ = ioutil.ReadAll(bufio.NewReader(f))
}

func main() {
	for t := ScanInt(); t > 0; t-- {
		n := ScanInt()
		cnts := map[int]int{}
		inds := map[int]int{}

		for i := 1; i <= n; i++ {
			a := ScanInt()
			cnts[a]++
			inds[a] = i
		}

		for a, cnt := range cnts {
			if cnt == 1 {
				fmt.Println(inds[a])
			}
		}
	}
}

package main

import (
	"bufio"
	"os"
	"fmt"
)

func main() {

	r := bufio.NewReader(os.Stdin)

	var t int

	fmt.Fscan(r, &t)

	for t1 := 0; t1 < t; t1++ {
		var n int

		fmt.Fscan(r, &n)

		a := make([]int, n)

		for i := 0; i < n; i++ {
			fmt.Fscan(r, &a[i])
		}
		ans := solve(a)

		fmt.Println(ans)
	}
}

func solve(a []int) int {

	mp := make([]int, 101)

	for i := 0; i < len(a); i++ {
		mp[a[i]]++
	}

	var v int

	for j :=0; j < len(mp); j++ {
		if mp[j] == 1 {
			v = j
			break
		}
	}

	for i := 0; i < len(a); i ++ {
		if a[i] == v {
			return i + 1
		}
	}

	return -1
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	var (
		line        string
		setCount    int
		arrayLength int
		array       []int
	)
	for scanner.Scan() {
		line = scanner.Text()

		if setCount == 0 {
			setCount = parseInt(line)
			continue
		}

		if arrayLength == 0 {
			arrayLength = parseInt(line)
			continue
		}

		array = parseIntArray(line)

		fmt.Println(whatIndexOfSpy(array))
		arrayLength = 0
		array = nil
	}
}

func parseInt(line string) int {
	i, err := strconv.Atoi(line)
	if err != nil {
		panic(err)
	}

	return i
}

func parseIntArray(line string) []int {
	parts := strings.Split(line, " ")

	arr := make([]int, 0, len(parts))
	for _, part := range parts {
		arr = append(arr, parseInt(part))
	}

	return arr
}

func whatIndexOfSpy(array []int) int {
	if len(array) <= 2 {
		return 2
	}

	first := array[0]
	second := array[1]
	third := array[2]

	if first == second && second == third {
		for i, num := range array[3:] {
			if first != num {
				return i + 3 + 1
			}
		}

		return 0
	} else {
		// странный один из первых трех
		if first == second {
			if first == third {
				return 2
			} else {
				return 3
			}
		} else {
			if first == third {
				return 2
			} else {
				return 1
			}
		}
	}
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

type Scanner struct {
	bScanner *bufio.Scanner
}

func NewScanner() *Scanner {
	bScanner := bufio.NewScanner(os.Stdin)
	bScanner.Split(bufio.ScanWords)
	bScanner.Buffer([]byte{}, math.MaxInt32)
	return &Scanner{
		bScanner,
	}
}
func (s *Scanner) next() string {
	s.bScanner.Scan()
	return s.bScanner.Text()
}
func (s *Scanner) nextInt() int {
	s.bScanner.Scan()
	res, err := strconv.Atoi(s.bScanner.Text())
	if err != nil {
		panic(err)
	}
	return res
}
func (s *Scanner) nextInt64() int64 {
	s.bScanner.Scan()
	res, err := strconv.ParseInt(s.bScanner.Text(), 10, 64)
	if err != nil {
		panic(err)
	}
	return res
}
func (s *Scanner) nextFloat() float64 {
	s.bScanner.Scan()
	res, err := strconv.ParseFloat(s.bScanner.Text(), 64)
	if err != nil {
		panic(err)
	}
	return res
}
func (s *Scanner) nextInts(N int) []int {
	res := make([]int, N)
	for i := 0; i < N; i++ {
		res[i] = s.nextInt()
	}
	return res
}
func (s *Scanner) nextInt64s(N int) []int64 {
	res := make([]int64, N)
	for i := 0; i < N; i++ {
		res[i] = s.nextInt64()
	}
	return res
}
func min(nums ...int) int {
	ans := math.MaxInt32
	for _, num := range nums {
		if num < ans {
			ans = num
		}
	}
	return ans
}
func max(nums ...int) int {
	ans := math.MinInt32
	for _, num := range nums {
		if num > ans {
			ans = num
		}
	}
	return ans
}

func main() {
	sc := NewScanner()
	wr := bufio.NewWriter(os.Stdout)
	defer wr.Flush()

	TC := sc.nextInt()
	for tc := 0; tc < TC; tc++ {
		N := sc.nextInt()
		arr := sc.nextInts(N)

		cnt := make([]int, 101)
		for i := 0; i < N; i++ {
			cnt[arr[i]]++
		}
		ans := -1
		for i := 0; i < N; i++ {
			if cnt[arr[i]] == 1 {
				ans = i + 1
			}
		}
		fmt.Fprintln(wr, ans)
	}

}

package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	var t int
	fmt.Fscan(in, &t)
	for t > 0 {
		var n int
		fmt.Fscan(in, &n)
		arr := make([]int, n)
		for i := 0; i < n; i++ {
			fmt.Fscan(in, &arr[i])
		}
		for i := 0; i < n; i++ {
			c := 0
			for j := 0; j < n; j++ {
				if arr[i] == arr[j] {
					c++
				}
			}
			if c == 1 {
				fmt.Fprintln(out, i + 1)
				break
			}
		}
		t--
	}
	out.Flush()

}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"io/ioutil"
	"os"
	"strings"
)

// github.com/EndlessCheng/codeforces-go
func run(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	solve := func(Case int) {
		var n int
		Fscan(in, &n)
		a := make([]int, n)
		for i := range a {
			Fscan(in, &a[i])
		}
		cnt := map[int]int{}
		for _, v := range a {
			cnt[v]++
		}
		for i, v := range a {
			if cnt[v] == 1 {
				Fprintln(out, i+1)
				return
			}
		}

	}

	var T int
	Fscan(in, &T)
	for Case := 1; Case <= T; Case++ {
		solve(Case)
	}

	_leftData, _ := ioutil.ReadAll(in)
	if _s := strings.TrimSpace(string(_leftData)); _s != "" {
		panic("有未读入的数据：\n" + _s)
	}
}

func main() { run(os.Stdin, os.Stdout) }

package main

import (
	"bufio"
	"strings"
	"fmt"
	"os"
	"strconv"
)

func main() {
	var (
		t   int
		n   int
		nsl []int
		tn  int
	)
	buffer := bufio.NewReader(os.Stdin)
	fmt.Scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		nsl = nil
		n = 0
		fmt.Scanf("%d\n", &n)
		tempstr, _, _ := buffer.ReadLine()
		sl := strings.Split(string(tempstr), " ")
		for j := 0; j < n; j++ {
			tn,_=strconv.Atoi(sl[j])
			nsl = append(nsl, tn)
		}
		count := CountValue(nsl)
		uniq := UniqueValue(count)
		fmt.Println(IndexOf(uniq, nsl)+1)
	}
}

func CountValue(arr []int) (res map[int]int) {
	dict := make(map[int]int)
	for _, num := range arr {
		dict[num] = dict[num] + 1
	}
	res = dict
	return
}
func UniqueValue(dict map[int]int) int {
	for k, v := range dict {
		if 1 == v {
			return k
		}
	}
	return -1
}

func IndexOf(element int, slice []int) int {
	for k, v := range slice {
		if element == v {
			return k
		}
	}
	return -1
}

package main

import (
	"fmt"
)

func main() {
	var (
		t   int
		n   int
		nsl []int
		tn  int
	)
	fmt.Scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		nsl = nil
		n=0
		fmt.Scanf("%d\n", &n)
		for j := 0; j < n; j++ {
			fmt.Scan(&tn)
			nsl = append(nsl, tn)
		}
		count := CountValue(nsl)
		uniq := UniqueValue(count)
		fmt.Println(n,"|",nsl, "|",IndexOf(uniq, nsl) + 1)
	}
}

func CountValue(arr []int) (res map[int]int) {
	dict := make(map[int]int)
	for _, num := range arr {
		dict[num] = dict[num] + 1
	}
	res = dict
	return
}
func UniqueValue(dict map[int]int) int {
	for k, v := range dict {
		if 1 == v {
			return k
		}
	}
	return -1
}

func IndexOf(element int, slice []int) int {
	for k, v := range slice {
		if element == v {
			return k
		}
	}
	return -1
}

package main

import (
	"fmt"
)

func main() {
	var (
		t   int
		n   int
		nsl []int
		tn  int
	)
	fmt.Scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		nsl = nil
		fmt.Scanf("%d\n", &n)
		for j := 0; j < n; j++ {
			fmt.Scan(&tn)
			nsl = append(nsl, tn)
		}
		count := CountValue(nsl)
		uniq := UniqueValue(count)
		fmt.Println(n,"|",nsl, "|",IndexOf(uniq, nsl) + 1)
	}
}

func CountValue(arr []int) (res map[int]int) {
	dict := make(map[int]int)
	for _, num := range arr {
		dict[num] = dict[num] + 1
	}
	res = dict
	return
}
func UniqueValue(dict map[int]int) int {
	for k, v := range dict {
		if 1 == v {
			return k
		}
	}
	return -1
}

func IndexOf(element int, slice []int) int {
	for k, v := range slice {
		if element == v {
			return k
		}
	}
	return -1
}

package main

import (
	"fmt"
)

func main() {
	var (
		t   int
		n   int
		nsl []int
		tn  int
	)
	fmt.Scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		nsl = nil
		fmt.Scanf("%d\n", &n)
		for j := 0; j < n; j++ {
			fmt.Scan(&tn)
			nsl = append(nsl, tn)
		}
		count := CountValue(nsl)
		uniq := UniqueValue(count)
		fmt.Println(nsl, "|",IndexOf(uniq, nsl) + 1)
	}
}

func CountValue(arr []int) (res map[int]int) {
	dict := make(map[int]int)
	for _, num := range arr {
		dict[num] = dict[num] + 1
	}
	res = dict
	return
}
func UniqueValue(dict map[int]int) int {
	for k, v := range dict {
		if 1 == v {
			return k
		}
	}
	return -1
}

func IndexOf(element int, slice []int) int {
	for k, v := range slice {
		if element == v {
			return k
		}
	}
	return -1
}

package main

import (
	"fmt"
)

func main() {
	var (
		t   int
		n   int
		nsl []int
		tn  int
	)
	fmt.Scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		nsl = nil
		fmt.Scanf("%d\n", &n)
		for j := 0; j < n; j++ {
			fmt.Scan(&tn)
			nsl = append(nsl, tn)
		}
		count := CountValue(nsl)
		uniq := UniqueValue(count)
		fmt.Println(IndexOf(uniq, nsl) + 1)
	}
}

func CountValue(arr []int) (res map[int]int) {
	dict := make(map[int]int)
	for _, num := range arr {
		dict[num] = dict[num] + 1
	}
	res = dict
	return
}
func UniqueValue(dict map[int]int) int {
	for k, v := range dict {
		if 1 == v {
			return k
		}
	}
	return -1
}

func IndexOf(element int, slice []int) int {
	for k, v := range slice {
		if element == v {
			return k
		}
	}
	return -1
}

package main

import (
	"fmt"
)

func main() {
	var (
		t   int
		n   int
		nsl []int
		tn  int
	)
	fmt.Scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		nsl = nil
		fmt.Scanf("%d\n", &n)
		for j := 0; j < n; j++ {
			if j == n+1 {
				fmt.Scanf("%d\n", &tn)
			} else {
				fmt.Scanf("%d", &tn)
			}
			nsl = append(nsl, tn)
		}
		count := CountValue(nsl)
		uniq := UniqueValue(count)
		fmt.Println(IndexOf(uniq, nsl) + 1)
	}
}

func CountValue(arr []int) (res map[int]int) {
	dict := make(map[int]int)
	for _, num := range arr {
		dict[num] = dict[num] + 1
	}
	res = dict
	return
}
func UniqueValue(dict map[int]int) int {
	for k, v := range dict {
		if 1 == v {
			return k
		}
	}
	return -1
}

func IndexOf(element int, slice []int) int {
	for k, v := range slice {
		if element == v {
			return k
		}
	}
	return -1
}

package main

import (
	"fmt"
)

func main() {
	var (
		t   int
		n   int
		nsl []int
		tn  int
	)
	fmt.Scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		nsl = nil
		fmt.Scanf("%d\n", &n)
		for j := 0; j < n; j++ {
			fmt.Scanf("%d", &tn)
			nsl = append(nsl, tn)
		}
		count := CountValue(nsl)
		uniq := UniqueValue(count)
		fmt.Println(IndexOf(uniq, nsl) + 1)
	}
}

func CountValue(arr []int) (res map[int]int) {
	dict := make(map[int]int)
	for _, num := range arr {
		dict[num] = dict[num] + 1
	}
	res = dict
	return
}
func UniqueValue(dict map[int]int) int {
	for k, v := range dict {
		if 1 == v {
			return k
		}
	}
	return -1
}

func IndexOf(element int, slice []int) int {
	for k, v := range slice {
		if element == v {
			return k
		}
	}
	return -1
}

package main

import (
	"fmt"
)

func main() {
	var (
		t int
		n int
	)
	fmt.Scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		var nsl []int = nil
		fmt.Scanf("%d\n", &n)
		for j := 0; j < n; j++ {
			var tn int
			fmt.Scanf("%d", &tn)
			nsl = append(nsl, tn)
		}
		count := CountValue(nsl)
		uniq := UniqueValue(count)
		fmt.Println(nsl,count,uniq,IndexOf(uniq, nsl) + 1)
	}
}

func CountValue(arr []int) (res map[int]int) {
	dict := make(map[int]int)
	for _, num := range arr {
		dict[num] = dict[num] + 1
	}
	res = dict
	return
}
func UniqueValue(dict map[int]int) int {
	for k, v := range dict {
		if 1 == v {
			return k
		}
	}
	return -1
}

func IndexOf(element int, slice []int) int {
	for k, v := range slice {
		if element == v {
			return k
		}
	}
	return -1
}

package main

import (
	"fmt"
)

func main() {
	var (
		t int
		n int
	)
	fmt.Scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		var nsl []int = nil
		fmt.Scanf("%d\n", &n)
		for k := 0; k < n; k++ {
			var tn int
			fmt.Scanf("%d", &tn)
			nsl = append(nsl, tn)
		}
		count := CountValue(nsl)
		uniq := UniqueValue(count)
		fmt.Println(IndexOf(uniq, nsl) + 1)
	}
}

func CountValue(arr []int) (res map[int]int) {
	dict := make(map[int]int)
	for _, num := range arr {
		dict[num] = dict[num] + 1
	}
	res = dict
	return
}
func UniqueValue(dict map[int]int) int {
	for k, v := range dict {
		if 1 == v {
			return k
		}
	}
	return -1
}

func IndexOf(element int, slice []int) int {
	for k, v := range slice {
		if element == v {
			return k
		}
	}
	return -1
}

package main

import (
	"bufio"
	. "fmt"
	"os"
	"strconv"
	"strings"
)

type arrWithIndex struct {
	count int
	idx   int
}

func (in *A) run(out *bufio.Writer) {
	T := in.nextInt()
	for t := 0; t < T; t++ {
		n := in.nextInt()
		mp := map[int]arrWithIndex{}
		for i := 0; i < n; i++ {
			x := in.nextInt()
			mp[x] = arrWithIndex{count: mp[x].count + 1, idx: i}
		}

		for _, v := range mp {
			if v.count == 1 {
				Fprintln(out, v.idx+1)
				Println(v.idx + 1)
				break
			}
		}
	}
}

func main() {
	var F *bufio.Reader
	var W *bufio.Writer
	in, inErr := os.Open("in.txt")
	out, outErr := os.Open("out.txt")
	if inErr == nil {
		F = bufio.NewReader(in)
	} else {
		F = bufio.NewReader(os.Stdin)
	}
	if outErr == nil {
		W = bufio.NewWriter(out)
	} else {
		W = bufio.NewWriter(os.Stdout)
	}
	defer func(file *os.File) {
		_ = file.Close()
	}(in)
	defer func(file *os.File) {
		_ = W.Flush()
		_ = file.Close()
	}(out)
	NewA(F).run(W)
}

func NewA(r *bufio.Reader) *A {
	return &A{
		in:        r,
		split:     []string{},
		index:     0,
		separator: " ",
	}
}

type A struct {
	in        *bufio.Reader
	split     []string
	index     int
	separator string
}

func (in *A) GetLine() string {
	line, err := in.in.ReadString('\n')
	if err != nil {
		Println("error line:", line, " err: ", err)
	}
	in.split = []string{}
	in.index = 0
	return line
}

func (in *A) load() {
	if len(in.split) <= in.index {
		in.split = strings.Split(in.GetLine(), in.separator)
		in.index = 0
	}
}

func (in *A) nextInt() int {
	in.load()
	val, _ := strconv.Atoi(strings.TrimSpace(in.split[in.index]))
	in.index++
	return val
}

func (in *A) nextInt64() int64 {
	in.load()
	val, _ := strconv.ParseInt(strings.TrimSpace(in.split[in.index]), 10, 64)
	in.index++
	return val
}

func (in *A) nextString() string {
	in.load()
	val := strings.TrimSpace(in.split[in.index])
	in.index++
	return val
}

package main

import (
	"bufio"
	. "fmt"
	"os"
	"strconv"
	"strings"
)

type arrWithIndex struct {
	count int
	idx   int
}

func (in *A) run(out *bufio.Writer) {
	T := in.nextInt()
	for t := 0; t < T; t++ {
		n := in.nextInt()
		mp := map[int]arrWithIndex{}
		for i := 0; i < n; i++ {
			x := in.nextInt()
			mp[x] = arrWithIndex{count: mp[x].count + 1, idx: i}
		}

		for _, v := range mp {
			if v.count == 1 {
				Fprintln(out, v.idx+1)
				Println(v.idx + 1)
				break
			}
		}
	}
}

func main() {
	var F *bufio.Reader
	var W *bufio.Writer
	in, inErr := os.Open("in.txt")
	out, outErr := os.Open("out.txt")
	if inErr == nil {
		F = bufio.NewReader(in)
	} else {
		F = bufio.NewReader(os.Stdin)
	}
	if outErr == nil {
		W = bufio.NewWriter(out)
	} else {
		W = bufio.NewWriter(os.Stdout)
	}
	defer func(file *os.File) {
		_ = file.Close()
	}(in)
	defer func(file *os.File) {
		_ = file.Close()
		_ = W.Flush()
	}(out)
	NewA(F).run(W)
}

func NewA(r *bufio.Reader) *A {
	return &A{
		in:        r,
		split:     []string{},
		index:     0,
		separator: " ",
	}
}

type A struct {
	in        *bufio.Reader
	split     []string
	index     int
	separator string
}

func (in *A) GetLine() string {
	line, err := in.in.ReadString('\n')
	if err != nil {
		Println("error line:", line, " err: ", err)
	}
	in.split = []string{}
	in.index = 0
	return line
}

func (in *A) load() {
	if len(in.split) <= in.index {
		in.split = strings.Split(in.GetLine(), in.separator)
		in.index = 0
	}
}

func (in *A) nextInt() int {
	in.load()
	val, _ := strconv.Atoi(strings.TrimSpace(in.split[in.index]))
	in.index++
	return val
}

func (in *A) nextInt64() int64 {
	in.load()
	val, _ := strconv.ParseInt(strings.TrimSpace(in.split[in.index]), 10, 64)
	in.index++
	return val
}

func (in *A) nextString() string {
	in.load()
	val := strings.TrimSpace(in.split[in.index])
	in.index++
	return val
}

package main

import (
	"fmt"
	"sort"
)

func code() {
	var n, val int
	fmt.Scanf("%d", &n)

	var arr []int
	for i := 0; i < n; i++ {
		fmt.Scanf("%d", &val)
		arr = append(arr, val)
	}
	real := make([]int, len(arr))
	copy(real, arr)
	sort.Ints(arr)

	for i := 0; i < n; i++ {
		if real[i] != arr[1] {
			fmt.Println(i + 1)
		}
	}
}

func main() {
	var test int
	fmt.Scanf("%d", &test)

	for ; test > 0; test-- {
		code()
	}
}

package main

import (
	"fmt"
)

func code() int {
	var n, out int
	fmt.Scanf("%d", &n)

	var arr [100]int
	for i := 0; i < n; i++ {
		fmt.Scanf("%d", &arr[i])
	}

	if arr[0] != arr[1] {
		if arr[0] != arr[2] && arr[1] == arr[2] {
			return 1
		}
		if arr[1] != arr[2] && arr[0] == arr[2] {
			return 2
		}
	}

	for i := 2; i < n; i++ {
		if arr[i] != arr[0] {
			out = i + 1
		}
	}

	return out
}

func main() {
	var test int
	fmt.Scanf("%d", &test)

	for t := 0; t < test; t++ {
		fmt.Println(code())
	}
}

package main

import (
	"fmt"
)

func code() int {
	var n, out int
	fmt.Scanf("%d", &n)

	var arr [100]int
	for i := 0; i < n; i++ {
		fmt.Scanf("%d", &arr[i])
	}

	if arr[0] != arr[1] {
		if arr[0] != arr[2] && arr[1] == arr[2] {
			out = 1
		}
		if arr[1] != arr[2] && arr[0] == arr[2] {
			out = 2
		}
	}

	for i := 2; i < n; i++ {
		if arr[i] != arr[0] {
			out = i + 1
		}
	}

	return out
}

func main() {
	var test int
	fmt.Scanf("%d", &test)

	for t := 0; t < test; t++ {
		fmt.Println(code())
	}
}

package main

import (
	"fmt"
)

func code() int {
	var n int
	fmt.Scanf("%d", &n)

	var arr [100]int
	for i := 0; i < n; i++ {
		fmt.Scanf("%d", &arr[i])
	}

	if arr[0] != arr[1] {
		if arr[0] != arr[2] && arr[1] == arr[2] {
			return 0
		}
		if arr[1] != arr[2] && arr[0] == arr[2] {
			return 1
		}
	}

	for i := 2; i < n; i++ {
		if arr[i] != arr[0] {
			return i
		}
	}

	return -1
}

func main() {
	var test int
	fmt.Scanf("%d", &test)

	for t := 0; t < test; t++ {
		fmt.Println(code())
	}
}

package main

import (
	"fmt"
)

func question01(arr []int, arrSize int) int {
	index := -1
	for i :=0 ; i< arrSize - 2; i++ {
		if arr[i] != arr[i+1] || arr[i] != arr[i+2] {			// 4 =/= 5
			if arr[i] == arr[i+2] {
				index = i+1
			}	else if arr[i] == arr[i+1] {
				index = i +2
			} else {
				index = i
			}
		}
	}
	return index+1
}

func main() {
	var testCases int
	fmt.Scanf("%d\n", &testCases)
	for i:=0; i< testCases ; i++ {
		var arrSize int
		fmt.Scanf("%d\n", &arrSize)
		arrs := make([]int, arrSize)
		for i, _ := range arrs {
			fmt.Scanf("%d", &arrs[i])
		}
		fmt.Println(question01(arrs, arrSize))
	}
}

package main

import "fmt"

func question01(arr []int, arrSize int) int {
	index := -1
	for i :=0 ; i< arrSize - 2; i++ {
		if arr[i] != arr[i+1] || arr[i] != arr[i+2] {			// 4 =/= 5
			if arr[i] == arr[i+2] {
				index = i+1
			}	else if arr[i] == arr[i+1] {
				index = i +2
			} else {
				index = i
			}
		}
	}
	return index+1
}

func main() {
	var testCases int
	fmt.Scanf("%d\n", &testCases)
	for i:=0; i< testCases ; i++ {
		var arrSize int
		fmt.Scanf("%d\n", &arrSize)
		var arrs []int
		for i:=0 ; i< arrSize ; i++ {
			var test int
			fmt.Scanf("%d\n", &test)
			arrs = append(arrs, test)
		}
		fmt.Println(question01(arrs, arrSize))
	}

}

package main

import (
	"fmt"
	//"os"
	"sort"
)

func main() {

	var n int
	fmt.Scan(&n)

	var list [][]int = make([][]int,n)
	for i:=0;i<n;i++{
		var holder int
		fmt.Scan(&holder)
		list[i] = make([]int,0,holder)
		for j:=0;j<holder;j++{
			var inner_holder int
			fmt.Scan(&inner_holder)
			list[i] = append(list[i], inner_holder)
		}
	}

	newlist := duplicate_2d_slice(n, list)

	for i:=0;i<len(list);i++{

		sort.Ints(newlist[i])

		var smallest int = smallest_int(newlist[i])
		var largest int = largest_int(newlist[i])

		var other int
		if smallest != newlist[i][1] {
			other = smallest
		} else {
			other = largest
		}

		fmt.Println(list)
		for key,value := range list[i] {
			if value == other {
				fmt.Println(key+1)
				break
			}
		}
	}
}

func duplicate_2d_slice(length int, original_slice [][]int) [][]int {
    var newlist [][]int = make([][]int,length)
    for i:=0;i<length;i++{
        newlist[i] = make([]int,0,len(original_slice[i]))
        for j:=0;j<len(original_slice[i]);j++{
            newlist[i] = append(newlist[i], original_slice[i][j])
        }
    }
    return newlist
}

func smallest_int(list []int) int {
    for i:=0;i<len(list);i++{
        if list[0] > list[i] {
            list[0] = list[i]
        }
    }
    return list[0]
}

func largest_int(list []int) int {
    for i:=0;i<len(list);i++{
        if list[0] < list[i] {
            list[0] = list[i]
        }
    }
    return list[0]
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	var n int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &n)

	var m int
	for i := 0; i < n; i++ {
		fmt.Fscan(in, &m)
		arr := make([]int, m)

		for j := 0; j < m; j++ {
			fmt.Fscan(in, &arr[j])
		}

		last, cur, next := arr[0], arr[1], arr[2]
		for j := 2; j < m; j++ {
			if last == cur && cur == next {
				last = cur
				cur = next
				next++
				continue
			}

			if cur != last {
				if cur != next {
					fmt.Println(cur)
					break
				} else {
					fmt.Println(last)
					break
				}
			} else {
				fmt.Println(next)
				break
			}
		}

	}
}

package main

import "fmt"

func main() {

	var T int
	fmt.Scan(&T)
	for T > 0 {
		T--
		var size int
		fmt.Scan(&size)

		counter := map[int]int{}
		indexer := map[int]int{}

		for i := 0; i < size; i++ {
			var num int
			fmt.Scan(&num)
			counter[num]++
			indexer[num] = i + 1
		}

		for k, v := range counter {
			if v == 1 {
				println(indexer[k])
			}
		}

	}
}

package main

import "fmt"

func findSpy(arr []int) int {
	counts := make(map[int]int)
	for _, v := range arr {
		counts[v]++
	}
	for v, c := range counts {
		if c == 1 {
			return v
		}
	}
	return -1
}

func main() {
	var nTests int
	fmt.Scanf("%d\n", &nTests)
	for i := 0; i < nTests; i++ {
		var len int
		fmt.Scanf("%d\n", &len)
		arr := make([]int, len)
		for j := 0; j < len; j++ {
			fmt.Scanf("%d", &arr[j])
		}
		fmt.Scanf("\n")
		fmt.Println(findSpy(arr))
	}
}

package main

import "fmt"
var cnt[101] int
var a[101] int
func main()  {
	var t int
	fmt.Scanf("%d", &t)
	for i := 1; i <= t; i++ {
		var n int
		for j := 1; j <= 100; j++ {cnt[j] = 0;}
		fmt.Scanf("%d", &n)
		for j := 1; j <= n; j++ {
			fmt.Scanf("%d", &a[j]); cnt[a[j]]++;
		}
		for j := 1; j <= n; j++ {
			if(cnt[a[j]] == 1) {
				fmt.Println(j); break;
			}
		}
	}
}


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).

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	var t, k int
	if _, err := fmt.Scanf("%d %d\n", &t, &k); err != nil {
		return
	}

	test_cases := make([][2]int, t)
	max := 0

	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	for i := 0; i < t; i++ {
		for j := 0; j < 2; j++ {
			scanner.Scan()
			a, err := strconv.Atoi(scanner.Text())
			if err != nil {
				return
			}
			test_cases[i][j] = a
			if a > max {
				max = a
			}
		}
	}

	const modulo int64 = 1000000007

	ways := make([]int64, max+1)
	ways[0] = 1
	for i := 1; i <= max; i++ {
		if k == 1 {
			ways[i] = (ways[i-1] * 2) % modulo
		} else {
			if i < k {
				ways[i] = int64(1)
			} else {
				ways[i] = ways[i-1] + ways[i-k]
			}
		}
		if ways[i] >= modulo {
			ways[i] -= modulo
		}
	}

	ways[0] = 0
	for i := 1; i <= max; i++ {
		ways[i] += ways[i-1]
		if ways[i] >= modulo {
			ways[i] -= modulo
		}
	}

	for i := 0; i < t; i++ {
		w := ways[test_cases[i][1]] - ways[test_cases[i][0]-1]
		if w < 0 {
			w += modulo
		}
		fmt.Println(w)
	}
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func CF474D(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	const mod int64 = 1e9 + 7
	const mx int = 1e5

	var q, k, l, r int
	Fscan(in, &q, &k)
	dp := [mx + 1]int64{}
	for i := range dp {
		if i < k {
			dp[i] = 1
		} else {
			dp[i] = (dp[i-1] + dp[i-k]) % mod
		}
	}
	for i := 1; i <= mx; i++ {
		dp[i] += dp[i-1]
	}
	for ; q > 0; q-- {
		Fscan(in, &l, &r)
		Fprintln(out, (dp[r]-dp[l-1])%mod)
	}
}

func main() { CF474D(os.Stdin, os.Stdout) }

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

type range_s struct {
	a int
	b int
}

func main() {
	var t, k int
	fmt.Scan(&t, &k)

	ranges := make([]range_s, t, t)
	bs := bufio.NewScanner(os.Stdin)
	bs.Split(bufio.ScanWords)

	max := 0
	for i := 0; i < t; i++ {
		bs.Scan()
		ranges[i].a, _ = strconv.Atoi(bs.Text())

		bs.Scan()
		ranges[i].b, _ = strconv.Atoi(bs.Text())

		if ranges[i].b > max {
			max = ranges[i].b
		}
	}

	// eg, k = 2
	// when len >= k, if last==R, pre i-1 can be R/W, if last==W, pre should have k-1 W
	// len1: R
	// len2: RR, WW -- last_R + last_W = dp[i-1] + dp[i-k]
	var modulo uint64
	modulo = 1000000007
	dp := make([]uint64, max+1, max+1)
	for i := 0; i < k; i++ {
		dp[i] = 1
	}
	for i := k; i <= max; i++ {
		dp[i] = (dp[i-1] + dp[i-k]) % modulo
	}

	for i := 1; i <= max; i++ {
		dp[i] = (dp[i] + dp[i-1]) % modulo
	}

	for i := 0; i < t; i++ {
		ans := (dp[ranges[i].b] - dp[ranges[i].a-1] + modulo) % modulo
		fmt.Println(ans)
	}
}

package main

import (
    "strconv"
    "bufio"
    "os"
    "fmt"
)
// var file, _ = os.Open("input.txt")
// var outfile, _ = os.Create("output.txt")
// var in = bufio.NewScanner(file)
// var out = bufio.NewWriter(outfile)
var in = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func next() string {
    if !in.Scan() {
        panic("Scan error")
    }
    return in.Text()
}

func nextInt() int {
    ret, _ := strconv.Atoi(next())
    return ret
}

func nextFloat() float64 {
    ret, _ := strconv.ParseFloat(next(), 64)
    return ret
}

func main() {
    defer out.Flush()
    in.Split(bufio.ScanWords)
    t := nextInt()
    k := nextInt()
    d := make([][]int, 2)
    mod := 1000000007
    maxn := 100001
    d[0] = make([]int, maxn)
    d[1] = make([]int, maxn)
    d[0][k] = 1
    for i := 1; i <= k; i++ {
        d[1][i] = 1
    }
    for i := k + 1; i < maxn; i++ {
        d[1][i] = (d[0][i - 1] + d[1][i - 1]) % mod
        if d[1][i] < 0 {
            d[1][i] += mod
        }
        d[0][i] = (d[0][i - k] + d[1][i - k]) % mod
        if d[0][i] < 0 {
            d[0][i] += mod
        }
    }
    sum := make([]int, maxn)
    for i := 1; i < maxn; i++ {
        sum[i] = ((sum[i] + sum[i - 1]) % mod + (d[0][i] + d[1][i]) % mod) % mod
        if sum[i] < 0 {
            sum[i] += mod
        }
    }
    for T := 0; T < t; T++ {
        a := nextInt()
        b := nextInt()
        ans := sum[b] - sum[a - 1]
        if ans < 0 {
            ans += mod
        }
        fmt.Fprintln(out, ans)
    }
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

func main() {
	var t, k int
	if _, err := fmt.Scanf("%d %d\n", &t, &k); err != nil {
		return
	}

	test_cases := make([][2]int, t)
	max := 0

	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	for i := 0; i < t; i++ {
		for j := 0; j < 2; j++ {
			scanner.Scan()
			a, err := strconv.Atoi(scanner.Text())
			if err != nil {
				return
			}
			test_cases[i][j] = a
			if a > max {
				max = a
			}
		}
	}

	const modulo int64 = 1000000007

	ways := make([]int64, max+1)
	ways[0] = 1
	for i := 1; i <= max; i++ {
		if k == 1 {
			ways[i] = int64(math.Pow(float64(2), float64(i)))
		} else {
			if i < k {
				ways[i] = int64(1)
			} else {
				ways[i] = ways[i-1] + ways[i-k]
			}
		}
		if ways[i] >= modulo {
			ways[i] -= modulo
		}
	}

	ways[0] = 0
	for i := 1; i <= max; i++ {
		ways[i] += ways[i-1]
		if ways[i] >= modulo {
			ways[i] -= modulo
		}
	}

	for i := 0; i < t; i++ {
		w := ways[test_cases[i][1]] - ways[test_cases[i][0]-1]
		if w < 0 {
			w += modulo
		}
		fmt.Println(w)
	}
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

func main() {
	var t, k int
	if _, err := fmt.Scanf("%d %d\n", &t, &k); err != nil {
		return
	}

	test_cases := make([][2]int, t)
	max := 0

	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	for i := 0; i < t; i++ {
		for j := 0; j < 2; j++ {
			scanner.Scan()
			a, err := strconv.Atoi(scanner.Text())
			if err != nil {
				return
			}
			test_cases[i][j] = a
			if a > max {
				max = a
			}
		}
	}

	const modulo int64 = 1000000007

	ways := make([]int64, max+1)
	ways[0] = 1
	for i := 1; i <= max; i++ {
		if k == 1 {
			ways[i] = int64(math.Pow(float64(2), float64(i)))
		} else {
			if i < k {
				ways[i] = int64(1)
			} else {
				ways[i] = ways[i-1] + ways[i-k]
			}
		}
	}

	ways[0] = 0
	for i := 1; i <= max; i++ {
		ways[i] += ways[i-1]
	}

	for i := 0; i < t; i++ {
		w := ways[test_cases[i][1]] - ways[test_cases[i][0]-1]
		if w >= modulo {
			w = w % modulo
		}
		fmt.Println(w)
	}
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

func main() {
	var t, k int
	if _, err := fmt.Scanf("%d %d\n", &t, &k); err != nil {
		return
	}

	test_cases := make([][2]int, t)
	max := 0

	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	for i := 0; i < t; i++ {
		for j := 0; j < 2; j++ {
			scanner.Scan()
			a, err := strconv.Atoi(scanner.Text())
			if err != nil {
				return
			}
			test_cases[i][j] = a
			if a > max {
				max = a
			}
		}
	}

	const modulo int64 = 1000000007

	ways := make([]int64, max+1)
	ways[0] = 1
	for i := 1; i <= max; i++ {
		if k == 1 {
			ways[i] = int64(math.Pow(float64(2), float64(i)))
		} else {
			if i < k {
				ways[i] = int64(1)
			} else {
				ways[i] = ways[i-1] + ways[i-k]
			}
		}

		if ways[i] >= modulo {
			ways[i] -= modulo
		}
	}

	ways[0] = 0
	for i := 1; i <= max; i++ {
		ways[i] += ways[i-1]
	}

	for i := 0; i < t; i++ {
		w := ways[test_cases[i][1]] - ways[test_cases[i][0]-1]
		fmt.Println(w)
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

type range_s struct {
	a int
	b int
}

func main() {
	var t, k int
	fmt.Scan(&t, &k)

	ranges := make([]range_s, t, t)
	bs := bufio.NewScanner(os.Stdin)
	bs.Split(bufio.ScanWords)

	max := 0
	for i := 0; i < t; i++ {
		bs.Scan()
		ranges[i].a, _ = strconv.Atoi(bs.Text())

		bs.Scan()
		ranges[i].b, _ = strconv.Atoi(bs.Text())

		if ranges[i].b > max {
			max = ranges[i].b
		}
	}

	// eg, k = 2
	// when len >= k, if last==R, pre i-1 can be R/W, if last==W, pre should have k-1 W
	// len1: R
	// len2: RR, WW -- last_R + last_W = dp[i-1] + dp[i-k]
	dp := make([]uint64, max+1, max+1)
	for i := 0; i < k; i++ {
		dp[i] = 1
	}
	for i := k; i <= max; i++ {
		dp[i] = dp[i-1] + dp[i-k]
	}

	var modulo uint64
	modulo = 1000000007
	for i := 1; i <= max; i++ {
		dp[i] = (dp[i] + dp[i-1]) % modulo
	}

	for i := 0; i < t; i++ {
		ans := dp[ranges[i].b] - dp[ranges[i].a-1]
		if dp[ranges[i].b] < dp[ranges[i].a-1] {
			ans = modulo + dp[ranges[i].b] - dp[ranges[i].a-1]
		}
		fmt.Println(ans)
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

type range_s struct {
	a int
	b int
}

func main() {
	var t, k int
	fmt.Scan(&t, &k)

	ranges := make([]range_s, t, t)
	bs := bufio.NewScanner(os.Stdin)
	bs.Split(bufio.ScanWords)

	max := 0
	for i := 0; i < t; i++ {
		bs.Scan()
		ranges[i].a, _ = strconv.Atoi(bs.Text())

		bs.Scan()
		ranges[i].b, _ = strconv.Atoi(bs.Text())

		if ranges[i].b > max {
			max = ranges[i].b
		}
	}

	// eg, k = 2
	// when len >= k, if last==R, pre i-1 can be R/W, if last==W, pre should have k-1 W
	// len1: R
	// len2: RR, WW -- last_R + last_W = dp[i-1] + dp[i-k]
	dp := make([]uint64, max+1, max+1)
	for i := 0; i < k; i++ {
		dp[i] = 1
	}
	for i := k; i <= max; i++ {
		dp[i] = dp[i-1] + dp[i-k]
	}

	var modulo uint64
	modulo = 1000000007
	for i := 1; i <= max; i++ {
		dp[i] = (dp[i] + dp[i-1]) % modulo
	}

	for i := 0; i < t; i++ {
		ans := dp[ranges[i].b] - dp[ranges[i].a-1]
		if ans < 0 {
			ans += modulo
		}
		fmt.Println(ans)
	}
}

package main

import (
    "strconv"
    "bufio"
    "os"
    "fmt"
)
// var file, _ = os.Open("input.txt")
// var outfile, _ = os.Create("output.txt")
// var in = bufio.NewScanner(file)
// var out = bufio.NewWriter(outfile)
var in = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func next() string {
    if !in.Scan() {
        panic("Scan error")
    }
    return in.Text()
}

func nextInt() int {
    ret, _ := strconv.Atoi(next())
    return ret
}

func nextFloat() float64 {
    ret, _ := strconv.ParseFloat(next(), 64)
    return ret
}

func main() {
    defer out.Flush()
    in.Split(bufio.ScanWords)
    t := nextInt()
    k := nextInt()
    d := make([][]int, 2)
    mod := 1000000007
    maxn := 100001
    d[0] = make([]int, maxn)
    d[1] = make([]int, maxn)
    d[0][k] = 1
    for i := 1; i <= k; i++ {
        d[1][i] = 1
    }
    for i := k + 1; i < maxn; i++ {
        d[1][i] = (d[0][i - 1] + d[1][i - 1]) % mod
        if d[1][i] < 0 {
            d[1][i] += mod
        }
        d[0][i] = (d[0][i - k] + d[1][i - k]) % mod
        if d[0][i] < 0 {
            d[0][i] += mod
        }
    }
    sum := make([]int, maxn)
    for i := 1; i < maxn; i++ {
        sum[i] = (sum[i] + sum[i - 1] + d[0][i] + d[1][i]) % mod
        if sum[i] < 0 {
            sum[i] += mod
        }
    }
    for T := 0; T < t; T++ {
        a := nextInt()
        b := nextInt()
        ans := sum[b] - sum[a - 1]
        if ans < 0 {
            ans += mod
        }
        fmt.Fprintln(out, ans)
    }
}

package main

import (
    "strconv"
    "bufio"
    "os"
    "fmt"
)
// var file, _ = os.Open("input.txt")
// var outfile, _ = os.Create("output.txt")
// var in = bufio.NewScanner(file)
// var out = bufio.NewWriter(outfile)
var in = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func next() string {
    if !in.Scan() {
        panic("Scan error")
    }
    return in.Text()
}

func nextInt() int {
    ret, _ := strconv.Atoi(next())
    return ret
}

func nextFloat() float64 {
    ret, _ := strconv.ParseFloat(next(), 64)
    return ret
}

func main() {
    defer out.Flush()
    in.Split(bufio.ScanWords)
    t := nextInt()
    k := nextInt()
    d := make([][]int, 2)
    mod := 1000000007
    maxn := 100001
    d[0] = make([]int, maxn)
    d[1] = make([]int, maxn)
    d[0][k] = 1
    for i := 1; i <= k; i++ {
        d[1][i] = 1
    }
    for i := k + 1; i < maxn; i++ {
        d[1][i] = (d[0][i - 1] + d[1][i - 1]) % mod
        if d[1][i] < 0 {
            d[1][i] += mod
        }
        d[0][i] = (d[0][i - k] + d[1][i - k]) % mod
        if d[0][i] < 0 {
            d[0][i] += mod
        }
    }
    sum := make([]int, maxn)
    for i := 1; i < maxn; i++ {
        sum[i] = (sum[i] + sum[i - 1] + d[0][i] + d[1][i]) % mod
        if sum[i] < 0 {
            sum[i] += mod
        }
    }
    for T := 0; T < t; T++ {
        a := nextInt()
        b := nextInt()
        fmt.Fprintln(out, sum[b] - sum[a - 1])
    }
}

package main

import (
    "strconv"
    "bufio"
    "os"
    "fmt"
)
// var file, _ = os.Open("input.txt")
// var outfile, _ = os.Create("output.txt")
// var in = bufio.NewScanner(file)
// var out = bufio.NewWriter(outfile)
var in = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func next() string {
    if !in.Scan() {
        panic("Scan error")
    }
    return in.Text()
}

func nextInt() int {
    ret, _ := strconv.Atoi(next())
    return ret
}

func nextFloat() float64 {
    ret, _ := strconv.ParseFloat(next(), 64)
    return ret
}

func main() {
    defer out.Flush()
    in.Split(bufio.ScanWords)
    t := nextInt()
    k := nextInt()
    d := make([][]int, 2)
    mod := 1000000007
    maxn := 100001
    d[0] = make([]int, maxn)
    d[1] = make([]int, maxn)
    d[0][k] = 1
    for i := 1; i <= k; i++ {
        d[1][i] = 1
    }
    for i := k + 1; i < maxn; i++ {
        d[1][i] = (d[0][i - 1] + d[1][i - 1]) % mod
        d[0][i] = (d[0][i - k] + d[1][i - k]) % mod
    }
    sum := make([]int, maxn)
    for i := 1; i < maxn; i++ {
        sum[i] = (sum[i] + sum[i - 1] + d[0][i] + d[1][i]) % mod
    }
    for T := 0; T < t; T++ {
        a := nextInt()
        b := nextInt()
        fmt.Fprintln(out, sum[b] - sum[a - 1])
    }
}