Pasha loves his phone and also putting his hair up... But the hair is now irrelevant.Pasha has installed a new game to his phone. The goal of the game is following. There is a rectangular field consisting of n row with m pixels in each row. Initially, all the pixels are colored white. In one move, Pasha can choose any pixel and color it black. In particular, he can choose the pixel that is already black, then after the boy's move the pixel does not change, that is, it remains black. Pasha loses the game when a 2 × 2 square consisting of black pixels is formed. Pasha has made a plan of k moves, according to which he will paint pixels. Each turn in his plan is represented as a pair of numbers i and j, denoting respectively the row and the column of the pixel to be colored on the current move.Determine whether Pasha loses if he acts in accordance with his plan, and if he does, on what move the 2 × 2 square consisting of black pixels is formed.

The first line of the input contains three integers n, m, k (1 ≤ n, m ≤ 1000, 1 ≤ k ≤ 105) — the number of rows, the number of columns and the number of moves that Pasha is going to perform.  The next k lines contain Pasha's moves in the order he makes them. Each line contains two integers i and j (1 ≤ i ≤ n, 1 ≤ j ≤ m), representing the row number and column number of the pixel that was painted during a move.

If Pasha loses, print the number of the move when the 2 × 2 square consisting of black pixels is formed. If Pasha doesn't lose, that is, no 2 × 2 square consisting of black pixels is formed during the given k moves, print 0.

package main

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

var	reader = bufio.NewReader(os.Stdin)
var scanner = bufio.NewScanner(os.Stdin)
var writer = bufio.NewWriter(os.Stdout)

func main() {
	defer writer.Flush()
	scanner.Split(bufio.ScanWords)

	var n, m, k, a, b int

	n, m, k = nextInt(), nextInt(), nextInt()

	field := make([][]int, n + 2)
	isLose := false

	for i := range field {
		field[i] = make([]int, m + 2)
	}

	for move := 1; move <= k; move++ {
		a, b = nextInt(), nextInt()

		field[a][b] = 1
		isLose = false

		switch {
		case field[a-1][b-1] == 1 && field[a-1][b] == 1 && field[a][b-1] == 1:
			isLose = true
		case field[a+1][b-1] == 1 && field[a+1][b] == 1 && field[a][b-1] == 1:
			isLose = true
		case field[a-1][b+1] == 1 && field[a-1][b] == 1 && field[a][b+1] == 1:
			isLose = true
		case field[a+1][b+1] == 1 && field[a+1][b] == 1 && field[a][b+1] == 1:
			isLose = true
		}

		if isLose {
			println(move)
			return
		}
	}

	println(0)
}

func scan(a ...interface{}) {
	fmt.Fscan(reader, a...)
}

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

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

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

func println(a ...interface{}) {
	fmt.Fprintln(writer, a...)
}

func print(a ...interface{}) {
	fmt.Fprint(writer, a...)
}

package main

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

var scanner = bufio.NewScanner(os.Stdin)
var writer = bufio.NewWriter(os.Stdout)

//Wrong
func main() {
	defer writer.Flush()
	scanner.Split(bufio.ScanWords)

	n, m, k := nextInt(), nextInt(), nextInt()
	a, b := 0, 0
	field := make([][]int, n)
	isLose := false

	for i := range field {
		field[i] = make([]int, m)
	}

	for move := 1; move <= k; move++ {
		a, b = nextInt() - 1, nextInt() - 1

		field[a][b] = 1
		isLose = false

		switch {
			case a > 0 && b > 0 && field[a-1][b-1] == 1 && field[a-1][b] == 1 && field[a][b-1] == 1:
				isLose = true
			case b > 0 && a < n-1 && field[a][b-1] == 1 && field[a+1][b-1] == 1 && field[a+1][b] == 1:
				isLose = true
			case a > 0 && b < m-1 && field[a-1][b] == 1 && field[a-1][b+1] == 1 && field[a][b+1] == 1:
				isLose = true
			case a < n-1 && b < m-1 && field[a+1][b] == 1 && field[a][b+1] == 1 && field[a+1][b+1] == 1:
				isLose = true
		}

		if isLose {
			println(move)
			return
		}
	}

	println(0)
}

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

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

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

func println(a ...interface{}) {
	fmt.Fprintln(writer, a...)
}

func print(a ...interface{}) {
	fmt.Fprint(writer, a...)
}

package main

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

var	reader = bufio.NewReader(os.Stdin)
var scanner = bufio.NewScanner(os.Stdin)
var writer = bufio.NewWriter(os.Stdout)

func main() {
	defer writer.Flush()
	scanner.Split(bufio.ScanWords)

	var n, m, k, a, b int
	n, m, k = nextInt(), nextInt(), nextInt()
	field := [1005][1005]bool{}

	// field := make([][]bool, n + 2)
	isLose := false
	_, _ = n, m
	// for i := range field {
	// 	field[i] = make([]bool, m + 2)
	// }

	for move := 1; move <= k; move++ {
		a, b = nextInt(), nextInt()

		field[a][b] = true
		isLose = false

		switch {
		case field[a-1][b-1] && field[a-1][b] && field[a][b-1]:
			isLose = true
		case field[a+1][b-1] && field[a+1][b] && field[a][b-1]:
			isLose = true
		case field[a-1][b+1] && field[a-1][b] && field[a][b+1]:
			isLose = true
		case field[a+1][b+1] && field[a+1][b] && field[a][b+1]:
			isLose = true
		}

		if isLose {
			println(move)
			return
		}
	}

	println(0)
}

func scan(a ...interface{}) {
	fmt.Fscan(reader, a...)
}

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

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

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

func println(a ...interface{}) {
	fmt.Fprintln(writer, a...)
}

func print(a ...interface{}) {
	fmt.Fprint(writer, a...)
}

package main

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

var	reader = bufio.NewReader(os.Stdin)
var scanner = bufio.NewScanner(os.Stdin)
var writer = bufio.NewWriter(os.Stdout)

func main() {
	defer writer.Flush()
	scanner.Split(bufio.ScanWords)

	var n, m, k, a, b int

	n, m, k = nextInt(), nextInt(), nextInt()

	field := make([][]bool, n + 2)
	isLose := false

	for i := range field {
		field[i] = make([]bool, m + 2)
	}

	for move := 1; move <= k; move++ {
		a, b = nextInt(), nextInt()

		field[a][b] = true
		isLose = false

		switch {
		case field[a-1][b-1] && field[a-1][b] && field[a][b-1]:
			isLose = true
		case field[a+1][b-1] && field[a+1][b] && field[a][b-1]:
			isLose = true
		case field[a-1][b+1] && field[a-1][b] && field[a][b+1]:
			isLose = true
		case field[a+1][b+1] && field[a+1][b] && field[a][b+1]:
			isLose = true
		}

		if isLose {
			println(move)
			return
		}
	}

	println(0)
}

func scan(a ...interface{}) {
	fmt.Fscan(reader, a...)
}

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

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

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

func println(a ...interface{}) {
	fmt.Fprintln(writer, a...)
}

func print(a ...interface{}) {
	fmt.Fprint(writer, a...)
}

package main

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

var	reader = bufio.NewReader(os.Stdin)
var scanner = bufio.NewScanner(os.Stdin)
var writer = bufio.NewWriter(os.Stdout)

func main() {
	defer writer.Flush()
	scanner.Split(bufio.ScanWords)

	var n, m, k, a, b int

	scan(&n, &m, &k)

	field := make([][]int, n)
	isLose := false

	for i := range field {
		field[i] = make([]int, m)
	}

	for move := 1; move <= k; move++ {
		scan(&a, &b)
		a--
		b--

		field[a][b] = 1
		isLose = false

		switch {
		case a > 0 && b > 0 && field[a-1][b-1] == 1 && field[a-1][b] == 1 && field[a][b-1] == 1:
			isLose = true
		case b > 0 && a < n-1 && field[a][b-1] == 1 && field[a+1][b-1] == 1 && field[a+1][b] == 1:
			isLose = true
		case a > 0 && b < m-1 && field[a-1][b] == 1 && field[a-1][b+1] == 1 && field[a][b+1] == 1:
			isLose = true
		case a < n-1 && b < m-1 && field[a+1][b] == 1 && field[a][b+1] == 1 && field[a+1][b+1] == 1:
			isLose = true
		}

		if isLose {
			println(move)
			return
		}
	}

	println(0)
}

func scan(a ...interface{}) {
	fmt.Fscan(reader, a...)
}

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

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

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

func println(a ...interface{}) {
	fmt.Fprintln(writer, a...)
}

func print(a ...interface{}) {
	fmt.Fprint(writer, a...)
}

package main

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

var scanner *bufio.Scanner

func getI() int64 {
  scanner.Scan()
  x, _ := strconv.ParseInt(scanner.Text(), 10, 64)
  return x
}
func geti() int {
  return int(getI())
}
func getF() float64 {
  scanner.Scan()
  x, _ := strconv.ParseFloat(scanner.Text(), 64)
  return x
}
func getS() string {
  scanner.Scan()
  return scanner.Text()
}

func main() {
  scanner = bufio.NewScanner(os.Stdin)
  scanner.Split(bufio.ScanWords)
  writer := bufio.NewWriter(os.Stdout)
  defer writer.Flush()

  up := [][]int{ {-1, -1}, {-1, 0}, {0, -1}, {0, 0} }
  down := [][]int{ {0, 0}, {0, 1}, {1, 0}, {1, 1} }

  _, _, k := geti(), geti(), geti()
  points := map[[2]int]bool{}
  for i := 0; i < k; i++ {
    x, y := geti(), geti()
    point := [2]int{ x, y }
    points[point] = true
    for j := 0; j < 4; j++ {
      x0, y0 := x+up[j][0], y+up[j][1]
      okay := true
      for k := 0; k < 4; k++ {
        seek := [2]int{ x0+down[k][0], y0+down[k][1] }
        _, found := points[seek]
        if !found {
          okay = false
          break
        }
      }
      if okay {
        writer.WriteString(fmt.Sprintf("%d\n", i+1))
        return
      }
    }
  }
  writer.WriteString("0\n")
}

package main

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

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

	board := make([][]int, n)
	for i := 0; i < n; i++ {
		board[i] = make([]int, m)
	}
	lost := false
	lost_at := -1

	reader := bufio.NewReader(os.Stdin)
	re := regexp.MustCompile(`\r?\n`)

	for i := 0; i < k; i++ {
		if s, err := reader.ReadString('\n'); err != nil {
			if err != io.EOF {
				return
			}
		} else if lost {
			continue
		} else {
			s = re.ReplaceAllString(s, "")
			xy := strings.Split(s, " ")
			if len(xy) != 2 {
				return
			}

			x, err := strconv.Atoi(xy[0])
			if err != nil {
				return
			}
			y, err := strconv.Atoi(xy[1])
			if err != nil {
				return
			}
			board[x-1][y-1] = 1
			if lose(board, n, m, x-1, y-1) {
				lost = true
				lost_at = i + 1
			}
		}
	}

	if lost {
		fmt.Println(lost_at)
	} else {
		fmt.Println(0)
	}
}

func lose(b [][]int, n, m, x, y int) bool {
	if x > 0 && y > 0 {
		if b[x-1][y-1] == 1 && b[x-1][y] == 1 && b[x][y-1] == 1 {
			return true
		}
	}
	if x > 0 && y < m-1 {
		if b[x-1][y+1] == 1 && b[x-1][y] == 1 && b[x][y+1] == 1 {
			return true
		}
	}
	if x < n-1 && y < m-1 {
		if b[x+1][y+1] == 1 && b[x+1][y] == 1 && b[x][y+1] == 1 {
			return true
		}
	}
	if x < n-1 && y > 0 {
		if b[x+1][y-1] == 1 && b[x+1][y] == 1 && b[x][y-1] == 1 {
			return true
		}
	}
	return false
}

package main

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

var (
	n, m, k int
	mi, mj  []int
	board   [][]int
	result  int = 0
)

func in() {
	read(&n, &m, &k)
	mi = make([]int, k)
	mj = make([]int, k)
	for i := 0; i < k; i++ {
		read(&mi[i], &mj[i])
	}
}

func out() {
	println(result)
	defer output.Flush()
}

func run() {
	if n < 2 || m < 2 {
		return
	}

	board = make([][]int, n)
	for i := 0; i < n; i++ {
		board[i] = make([]int, m)
	}
	for i := 0; i < k; i++ {
		x := mi[i] - 1
		y := mj[i] - 1
		board[x][y] = 1
		if check(x, y) {
			result = i + 1
			return
		}
	}
}

func check(x, y int) bool {
	// left top
	if x > 0 && y > 0 {
		if board[x-1][y-1] == 1 && board[x][y-1] == 1 && board[x-1][y] == 1 {
			return true
		}
	}

	// right top
	if x > 0 && y < m-1 {
		if board[x-1][y+1] == 1 && board[x-1][y] == 1 && board[x][y+1] == 1 {
			return true
		}
	}

	// bottom left
	if x < n-1 && y > 0 {
		if board[x+1][y-1] == 1 && board[x+1][y] == 1 && board[x][y-1] == 1 {
			return true
		}
	}

	// bottom right
	if x < n-1 && y < m-1 {
		if board[x+1][y+1] == 1 && board[x+1][y] == 1 && board[x][y+1] == 1 {
			return true
		}
	}

	return false
}

/** main **/
func main() {
	in()
	run()
	out()
}

// Input & Output
var (
	input  = bufio.NewReader(os.Stdin)
	output = bufio.NewWriter(os.Stdout)
)

func read(a ...interface{}) {
	_, err := fmt.Fscan(input, a...)
	if err != nil {
		println(err)
	}
}

func println(a ...interface{}) {
	fmt.Fprintln(output, a...)
}

func printf(format string, a ...interface{}) {
	fmt.Fprintf(output, format, a...)
}

package main

import (
	"fmt"
	"io"
	"os"
)

func pp(in io.Reader) {
	b := [1000][1000]bool{}
	var n, m, k int
	fmt.Fscanf(in, "%d %d %d\n", &n, &m, &k)
	loses := func(i, j int) bool {
		if i < 0 || j < 0 || i+1 >= n || j+1 >= m {
			return false
		}
		return b[i][j] && b[i+1][j] && b[i+1][j+1] && b[i][j+1]
	}
	pb := func() {
		for i := 0; i < n; i++ {
			for j := 0; j < m; j++ {
				if b[i][j] {
					fmt.Print("x")
				} else {
					fmt.Print("_")
				}
			}
			fmt.Println()
		}
	}
	_ = pb
	for move := 1; move <= k; move++ {
		var i, j int
		fmt.Fscanf(in, "%d %d\n", &i, &j)
		i--
		j--
		// fmt.Println(i, j)
		b[i][j] = true
		if loses(i, j) || loses(i-1, j) || loses(i, j-1) || loses(i-1, j-1) {
			fmt.Println(move)
			return
		}
		// pb()
		// fmt.Println()
	}
	fmt.Println(0)
}

func main() {
	pp(os.Stdin)
}

package main

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

var sc = bufio.NewScanner(os.Stdin)

func next() string {
	sc.Split(bufio.ScanWords)
	if !sc.Scan() {
		panic("could not scan a word from the reader")
	}
	return sc.Text()
}

func nextInt() int {
	i, e := strconv.Atoi(next())
	if e != nil {
		panic(e)
	}
	return i
}

func nextLong() int64 {
	i, e := strconv.ParseInt(next(), 10, 64)
	if e != nil {
		panic(e)
	}
	return i
}

func nextLine() string {
	sc.Split(bufio.ScanLines)
	if !sc.Scan() {
		panic("could not scan a line from the reader")
	}
	return sc.Text()
}

func main() {
	_, _, K := nextInt(), nextInt(), nextInt()
	var f [1010][1010]int
	k := 1
	for ; k <= K; k++ {
		i, j := nextInt(), nextInt()
		f[i][j] = 1
		var dr = [4]int{0, 0, 1, 1}
		var dc = [4]int{0, 1, 0, 1}
		r0 := i - 1
		c0 := j - 1
		for i := 0; i < 4; i++ {
			r := r0 + dr[i]
			c := c0 + dc[i]
			b := 1
			for j := 0; j < 4; j++ {
				r1 := r + dr[j]
				c1 := c + dc[j]
				b &= f[r1][c1]
			}
			if b == 1 {
				fmt.Println(k)
				return
			}
		}
	}
	fmt.Println(0)
}

package main

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

func is_lose(img [][]int, x, y int) bool {
	ret := false
	if img[x-1][y-1]+img[x-1][y]+img[x][y-1]+img[x][y] == 4 {
		ret = true
	} else if img[x-1][y+1]+img[x-1][y]+img[x][y+1]+img[x][y] == 4 {
		ret = true
	} else if img[x+1][y-1]+img[x+1][y]+img[x][y-1]+img[x][y] == 4 {
		ret = true
	} else if img[x+1][y+1]+img[x+1][y]+img[x][y+1]+img[x][y] == 4 {
		ret = true
	}

	return ret
}

/*
func dump(img [][]int, n, m int) {
	for i := 0; i < n+2; i++ {
		for j := 0; j < m+2; j++ {
			fmt.Printf("%d ", img[i][j])
		}
		fmt.Println()
	}
}
*/

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

	img := [][]int{}
	for i := 0; i <= n+1; i++ {
		row := make([]int, m+2, m+2)
		img = append(img, row)
	}

	ans := 0
	bs := bufio.NewScanner(os.Stdin)
	bs.Split(bufio.ScanWords)
	for i := 0; i < k; i++ {
		bs.Scan()
		x, _ := strconv.Atoi(bs.Text())
		bs.Scan()
		y, _ := strconv.Atoi(bs.Text())

		img[x][y] = 1
		//dump(img, n, m)
		if is_lose(img, x, y) {
			ans = i + 1
			break
		}
	}

	fmt.Println(ans)
}

package main

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

func is_lose(img [][]int, x, y int) bool {
	/*
		if img[x-1][y-1]+img[x-1][y]+img[x][y-1]+img[x][y] == 4 {
			return true
		}
		if img[x-1][y+1]+img[x-1][y]+img[x][y+1]+img[x][y] == 4 {
			return true
		}
		if img[x+1][y-1]+img[x+1][y]+img[x][y-1]+img[x][y] == 4 {
			return true
		}
		if img[x+1][y+1]+img[x+1][y]+img[x][y+1]+img[x][y] == 4 {
			return true
		}
	*/

	return false
}

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

	img := [][]int{}
	for i := 0; i <= n+1; i++ {
		row := make([]int, m+2, m+2)
		img = append(img, row)
	}

	ans := 0
	bs := bufio.NewScanner(os.Stdin)
	bs.Split(bufio.ScanWords)
	for i := 0; i < k; i++ {
		bs.Scan()
		x, _ := strconv.Atoi(bs.Text())
		bs.Scan()
		y, _ := strconv.Atoi(bs.Text())

		img[x][y] = 1
		if is_lose(img, x, y) {
			ans = i + 1
		}
	}

	fmt.Println(ans)
}

package main

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

func is_lose(img [][]int, x, y int) bool {
	ret := false
	if img[x-1][y-1]+img[x-1][y]+img[x][y-1]+img[x][y] == 4 {
		ret = true
	} else if img[x-1][y+1]+img[x-1][y]+img[x][y+1]+img[x][y] == 4 {
		ret = true
	} else if img[x+1][y-1]+img[x+1][y]+img[x][y-1]+img[x][y] == 4 {
		ret = true
	} else if img[x+1][y+1]+img[x+1][y]+img[x][y+1]+img[x][y] == 4 {
		ret = true
	}

	return ret
}

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

	img := [][]int{}
	for i := 0; i <= n+1; i++ {
		row := make([]int, m+2, m+2)
		img = append(img, row)
	}

	ans := 0
	bs := bufio.NewScanner(os.Stdin)
	bs.Split(bufio.ScanWords)
	for i := 0; i < k; i++ {
		bs.Scan()
		x, _ := strconv.Atoi(bs.Text())
		bs.Scan()
		y, _ := strconv.Atoi(bs.Text())

		img[x][y] = 1
		if is_lose(img, x, y) {
			ans = i + 1
		}
	}

	fmt.Println(ans)
}

package main

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

/*
func is_lose(img [][]int, x, y int) bool {
	if img[x-1][y-1]+img[x-1][y]+img[x][y-1]+img[x][y] == 4 {
		return true
	}
	if img[x-1][y+1]+img[x-1][y]+img[x][y+1]+img[x][y] == 4 {
		return true
	}
	if img[x+1][y-1]+img[x+1][y]+img[x][y-1]+img[x][y] == 4 {
		return true
	}
	if img[x+1][y+1]+img[x+1][y]+img[x][y+1]+img[x][y] == 4 {
		return true
	}

	return false
}
*/

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

	img := [][]int{}
	for i := 0; i <= n+1; i++ {
		row := make([]int, m+2, m+2)
		img = append(img, row)
	}

	ans := 0
	/*
		bs := bufio.NewScanner(os.Stdin)
		bs.Split(bufio.ScanWords)
		for i := 0; i < k; i++ {
			bs.Scan()
			x, _ := strconv.Atoi(bs.Text())
			bs.Scan()
			y, _ := strconv.Atoi(bs.Text())

			img[x][y] = 1
			if is_lose(img, x, y) {
				ans = i + 1
			}
		}
	*/

	fmt.Println(ans)
}

package main

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

/*
func is_lose(img [][]int, x, y int) bool {
	if img[x-1][y-1]+img[x-1][y]+img[x][y-1]+img[x][y] == 4 {
		return true
	}
	if img[x-1][y+1]+img[x-1][y]+img[x][y+1]+img[x][y] == 4 {
		return true
	}
	if img[x+1][y-1]+img[x+1][y]+img[x][y-1]+img[x][y] == 4 {
		return true
	}
	if img[x+1][y+1]+img[x+1][y]+img[x][y+1]+img[x][y] == 4 {
		return true
	}

	return false
}
*/

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

	img := [][]int{}
	for i := 0; i <= n+1; i++ {
		row := make([]int, m+2, m+2)
		img = append(img, row)
	}

	ans := 0
	bs := bufio.NewScanner(os.Stdin)
	bs.Split(bufio.ScanWords)
	for i := 0; i < k; i++ {
		bs.Scan()
		x, _ := strconv.Atoi(bs.Text())
		bs.Scan()
		y, _ := strconv.Atoi(bs.Text())

		img[x][y] = 1
		/*if is_lose(img, x, y) {
			ans = i + 1
		}*/
	}

	fmt.Println(ans)
}


Today the kindergarten has a new group of $$$n$$$ kids who need to be seated at the dinner table. The chairs at the table are numbered from $$$1$$$ to $$$4n$$$. Two kids can't sit on the same chair. It is known that two kids who sit on chairs with numbers $$$a$$$ and $$$b$$$ ($$$a \neq b$$$) will indulge if:   $$$gcd(a, b) = 1$$$ or,  $$$a$$$ divides $$$b$$$ or $$$b$$$ divides $$$a$$$. $$$gcd(a, b)$$$ — the maximum number $$$x$$$ such that $$$a$$$ is divisible by $$$x$$$ and $$$b$$$ is divisible by $$$x$$$.For example, if $$$n=3$$$ and the kids sit on chairs with numbers $$$2$$$, $$$3$$$, $$$4$$$, then they will indulge since $$$4$$$ is divided by $$$2$$$ and $$$gcd(2, 3) = 1$$$. If kids sit on chairs with numbers $$$4$$$, $$$6$$$, $$$10$$$, then they will not indulge.The teacher really doesn't want the mess at the table, so she wants to seat the kids so there are no $$$2$$$ of the kid that can indulge. More formally, she wants no pair of chairs $$$a$$$ and $$$b$$$ that the kids occupy to fulfill the condition above.Since the teacher is very busy with the entertainment of the kids, she asked you to solve this problem.

The first line contains one integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. Then $$$t$$$ test cases follow. Each test case consists of one line containing an integer $$$n$$$ ($$$1 \leq n \leq 100$$$) — the number of kids.

Output $$$t$$$ lines, which contain $$$n$$$ distinct integers from $$$1$$$ to $$$4n$$$ — the numbers of chairs that the kids should occupy in the corresponding test case. If there are multiple answers, print any of them. You can print $$$n$$$ numbers in any order.

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 min_int(a int, b int) int { if a < b { return a } else { return b } }
func min_int64(a int64, b int64) int64 { if a < b { return a } else { return b } }

func max_int(a int, b int) int { if a > b { return a } else { return b } }
func max_int64(a int64, b int64) int64 { if a > b { return a } else { return b } }

func main() {
	defer writer.Flush()

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

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

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

		res := make([]int, N)
		for i := 0; i < N; i++ {
			res[i] = 2*(2*N-i)
		}

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

	}

}

package main

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

func solve() {
	t := readInt()
	for i := 0; i < t; i++ {
		solveSingle()
	}
}

func solveSingle() {
	n := readInt()
	up := (n * 4) - 2
	for i := 0; i < n; i++ {
		if i > 0 {
			fmt.Print(" ")
		}
		fmt.Print(up)
		up -= 2
	}
	fmt.Println()
}

var scanner *bufio.Scanner

func main() {
	scanner = bufio.NewScanner(os.Stdin)
	const MaxTokenLength = 1024 * 1024
	scanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)
	scanner.Split(bufio.ScanWords)
	solve()
}

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

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

// IO

func readString() string {
	scanner.Scan()
	return scanner.Text()
}

func readInt() int {
	val, _ := strconv.Atoi(readString())
	return val
}

func readInt64() int64 {
	v, _ := strconv.ParseInt(readString(), 10, 64)
	return v
}

func readIntArray(sz int) []int {
	a := make([]int, sz)
	for i := 0; i < sz; i++ {
		a[i] = readInt()
	}
	return a
}

func readInt64Array(n int) []int64 {
	res := make([]int64, n)
	for i := 0; i < n; i++ {
		res[i] = readInt64()
	}
	return res
}

package main
import "fmt"
func main() {
	q := 0
	fmt.Scan(&q)
	for t := 0; t < q; t++ {
		n := 0
		fmt.Scan(&n)
		for i := 2 * n + 2; i <= 4 * n; i += 2 {
			fmt.Print(i, " ")
		}
		fmt.Println()
	}
}

package main

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

func main() {
	//rd, _ := os.Open("input")
	//in := bufio.NewReader(rd)
	in := bufio.NewReader(os.Stdin)

	var t, n int
	fmt.Fscan(in, &t)

	for ; t > 0; t-- {
		fmt.Fscan(in, &n)
		result := ""
		for i := 0; i < n; i++ {
			result += strconv.Itoa(4*n-2*i) + " "
		}
		fmt.Println(result)
	}
}

package main

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

var reader = bufio.NewReader(os.Stdin)

func main() {
	var t int
	fmt.Fscan(reader, &t)

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

		for j, k := 0, 4*n; j < n; j, k = j+1, k-2 {
			fmt.Printf("%d ", k)
		}

		fmt.Println()
	}
}

package main

import "fmt"

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

	for count := 0; count < t; count++ {
		var q int
		fmt.Scanf("%d\n", &q)

		base := 2 * q

		for i := 0; i < q; i++ {
			fmt.Printf("%d ", base)
			base += 2
			// if i >= 1 {
			// 	base += 2
			// }

		}
		fmt.Println("")

	}
}

package main

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

var scanner = bufio.NewScanner(os.Stdin)
var writer = bufio.NewWriter(os.Stdout)

func print(str string) {
	writer.WriteString(str)
}

func nextInt() int {
	scanner.Scan()
	str := scanner.Text()
	val, _ := strconv.Atoi(str)
	return val
}

func nextFloat() float64 {
	scanner.Scan()
	str := scanner.Text()
	val, _ := strconv.ParseFloat(str, 64)
	return val
}

func nextString() string {
	scanner.Scan()
	str := scanner.Text()
	return str
}

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

func main() {
	scanner.Split(bufio.ScanWords)
	defer writer.Flush()

	t := nextInt()
	for t != 0 {
		n := nextInt()
		for x := n + 1; x <= 2*n; x++ {
			print(strconv.Itoa(2*x) + " ")
		}
		print("\n")
		t--
	}
}

package main

import (
	"fmt"
)

var t,a,s,c int

func main()  {
	fmt.Scan(&t)
	for i:=1;i<=t;i++{
		fmt.Scan(&a)
		s=4*a
		for j:=1;j<=a;j++{
			s-=2
			fmt.Printf("%d ",s)
		}
		fmt.Printf("\n")
	}
}

package main

import (
	"fmt"
)

var t,a,s,c int

func main()  {
	fmt.Scanf("%d",&t)
	for i:=1;i<=t;i++{
		fmt.Scan(&a)
		s=4*a
		for j:=1;j<=a;j++{
			s-=2
			fmt.Printf("%d ",s)
		}
		fmt.Printf("\n")
	}
}

package main
import "fmt"
func solution (n int) ([]int){
		sol:=make([]int,0)

	 for i:=4*n;i>=2*n;i=i-2 {
		 sol=append(sol,i)
		}
		  return  sol
}
func main() {
	var test=0
	fmt.Scanln(&test)
	for t:=1;t<=test;t++{
	var n =0
 fmt.Scanln(&n);
 sol:=solution(n)
 for i:=0;i<n;i++{
	 fmt.Printf("%d ",sol[i])
 }
 fmt.Println()
}

}

package main

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

func main() {

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

	fmt.Fscan(reader, &t)

	for ; t > 0; t-- {
		var n int

		fmt.Fscan(reader, &n)

		var arr []int
		count := 0

		for i := 4 * n; i >= 4; i -= 2 {
			if count == 0 {
				arr = append(arr, i)
				count++
				continue
			}

			if check(i, arr) {
				arr = append(arr, i)
				count++
			}

			if count == n {
				break
			}
		}

		for i := range arr {
			fmt.Printf("%d ", arr[i])
		}

		fmt.Printf("\n")
	}

}

func check(n int, arr []int) bool {
	flag := true

	for i := range arr {
		if n%arr[i] == 0 {
			flag = false
			break
		}
	}

	return flag
}

package main

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

func main() {

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

	fmt.Fscan(reader, &t)

	for ; t > 0; t-- {
		var n int

		fmt.Fscan(reader, &n)

		var arr []int
		count := 0

		for i := 4 * n; i >= 4; i -= 2 {
			if count == 0 {
				arr = append(arr, i)
				count++
				continue
			}

			//if check(i, arr) {
			arr = append(arr, i)
			count++
			//}

			if count == n {
				break
			}
		}

		for i := range arr {
			fmt.Printf("%d ", arr[i])
		}

		fmt.Printf("\n")
	}

}

func check(n int, arr []int) bool {
	flag := true

	for i := range arr {
		if n%arr[i] == 0 {
			flag = false
			break
		}
	}

	return flag
}

package main

import (
	"fmt"
)

func main() {

	var t int

	fmt.Scanf("%d\n", &t)

	for {
		if t == 0 {
			break
		}
		var n int
		fmt.Scanf("%d\n", &n)

		var mark = make([]int, 4*n+1)
		for i := 4 * n; i >= 4; i -= 2 {
			if mark[i] != 0 {
				continue
			}

			fmt.Print(i, " ")

			for j := i; j >= 4; j -= 2 {
				if i%j == 0 {
					mark[j] = 1
				}
			}
		}

		fmt.Println()
		t--
	}
}

package main

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

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

	for ; t>0; t-- {
		fmt.Fscan(io, &n)
		arr := make([]int, 0, n)
		counter = 0
		for i:=4*n; i>0 && counter<n; i-- {
			if i%2==0 {
				if len(arr) != 0 {
					for _, num := range arr {
						if num%i!=0 {
							arr = append(arr, i)
							fmt.Printf("%d ", i)
							counter++
							break
						}
					}
				} else {
					arr = append(arr, i)
					fmt.Printf("%d ", i)
					counter++
				}
			}
		}
		fmt.Println()
	}

}

// You can edit this code!
// Click here and start typing.
package main

import (
	"fmt"
)

func main() {
		var t int
    fmt.Scan(&t)
    for i := 0; i < t; i++ {
				var n int
				fmt.Scan(&n)
				for i := 4 * n; i > 2 * n; i -= 2 {
					fmt.Print(i)
					fmt.Print(" ")
				}
				fmt.Println()
    }
}

/*
URL:
https://codeforces.com/contest/1443/problem/A
*/

package main

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

var (
	t int
	n int
)

func main() {
	defer stdout.Flush()

	t = readi()
	for tc := 0; tc < t; tc++ {
		n = readi()

		solve()
	}
}

func solve() {
	A := []int{}

	for i := 0; i < n; i++ {
		val := 4*n - 2*i
		A = append(A, val)
	}

	fmt.Println(PrintIntsLine(A...))
}

/*******************************************************************/

/********** common constants **********/

const (
	MOD = 1000000000 + 7
	// MOD          = 998244353
	ALPH_N  = 26
	INF_I64 = math.MaxInt64
	INF_B60 = 1 << 60
	INF_I32 = math.MaxInt32
	INF_B30 = 1 << 30
	NIL     = -1
	EPS     = 1e-10
)

/********** bufio setting **********/

func init() {
	// bufio.ScanWords <---> bufio.ScanLines
	reads = newReadString(os.Stdin, bufio.ScanWords)
	stdout = bufio.NewWriter(os.Stdout)
}

// mod can calculate a right residual whether value is positive or negative.
func mod(val, m int) int {
	res := val % m
	if res < 0 {
		res += m
	}
	return res
}

// min returns the min integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func min(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m > integer {
			m = integer
		}
	}
	return m
}

// max returns the max integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func max(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m < integer {
			m = integer
		}
	}
	return m
}

// chmin accepts a pointer of integer and a target value.
// If target value is SMALLER than the first argument,
//	then the first argument will be updated by the second argument.
func chmin(updatedValue *int, target int) bool {
	if *updatedValue > target {
		*updatedValue = target
		return true
	}
	return false
}

// chmax accepts a pointer of integer and a target value.
// If target value is LARGER than the first argument,
//	then the first argument will be updated by the second argument.
func chmax(updatedValue *int, target int) bool {
	if *updatedValue < target {
		*updatedValue = target
		return true
	}
	return false
}

// sum returns multiple integers sum.
func sum(integers ...int) int {
	var s int
	s = 0

	for _, i := range integers {
		s += i
	}

	return s
}

// abs is integer version of math.Abs
func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

// pow is integer version of math.Pow
// pow calculate a power by Binary Power (二分累乗法(O(log e))).
func pow(a, e int) int {
	if a < 0 || e < 0 {
		panic(errors.New("[argument error]: PowInt does not accept negative integers"))
	}

	if e == 0 {
		return 1
	}

	if e%2 == 0 {
		halfE := e / 2
		half := pow(a, halfE)
		return half * half
	}

	return a * pow(a, e-1)
}

/********** FAU standard libraries **********/

//fmt.Sprintf("%b\n", 255) 	// binary expression

/********** I/O usage **********/

//str := reads()
//i := readi()
//X := readis(n)
//S := readrs()
//a := readf()
//A := readfs(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

/*********** Input ***********/

var (
	// reads returns a WORD string.
	reads  func() string
	stdout *bufio.Writer
)

func newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	r.Split(sf)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// readi returns an integer.
func readi() int {
	return int(_readInt64())
}
func readi2() (int, int) {
	return int(_readInt64()), int(_readInt64())
}
func readi3() (int, int, int) {
	return int(_readInt64()), int(_readInt64()), int(_readInt64())
}
func readi4() (int, int, int, int) {
	return int(_readInt64()), int(_readInt64()), int(_readInt64()), int(_readInt64())
}

// readll returns as integer as int64.
func readll() int64 {
	return _readInt64()
}
func readll2() (int64, int64) {
	return _readInt64(), _readInt64()
}
func readll3() (int64, int64, int64) {
	return _readInt64(), _readInt64(), _readInt64()
}
func readll4() (int64, int64, int64, int64) {
	return _readInt64(), _readInt64(), _readInt64(), _readInt64()
}

func _readInt64() int64 {
	i, err := strconv.ParseInt(reads(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// readis returns an integer slice that has n integers.
func readis(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = readi()
	}
	return b
}

// readlls returns as int64 slice that has n integers.
func readlls(n int) []int64 {
	b := make([]int64, n)
	for i := 0; i < n; i++ {
		b[i] = readll()
	}
	return b
}

// readf returns an float64.
func readf() float64 {
	return float64(_readFloat64())
}

func _readFloat64() float64 {
	f, err := strconv.ParseFloat(reads(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func readfs(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = readf()
	}
	return b
}

// readrs returns a rune slice.
func readrs() []rune {
	return []rune(reads())
}

/*********** Output ***********/

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintIntsLine returns integers string delimited by a space.
func PrintInts64Line(A ...int64) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.FormatInt(A[i], 10) // 64bit int version
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// Printf is function for output strings to buffered os.Stdout.
// You may have to call stdout.Flush() finally.
func printf(format string, a ...interface{}) {
	fmt.Fprintf(stdout, format, a...)
}

/*********** Debugging ***********/

// debugf is wrapper of fmt.Fprintf(os.Stderr, format, a...)
func debugf(format string, a ...interface{}) {
	fmt.Fprintf(os.Stderr, format, a...)
}

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

package main

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

var reader = bufio.NewReader(os.Stdin)

func main() {
	var t int
	fmt.Fscan(reader, &t)

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

		sieve := make([]bool, 4*n+1)
		var chairs []int
		for j := 4; j <= 4*n; j += 2 {
			if len(chairs) == n {
				break
			}

			if j%2 == 1 {
				continue
			}

			if sieve[j] == true {
				continue
			}

			chairs = append(chairs, j)

			for k := j + j; k <= 4*n; k += j {
				sieve[k] = true
			}
		}

		for _, c := range chairs {
			fmt.Printf("%d ", c)
		}
		fmt.Println()
	}
}

package main

import "fmt"

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

	for count := 0; count < t; count++ {
		var q int
		fmt.Scanf("%d\n", &q)

		base := 4

		for i := 0; i < q; i++ {
			fmt.Printf("%d ", base)
			base += 2
			if i >= 1 {
				base += 2
			}

		}
		fmt.Println("")

	}
}

package main

import (
	"fmt"
)

var t,a,s,c int

func main()  {
	fmt.Scanf("%d",&t)
	for i:=1;i<=t;i++{
		fmt.Scanf("%d",&a)
		s=4*a
		for j:=1;j<=a;j++{
			s-=2
			if j!=a {
				fmt.Printf("%d ",s)
			}else{
				fmt.Printf("%d\n",s)
			}
		}
	}
}

package main

import (
	"fmt"
)

var t,a,s,c int

func main()  {
	fmt.Scanf("%d",&t)
	for i:=1;i<=t;i++{
		fmt.Scanf("%d",&a)
		s=4
		for j:=1;j<=a;j++{
			fmt.Printf("%d ",s)
			if j==1 {
				s+=2
			}else {
				s+=4
			}
		}
		fmt.Printf("\n")
	}
}

package main

import (
	"fmt"
)

var t,a,s,c int

func main()  {
	fmt.Scanf("%d",&t)
	for i:=1;i<=t;i++{
		fmt.Scanf("%d",&a)
		s=4
		for j:=1;j<=a;j++{
			fmt.Printf("%d ",s)
			if j==1 {
				s+=2
			}else {
				s+=4
			}
		}
		fmt.Println()
	}
}

package main

import (
	"fmt"
)

var t,a,s,c int

func main()  {
	fmt.Scanf("%d",&t)
	for i:=1;i<=t;i++{
		fmt.Scanf("%d",&a)
		s=4*a
		for j:=1;j<=a;j++{
			s-=2
			fmt.Printf("%d ",s)
		}
		fmt.Printf("\n")
	}
}

package main

import (
	"fmt"
)

var t,a,s,c int

func main()  {
	fmt.Scanf("%d",&t)
	for i:=1;i<=t;i++{
		fmt.Scanf("%d",&a)
		s=4
		c=2
		for j:=1;j<=a;j++{
			fmt.Printf("%d ",s)
			s+=c
			c+=2
		}
		fmt.Println()
	}
}

package main
import "fmt"
func solution (n int) ([]int){
		sol:=make([]int,0)
     for i:=1;i<=4*n;i++{
		 if i%2!=0{
			sol=append(sol,2*i)

		 }
	 }
	 return  sol
}
func main() {
	var test=0
	fmt.Scanln(&test)
	for t:=1;t<=test;t++{
	var n =0
 fmt.Scanln(&n);
 sol:=solution(n)
 for i:=0;i<n;i++{
	 fmt.Printf("%d ",sol[i])
 }
 fmt.Println()
}

}

package main
import "fmt"
func solution (n int) ([]int){
		sol:=make([]int,0)
		sol=append(sol,4)
     for i:=2;i<=4*n;i++{
		 if i%2!=0{
			sol=append(sol,2*i)

		 }
	 }
	 return  sol
}
func main() {
	var test=0
	fmt.Scanln(&test)
	for t:=1;t<=test;t++{
	var n =0
 fmt.Scanln(&n);
 sol:=solution(n)
 for i:=0;i<n;i++{
	 fmt.Printf("%d ",sol[i])
 }
 fmt.Println()
}

}

package main
import "fmt"
func solution (n int) ([]int){
		sol:=make([]int,0)
     for i:=2;i<=4*n;i++{
		 if i%2!=0{
			sol=append(sol,2*i)

		 }
	 }
	 return  sol
}
func main() {
	var test=0
	fmt.Scanln(&test)
	for t:=1;t<=test;t++{
	var n =0
 fmt.Scanln(&n);
 sol:=solution(n)
 for i:=0;i<n;i++{
	 fmt.Printf("%d ",sol[i])
 }
 fmt.Println()
}

}

package main

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

func main() {

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

	fmt.Fscan(reader, &t)

	for ; t > 0; t-- {
		var n int

		fmt.Fscan(reader, &n)

		var arr []int
		count := 0

		for i := 4*n - 2; i >= 4; i -= 2 {
			if count == 0 {
				arr = append(arr, i)
				count++
				continue
			}

			if check(i, arr) {
				arr = append(arr, i)
				count++
			}

			if count == n {
				break
			}
		}

		for i := range arr {
			fmt.Printf("%d ", arr[i])
		}

		fmt.Printf("\n")
	}

}

func check(n int, arr []int) bool {
	flag := true

	for i := range arr {
		if n%arr[i] == 0 {
			flag = false
			break
		}
	}

	return flag
}

package main

import (
	"fmt"
)

func main() {

	var t int

	fmt.Scanf("%d\n", &t)

	for {
		if t == 0 {
			break
		}
		var n int
		fmt.Scanf("%d\n", &n)
		var mark = make([]int, 4*n+1)

		for i := 4; i <= 4*n; i += 2 {
			if mark[i] != 0 {
				continue
			}

			fmt.Print(i, " ")
			for j := i; j <= 4*n; j += i {
				mark[j] = 1
			}
		}
		fmt.Println()
		t--
	}
}

package main

import (
	"fmt"
)

func main() {

	var t int

	fmt.Scanf("%d", &t)

	for {
		if t == 0 {
			break
		}
		var n int
		fmt.Scanf("%d", &n)
		var mark = make([]int, 4*n+1)

		for i := 4; i <= 4*n; i += 2 {
			if mark[i] != 0 {
				continue
			}

			fmt.Print(i, " ")
			for j := i; j <= 4*n; j += i {
				mark[j] = 1
			}
		}
		fmt.Println()
		t--
	}
}

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 min_int(a int, b int) int { if a < b { return a } else { return b } }
func min_int64(a int64, b int64) int64 { if a < b { return a } else { return b } }

func max_int(a int, b int) int { if a > b { return a } else { return b } }
func max_int64(a int64, b int64) int64 { if a > b { return a } else { return b } }

func main() {
	defer writer.Flush()

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

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

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

		res := make([]int, N)
		for i := N; i >= 1; i-- {
			res[i-1] = 2*(2*i-1)
		}

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

	}

}


You are given an integer value $$$x$$$ and a string $$$s$$$ consisting of digits from $$$1$$$ to $$$9$$$ inclusive.A substring of a string is a contiguous subsequence of that string.Let $$$f(l, r)$$$ be the sum of digits of a substring $$$s[l..r]$$$.Let's call substring $$$s[l_1..r_1]$$$ $$$x$$$-prime if   $$$f(l_1, r_1) = x$$$;  there are no values $$$l_2, r_2$$$ such that   $$$l_1 \le l_2 \le r_2 \le r_1$$$;  $$$f(l_2, r_2) \neq x$$$;  $$$x$$$ is divisible by $$$f(l_2, r_2)$$$.  You are allowed to erase some characters from the string. If you erase a character, the two resulting parts of the string are concatenated without changing their order.What is the minimum number of characters you should erase from the string so that there are no $$$x$$$-prime substrings in it? If there are no $$$x$$$-prime substrings in the given string $$$s$$$, then print $$$0$$$.

The first line contains a string $$$s$$$ ($$$1 \le |s| \le 1000$$$). $$$s$$$ contains only digits from $$$1$$$ to $$$9$$$ inclusive. The second line contains an integer $$$x$$$ ($$$1 \le x \le 20$$$).

Print a single integer — the minimum number of characters you should erase from the string so that there are no $$$x$$$-prime substrings in it. If there are no $$$x$$$-prime substrings in the given string $$$s$$$, then print $$$0$$$.

NoteIn the first example there are two $$$8$$$-prime substrings "8" and "53". You can erase these characters to get rid of both: "116285317". The resulting string "1162317" contains no $$$8$$$-prime substrings. Removing these characters is also a valid answer: "116285317".In the second example you just have to erase both ones.In the third example there are no $$$13$$$-prime substrings. There are no substrings with the sum of digits equal to $$$13$$$ at all.In the fourth example you can have neither "34", nor "43" in a string. Thus, you have to erase either all threes or all fours. There are $$$5$$$ of each of them, so it doesn't matter which.

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	s, _ := reader.ReadString('\n')
	var n int
	for i := 0; i < len(s); i++ {
		if s[i] < '1' || s[i] > '9' {
			break
		}
		n++
	}
	x := readNum(reader)

	res := solve(s[:n], x)

	fmt.Println(res)
}

func readInt(bytes []byte, from int, val *int) int {
	i := from
	sign := 1
	if bytes[i] == '-' {
		sign = -1
		i++
	}
	tmp := 0
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + int(bytes[i]-'0')
		i++
	}
	*val = tmp * sign
	return i
}

func readNum(reader *bufio.Reader) (a int) {
	bs, _ := reader.ReadBytes('\n')
	readInt(bs, 0, &a)
	return
}

func readTwoNums(reader *bufio.Reader) (a int, b int) {
	res := readNNums(reader, 2)
	a, b = res[0], res[1]
	return
}

func readThreeNums(reader *bufio.Reader) (a int, b int, c int) {
	res := readNNums(reader, 3)
	a, b, c = res[0], res[1], res[2]
	return
}

func readNNums(reader *bufio.Reader, n int) []int {
	res := make([]int, n)
	x := 0
	bs, _ := reader.ReadBytes('\n')
	for i := 0; i < n; i++ {
		for x < len(bs) && (bs[x] < '0' || bs[x] > '9') && bs[x] != '-' {
			x++
		}
		x = readInt(bs, x, &res[i])
	}
	return res
}

func readUint64(bytes []byte, from int, val *uint64) int {
	i := from

	var tmp uint64
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + uint64(bytes[i]-'0')
		i++
	}
	*val = tmp

	return i
}

func solve(s string, x int) int {

	trie := NewTrie(N)

	var generate func(sum int)

	buf := make([]byte, 0, 100)

	generate = func(sum int) {
		if sum == x {
			var ok = true
			for l := 0; l < len(buf) && ok; l++ {
				var cur int
				for r := l; r < len(buf) && ok; r++ {
					cur += int(buf[r] - '0')
					if x%cur == 0 && cur != x {
						ok = false
					}
				}
			}
			if ok {
				trie.AddString(string(buf))
			}
			return
		}
		for j := 1; j <= min(x-sum, 9); j++ {
			n := len(buf)
			buf = append(buf, byte(j+'0'))
			generate(sum + j)
			buf = buf[:n]
		}
	}

	generate(0)

	dp := make([][]int, len(s)+1)
	for i := 0; i <= len(s); i++ {
		dp[i] = make([]int, len(trie.nodes)+1)
		for j := 0; j < len(dp[i]); j++ {
			dp[i][j] = INF
		}
	}

	dp[0][0] = 0

	for i := 0; i < len(s); i++ {
		for j := 0; j < len(trie.nodes); j++ {
			if dp[i][j] == INF {
				continue
			}
			dp[i+1][j] = min(dp[i+1][j], dp[i][j]+1)
			next := trie.Transition(j, int(s[i]-'1'))
			if !trie.nodes[next].leaf {
				dp[i+1][next] = min(dp[i+1][next], dp[i][j])
			}
		}
	}
	var res = INF

	for j := 0; j < len(trie.nodes); j++ {
		res = min(res, dp[len(s)][j])
	}

	return res
}

const AL = 9
const N = 5000
const INF = 1000000000

type Node struct {
	next       [AL]int
	parent     int
	parentByte int
	suffixLink int
	transition [AL]int
	leaf       bool
}

func NewNode() *Node {
	node := new(Node)
	for i := 0; i < AL; i++ {
		node.next[i] = -1
		node.transition[i] = -1
	}
	node.suffixLink = -1
	node.parent = -1
	node.leaf = false
	return node
}

type Trie struct {
	nodes []*Node
}

func NewTrie(sizeHint int) *Trie {
	trie := new(Trie)
	trie.nodes = make([]*Node, 0, sizeHint+1)
	trie.nodes = append(trie.nodes, NewNode())
	return trie
}

func (trie *Trie) AddString(s string) {
	var v int
	nodes := trie.nodes
	for i := 0; i < len(s); i++ {
		c := int(s[i] - '1')
		if nodes[v].next[c] == -1 {
			nodes[v].next[c] = len(nodes)
			cur := NewNode()
			nodes = append(nodes, cur)
			cur.parent = v
			cur.parentByte = c
		}
		v = nodes[v].next[c]
	}
	nodes[v].leaf = true
	trie.nodes = nodes
}

func (trie *Trie) Transition(v int, c int) int {
	if trie.nodes[v].transition[c] == -1 {
		if trie.nodes[v].next[c] != -1 {
			trie.nodes[v].transition[c] = trie.nodes[v].next[c]
		} else {
			if v == 0 {
				trie.nodes[v].transition[c] = 0
			} else {
				trie.nodes[v].transition[c] = trie.Transition(trie.GetLink(v), c)
			}
		}
	}
	return trie.nodes[v].transition[c]
}

func (trie *Trie) GetLink(v int) int {
	if trie.nodes[v].suffixLink == -1 {
		if v == 0 || trie.nodes[v].parent == 0 {
			trie.nodes[v].suffixLink = 0
		} else {
			trie.nodes[v].suffixLink =
				trie.Transition(trie.GetLink(trie.nodes[v].parent), trie.nodes[v].parentByte)
		}
	}

	return trie.nodes[v].suffixLink
}

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


Let $$$f(x)$$$ be the sum of digits of a decimal number $$$x$$$.Find the smallest non-negative integer $$$x$$$ such that $$$f(x) + f(x + 1) + \dots + f(x + k) = n$$$.

The first line contains one integer $$$t$$$ ($$$1 \le t \le 150$$$) — the number of test cases. Each test case consists of one line containing two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 150$$$, $$$0 \le k \le 9$$$).

For each test case, print one integer without leading zeroes. If there is no such $$$x$$$ that $$$f(x) + f(x + 1) + \dots + f(x + k) = n$$$, print $$$-1$$$; otherwise, print the minimum $$$x$$$ meeting that constraint.


Let us define a magic grid to be a square matrix of integers of size $$$n \times n$$$, satisfying the following conditions.   All integers from $$$0$$$ to $$$(n^2 - 1)$$$ inclusive appear in the matrix exactly once.  Bitwise XOR of all elements in a row or a column must be the same for each row and column. You are given an integer $$$n$$$ which is a multiple of $$$4$$$. Construct a magic grid of size $$$n \times n$$$.

The only line of input contains an integer $$$n$$$ ($$$4 \leq n \leq 1000$$$). It is guaranteed that $$$n$$$ is a multiple of $$$4$$$.

Print a magic grid, i.e. $$$n$$$ lines, the $$$i$$$-th of which contains $$$n$$$ space-separated integers, representing the $$$i$$$-th row of the grid. If there are multiple answers, print any. We can show that an answer always exists.

NoteIn the first example, XOR of each row and each column is $$$13$$$.In the second example, XOR of each row and each column is $$$60$$$.

package main

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

// github.com/EndlessCheng/codeforces-go
func main() {
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var n int
	Scan(&n)
	ans := make([][]interface{}, n)
	for i := range ans {
		ans[i] = make([]interface{}, n)
	}
	n /= 2
	for i, c := 0, 0; i < n; i++ {
		for j := 0; j < n; j++ {
			ans[i][j] = 4 * c
			ans[i][j+n] = 4*c + 1
			ans[i+n][j] = 4*c + 2
			ans[i+n][j+n] = 4*c + 3
			c++
		}
	}
	for _, row := range ans {
		Fprintln(out, row...)
	}
}

package main

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

func main() {
	var n int
	fmt.Scanf("%d\n", &n)
	a := make([][]int, n)
	for i := range a {
		a[i] = make([]int, n)
	}

	cnt := 0
	for i := 0; i < n; i+=2 {
		for j := 0; j < n; j += 2 {
			a[i][j] = cnt
			a[i][j + 1] = cnt + 1
			a[i + 1][j] = cnt + 2
			a[i + 1][j + 1] = cnt + 3
			cnt += 4
		}
	}

	m := make(map[int]bool)
	for i := 0; i < n; i++ {
		x := 0
		for j := 0; j < n; j++ {
			x ^= a[i][j]
		}
		m[x] = true
	}
	for j := 0; j < n; j++ {
		x := 0
		for i := 0; i < n; i++ {
			x ^= a[i][j]
		}
		m[x] = true
	}

	if len(m) != 1 {
		fmt.Println("OOPS")
		os.Exit(1)
	}

	f := bufio.NewWriter(os.Stdout)
	for i := 0; i < n; i++ {
		for j := 0; j < n; j++ {
			f.WriteString(strconv.Itoa(a[i][j]))
			if j + 1 < n {
				f.WriteString(" ")
			}
		}
		f.WriteString("\n")
	}
	f.Flush()
}

// Author: sighduck
// URL: https://codeforces.com/contest/1208/problem/C

package main

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

func Solve(n int) [][]int {
	matrix := make([][]int, n)
	for i := 0; i < n; i++ {
		matrix[i] = make([]int, n)
	}
	for i := 0; i < n; i++ {
		for j := 0; j < n; j++ {
			d := n / 2
			mi, mj := i%d, j%d
			baseValue := d*(mi) + mj
			matrix[i][j] = baseValue
			quadrant := 2*(i/d) + j/d
			matrix[i][j] = 4*baseValue + quadrant
		}
	}
	return matrix
}

func main() {
	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	var n int
	fmt.Fscanf(reader, "%d\n", &n)

	matrix := Solve(n)
	for i := 0; i < n; i++ {
		for _, elem := range matrix[i] {
			fmt.Fprintf(writer, "%d ", elem)
		}
		fmt.Fprintf(writer, "\n")
	}
}

// Author: sighduck
// URL: https://codeforces.com/contest/1208/problem/C

package main

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

func Solve(n int) [][]int {
	matrix := make([][]int, n)
	for i := 0; i < n; i++ {
		matrix[i] = make([]int, n)
	}
	for i := 0; i < n; i++ {
		for j := 0; j < n; j++ {
			mi, mj := i%2, j%2
			baseValue := n/2*(mi) + mj
			quadrant := 2*(i/2) + j/2
			matrix[i][j] = 4*baseValue + quadrant
		}
	}
	return matrix
}

func main() {
	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	var n int
	fmt.Fscanf(reader, "%d\n", &n)

	matrix := Solve(n)
	for i := 0; i < n; i++ {
		for _, elem := range matrix[i] {
			fmt.Fprintf(writer, "%d ", elem)
		}
		fmt.Fprintf(writer, "\n")
	}
}


You wrote down all integers from $$$0$$$ to $$$10^n - 1$$$, padding them with leading zeroes so their lengths are exactly $$$n$$$. For example, if $$$n = 3$$$ then you wrote out 000, 001, ..., 998, 999.A block in an integer $$$x$$$ is a consecutive segment of equal digits that cannot be extended to the left or to the right.For example, in the integer $$$00027734000$$$ there are three blocks of length $$$1$$$, one block of length $$$2$$$ and two blocks of length $$$3$$$.For all integers $$$i$$$ from $$$1$$$ to $$$n$$$ count the number of blocks of length $$$i$$$ among the written down integers.Since these integers may be too large, print them modulo $$$998244353$$$.

The only line contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$).

In the only line print $$$n$$$ integers. The $$$i$$$-th integer is equal to the number of blocks of length $$$i$$$. Since these integers may be too large, print them modulo $$$998244353$$$.

/*
URL:
https://codeforces.com/problemset/problem/1327/E
*/

package main

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

/********** FAU standard libraries **********/

//fmt.Sprintf("%b\n", 255) 	// binary expression

/********** I/O usage **********/

//str := ReadString()
//i := ReadInt()
//X := ReadIntSlice(n)
//S := ReadRuneSlice()
//a := ReadFloat64()
//A := ReadFloat64Slice(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

/*******************************************************************/

const (
	// General purpose
	// MOD          = 1000000000 + 7
	MOD          = 998244353
	ALPHABET_NUM = 26
	INF_INT64    = math.MaxInt64
	INF_BIT60    = 1 << 60
	INF_INT32    = math.MaxInt32
	INF_BIT30    = 1 << 30
	NIL          = -1

	// for dijkstra, prim, and so on
	WHITE = 0
	GRAY  = 1
	BLACK = 2
)

func init() {
	// bufio.ScanWords <---> bufio.ScanLines
	ReadString = newReadString(os.Stdin, bufio.ScanWords)
	stdout = bufio.NewWriter(os.Stdout)
}

var (
	n int64

	ans int64
	P   [200000 + 50]int64
)

func main() {
	n = ReadInt64()

	P[0] = 1
	for i := 1; i <= 200000+10; i++ {
		P[i] = P[i-1] * 10
		P[i] %= MOD
	}

	answers := []int64{}
	for i := int64(1); i < n; i++ {
		ans = 1
		if n-i-1 >= 0 {
			ans = 2 * 10 * 9 * P[n-i-1]
		}
		ans %= MOD

		if n-i-2 >= 0 {
			ans += (n - 1 - i) * 10 * 9 * 9 * P[n-i-2]
		}
		ans %= MOD

		answers = append(answers, ans)
	}
	answers = append(answers, 10)

	fmt.Println(PrintInts64Line(answers...))
}

/*******************************************************************/

/*********** I/O ***********/

var (
	// ReadString returns a WORD string.
	ReadString func() string
	stdout     *bufio.Writer
)

func newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	r.Split(sf)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// ReadInt returns an integer.
func ReadInt() int {
	return int(readInt64())
}
func ReadInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func ReadInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func ReadInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

// ReadInt64 returns as integer as int64.
func ReadInt64() int64 {
	return readInt64()
}
func ReadInt64_2() (int64, int64) {
	return readInt64(), readInt64()
}
func ReadInt64_3() (int64, int64, int64) {
	return readInt64(), readInt64(), readInt64()
}
func ReadInt64_4() (int64, int64, int64, int64) {
	return readInt64(), readInt64(), readInt64(), readInt64()
}

func readInt64() int64 {
	i, err := strconv.ParseInt(ReadString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// ReadIntSlice returns an integer slice that has n integers.
func ReadIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt()
	}
	return b
}

// ReadInt64Slice returns as int64 slice that has n integers.
func ReadInt64Slice(n int) []int64 {
	b := make([]int64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt64()
	}
	return b
}

// ReadFloat64 returns an float64.
func ReadFloat64() float64 {
	return float64(readFloat64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(ReadString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func ReadFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadFloat64()
	}
	return b
}

// ReadRuneSlice returns a rune slice.
func ReadRuneSlice() []rune {
	return []rune(ReadString())
}

/*********** Debugging ***********/

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

// Strtoi is a wrapper of strconv.Atoi().
// If strconv.Atoi() returns an error, Strtoi calls panic.
func Strtoi(s string) int {
	if i, err := strconv.Atoi(s); err != nil {
		panic(errors.New("[argument error]: Strtoi only accepts integer string"))
	} else {
		return i
	}
}

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintIntsLine returns integers string delimited by a space.
func PrintInts64Line(A ...int64) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.FormatInt(A[i], 10) // 64bit int version
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)
func PrintfDebug(format string, a ...interface{}) {
	fmt.Fprintf(os.Stderr, format, a...)
}

// PrintfBufStdout is function for output strings to buffered os.Stdout.
// You may have to call stdout.Flush() finally.
func PrintfBufStdout(format string, a ...interface{}) {
	fmt.Fprintf(stdout, format, a...)
}

package main

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

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

	var n int
	Fscan(in, &n)
	// seg => ans
	const mod int64 = 998244353

	ans := make([]int64, n)
	ans[0] = 10
	sum :=int64(10)
	ten := int64(10)
	for i := 1; i < n; i++ {
		a := 9*(ten+sum)%mod
		sum+=a
		ans[i]=a
		ten=ten*10%mod
	}
	for i := len(ans) - 1; i >= 0; i-- {
		v := ans[i]
		Fprint(out, v," ")
	}

}

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

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

func GetPrimeList(n int) []int {
	var plist []int
	chk := make([]bool, n+1)
	for i := 2; i <= n; i++ { chk[i] = false }
	for i := 2; i <= n; i++ {
		if !chk[i] {
			plist = append(plist, i)
			for j := int64(i) * int64(i); j <= int64(n); j += int64(i) {
				chk[j] = true
			}
		}
	}
	return plist
}

type Factor struct {
	val int
	size int
}

func GetPrimeFactors(n int, primes *[]int) []Factor {
	var factors []Factor
	for i := 0; i < len(*primes) && int64((*primes)[i]) * int64((*primes)[i]) <= int64(n); i++ {
		if n % (*primes)[i] == 0 {
			size := 0
			for ; n % (*primes)[i] == 0; {
				n /= (*primes)[i]
				size++
			}
			factors = append(factors, Factor{(*primes)[i], size})
		}
	}
	if n != 1 {
		factors = append(factors, Factor{n, 1})
	}
	return factors
}

func GenDivisor(idx, val int, factors *[]Factor, divisor *[]int) {
	if idx == len(*factors) {
		*divisor = append(*divisor, val)
		return
	}

	for j := 0; j <= (*factors)[idx].size; j++ {
		GenDivisor(idx+1, val, factors, divisor)
		val *= (*factors)[idx].val
	}
}

func GetLeast(n int, primes *[]int, colors *[]int) int {
	ret := n
	factors := GetPrimeFactors(n, primes)
	var divisors []int
	GenDivisor(0, 1, &factors, &divisors)
	for _, div := range divisors {
		cs := make([]int, div)
		for i := range cs {
			cs[i] = 0
		}
		for i := 0; i < n; i++ {
			if cs[i%div] == 0 {
				cs[i%div] = (*colors)[i]
			} else if cs[i%div] != (*colors)[i] {
				cs[i%div] = -1
			}
		}
		for _, state := range cs {
			if state != -1 && ret > div {
				ret = div
			}
		}
	}
	return ret
}

func dfs(cur int, adj *[]int, vis *[]bool, colors, arr_col *[]int) int {
	if (*vis)[cur] {
		return 0
	}
	*arr_col = append(*arr_col, (*colors)[cur])
	(*vis)[cur] = true
	return dfs((*adj)[cur], adj, vis, colors, arr_col) + 1
}

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

	var n int64
	Fscan(in, &n)

	ans := make([]int64, n+1)
	ans[n] = 10

	var tf, MOD int64 = 1, 998244353
	for l := n-1; l > 0; l-- {
		a, b := int64(9*9), int64(180)
		ans[l] = tf * ((n-int64(l)-int64(1))*a + b) % MOD;
		tf = tf * 10 % MOD;
	}
	for i := int64(1); i<=n; i++ {
		Fprintf(out, "%d ", ans[i])
	}
}

/*
URL:
https://codeforces.com/problemset/problem/1327/E
*/

package main

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

/********** FAU standard libraries **********/

//fmt.Sprintf("%b\n", 255) 	// binary expression

/********** I/O usage **********/

//str := ReadString()
//i := ReadInt()
//X := ReadIntSlice(n)
//S := ReadRuneSlice()
//a := ReadFloat64()
//A := ReadFloat64Slice(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

/*******************************************************************/

const (
	// General purpose
	// MOD          = 1000000000 + 7
	MOD          = 998244353
	ALPHABET_NUM = 26
	INF_INT64    = math.MaxInt64
	INF_BIT60    = 1 << 60
	INF_INT32    = math.MaxInt32
	INF_BIT30    = 1 << 30
	NIL          = -1

	// for dijkstra, prim, and so on
	WHITE = 0
	GRAY  = 1
	BLACK = 2
)

func init() {
	// bufio.ScanWords <---> bufio.ScanLines
	ReadString = newReadString(os.Stdin, bufio.ScanWords)
	stdout = bufio.NewWriter(os.Stdout)
}

var (
	n int64

	ans int64
	P   [200000 + 50]int64
)

func main() {
	n = ReadInt64()

	P[0] = 1
	for i := 1; i <= 200000+10; i++ {
		P[i] = P[i-1] * 10
		P[i] %= MOD
	}

	answers := []int64{}
	for i := int64(1); i < n; i++ {
		ans = 1
		if n-i-1 >= 0 {
			ans = 2 * 10 * 9 * P[n-i-1]
		}
		ans %= MOD

		if n-i-2 >= 0 {
			ans += (n - 1 - i) * 10 * 9 * 9 * P[n-i-2]
		}

		answers = append(answers, ans)
	}
	answers = append(answers, 10)

	fmt.Println(PrintInts64Line(answers...))
}

/*******************************************************************/

/*********** I/O ***********/

var (
	// ReadString returns a WORD string.
	ReadString func() string
	stdout     *bufio.Writer
)

func newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	r.Split(sf)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// ReadInt returns an integer.
func ReadInt() int {
	return int(readInt64())
}
func ReadInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func ReadInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func ReadInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

// ReadInt64 returns as integer as int64.
func ReadInt64() int64 {
	return readInt64()
}
func ReadInt64_2() (int64, int64) {
	return readInt64(), readInt64()
}
func ReadInt64_3() (int64, int64, int64) {
	return readInt64(), readInt64(), readInt64()
}
func ReadInt64_4() (int64, int64, int64, int64) {
	return readInt64(), readInt64(), readInt64(), readInt64()
}

func readInt64() int64 {
	i, err := strconv.ParseInt(ReadString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// ReadIntSlice returns an integer slice that has n integers.
func ReadIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt()
	}
	return b
}

// ReadInt64Slice returns as int64 slice that has n integers.
func ReadInt64Slice(n int) []int64 {
	b := make([]int64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt64()
	}
	return b
}

// ReadFloat64 returns an float64.
func ReadFloat64() float64 {
	return float64(readFloat64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(ReadString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func ReadFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadFloat64()
	}
	return b
}

// ReadRuneSlice returns a rune slice.
func ReadRuneSlice() []rune {
	return []rune(ReadString())
}

/*********** Debugging ***********/

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

// Strtoi is a wrapper of strconv.Atoi().
// If strconv.Atoi() returns an error, Strtoi calls panic.
func Strtoi(s string) int {
	if i, err := strconv.Atoi(s); err != nil {
		panic(errors.New("[argument error]: Strtoi only accepts integer string"))
	} else {
		return i
	}
}

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintIntsLine returns integers string delimited by a space.
func PrintInts64Line(A ...int64) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.FormatInt(A[i], 10) // 64bit int version
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)
func PrintfDebug(format string, a ...interface{}) {
	fmt.Fprintf(os.Stderr, format, a...)
}

// PrintfBufStdout is function for output strings to buffered os.Stdout.
// You may have to call stdout.Flush() finally.
func PrintfBufStdout(format string, a ...interface{}) {
	fmt.Fprintf(stdout, format, a...)
}


You are given $$$n$$$ sticks with positive integral length $$$a_1, a_2, \ldots, a_n$$$.You can perform the following operation any number of times (possibly zero):   choose one stick, then either increase or decrease its length by $$$1$$$. After each operation, all sticks should have positive lengths. What is the minimum number of operations that you have to perform such that it is possible to select three of the $$$n$$$ sticks and use them without breaking to form an equilateral triangle?An equilateral triangle is a triangle where all of its three sides have the same length.

The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 300$$$) — the number of sticks. The second line of each test case contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$1 \le a_i \le 10^9$$$) — the lengths of the sticks. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$300$$$.

For each test case, print one integer on a single line — the minimum number of operations to be made.

NoteIn the first test case, you can increase the length of the first stick by $$$1$$$, then decrease the length of the third stick by $$$1$$$. In total, you perform $$$2$$$ operations, such that the three sticks form an equilateral triangle of side length $$$2$$$.In the fourth test case, you can decrease the length of the seventh stick by $$$1$$$. An equilateral triangle of side length $$$1$$$ can be selected and formed by the second, fourth, and seventh sticks.

package main

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

func main() {

	var testCases, inputArrayLength int

	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	fmt.Fscan(in, &testCases)

	for testCase := 0; testCase < testCases; testCase++ {

		fmt.Fscan(in, &inputArrayLength)

		inputArr := make([]int, inputArrayLength)

		output := -1

		for j := 0; j < inputArrayLength; j++ {
			var stickLength int
			fmt.Fscan(in, &stickLength)

			inputArr[j] = stickLength
		}

		if output == 0 {
			fmt.Fprintln(out, output)
			continue
		}
		output = solve(&inputArr)
		fmt.Fprintln(out, output)
	}
}

func solve(arr *[]int) int {

	sort.Ints(*arr)
	minSteps := math.MaxInt

	for i := 1; i < len(*arr)-1; i++ {
		minSteps = min(minSteps, ((*arr)[i]-(*arr)[i-1])+((*arr)[i+1]-(*arr)[i]))
	}
	return minSteps
}

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

package main

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

func main() {

	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	var testCases int
	fmt.Fscan(in, &testCases)
	for testCase := 0; testCase < testCases; testCase++ {
		var inputArrayLength int
		fmt.Fscan(in, &inputArrayLength)

		inputArr := make([]int, inputArrayLength)
		for i := 0; i < inputArrayLength; i++ {
			fmt.Fscan(in, &inputArr[i])
		}

		output := solve(&inputArr)
		fmt.Fprintln(out, output)
	}
}

func solve(arr *[]int) int {

	sort.Ints(*arr)
	minSteps := math.MaxInt

	for i := 1; i < len(*arr)-1; i++ {
		minSteps = min(minSteps, ((*arr)[i]-(*arr)[i-1])+((*arr)[i+1]-(*arr)[i]))
	}
	return minSteps
}

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

package main

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

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

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

func solve(n int, a []int) int {
	sort.Ints(a)
	o := 1000000000
	for i := 1; i < n-1; i++ {
		o = min(o, a[i+1]-a[i-1])
	}
	return o
}

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"
	"reflect"
	"sort"
)

var in = bufio.NewReader(os.Stdin)

func ReverseSlice(s interface{}) {
	size := reflect.ValueOf(s).Len()
	swap := reflect.Swapper(s)
	for i, j := 0, size-1; i < j; i, j = i+1, j-1 {
		swap(i, j)
	}
}

func main() {
	var t int
	fmt.Fscan(in, &t)

	for ; t > 0; t-- {
		var n int
		fmt.Fscan(in, &n)
		a := make([]int, n, n)
		for i := 0; i < n; i++ {
			fmt.Fscan(in, &a[i])
		}
		sort.Slice(a, func(i, j int) bool { return a[i] < a[j] })
		var ret int = 10e9
		for i := 0; i < n-2; i++ {
			tmp := a[i+2] - a[i]
			if tmp < ret {
				ret = tmp
			}
		}
		fmt.Println(ret)
	}
}

package main

import (
	"fmt"
	"math"
	"sort"
)

func main() {
	var t int
	fmt.Scan(&t)
	for i := 0; i < t; i++ {
		solve()
	}
}

func solve()  {
	var n int
	fmt.Scan(&n)
	a := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&a[i])
	}
	sort.Ints(a)
	min := math.MaxInt

	for i := 0; i < n-2; i++ {
		temp := find(a[i], a[i+1], a[i+2])
		if temp < min {
			min = temp
		}
	}
	fmt.Println(min)
}

func find(a, b, c int) (res int) {
	res = c - a
	return
}

package main
// github.com/jamesgrimard/codeforces
import(
    "fmt"
    "bufio"
    "os"
    "sort"
)
func main() {
	in:= bufio.NewReader(os.Stdin)
	out:= bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	fmt.Fscan(in,&t)
	for i:=0;i<t;i++{
		var n int
		fmt.Fscan(in,&n)
		a:= make([]int,n)
		for j:=0;j<n;j++{
			fmt.Fscan(in,&a[j])
		}
		var c []int
		for j:=0;j<n;j++{
			var b []int
			for k:=0;k<n;k++{
				if j != k {
					b = append(b,abs(a[j]-a[k]))
				}
			}
			sort.Ints(b)
			c = append(c,b[0]+b[1])
		}
		sort.Ints(c)
		fmt.Fprintln(out,c[0])

	}
}
func abs(a int) int {
	if a < 0 {
		return a*-1
	}
	return a
}
// map[int]int
// mapper[j]++
// if mapper[j] >= 3
// if mapper[j] == 2, check mapper[j] next closest value |mapper[j]-mapper[j-1]| |mapper[j]-mapper[j+1]|
// choose lowest
//

package main

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

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

func (in *CF1734A) 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 *CF1734A) load() {
	if len(in.split) <= in.index {
		in.split = strings.Split(in.GetLine(), in.separator)
		in.index = 0
	}
}

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

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

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

/**
Run solve the problem CF1734A
Date: 9/26/2022
User: wotan
URL: https://codeforces.com/problemset/problem/1734/A
Problem: CF1734A
**/
func (in *CF1734A) Run() {
	for t := in.NextInt(); t > 0; t-- {
		n := in.NextInt()
		arr := make([]int, n)
		for i := 0; i < n; i++ {
			arr[i] = in.NextInt()
		}
		sort.Ints(arr)
		min := 100000000000
		for i := 2; i < n; i++ {
			diff := int(math.Abs(float64(arr[i-2])-float64(arr[i-1]))) + int(math.Abs(float64(arr[i])-float64(arr[i-1])))
			if diff < min {
				min = diff
			}
		}
		fmt.Println(min)
	}
}

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

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

package main

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

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

	var t, n int

	fmt.Fscan(r, &t)

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

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

		sort.Ints(a)

		var res int = 1e9
		for j := 1; j < n - 1; j++ {
			new_res := a[j + 1] - a[j - 1]
			if new_res < res {
				res = new_res
			}
		}
		fmt.Println(res)
	}
}

package main

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

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

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

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

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

		sort.Ints(aa)
		tot := math.MaxInt32
		for i := 2; i < n; i++ {
			tot = min(tot, (aa[i-1]-aa[i-2])+(aa[i]-aa[i-1]))
		}
		fmt.Fprintln(out, tot)
	}
}

package main

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

// https://space.bilibili.com/206214
func run(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	solve := func(curCase int) {
		var n int
		Fscan(in, &n)
		a := make([]int, n)
		for i := range a {
			Fscan(in, &a[i])
		}
		sort.Ints(a)
		cnt := map[int]int{}
		for _, v := range a {
			cnt[v]++
			if cnt[v] >=3 {
				Fprintln(out, 0)
				return
			}
		}
		ans := int(2e9)
		for i := 1; i < n-1; i++ {
			ans = min(ans, a[i]-a[i-1] + a[i+1]-a[i])
		}
		Fprintln(out, ans)
	}

	cases := 1
	Fscan(in, &cases)
	for curCase := 1; curCase <= cases; curCase++ {
		solve(curCase)
	}

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

}

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

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

package main

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

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

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

func solve(n int, a []int) int {
	sort.Ints(a)
	o := 1000
	for i := 1; i < n-1; i++ {
		o = min(o, a[i+1]-a[i-1])
	}
	return o
}

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"
	"reflect"
	"sort"
)

var in = bufio.NewReader(os.Stdin)

func ReverseSlice(s interface{}) {
	size := reflect.ValueOf(s).Len()
	swap := reflect.Swapper(s)
	for i, j := 0, size-1; i < j; i, j = i+1, j-1 {
		swap(i, j)
	}
}

func main() {
	var t int
	fmt.Fscan(in, &t)

	for ; t > 0; t-- {
		var n int
		fmt.Fscan(in, &n)
		a := make([]int, n, n)
		for i := 0; i < n; i++ {
			fmt.Fscan(in, &a[i])
		}
		sort.Slice(a, func(i, j int) bool { return a[i] < a[j] })
		var ret int = 10e9
		for i := 0; i < n-2; i++ {
			tmp := (a[i] + a[i+1] + a[i+2]) / 3
			if tmp < ret {
				ret = tmp
			}
		}
		fmt.Println(ret)
	}
}