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

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 (
	t int

	n int
)

func main() {
	t = ReadInt()
	for i := 0; i < t; i++ {
		n = ReadInt()

		solve()
	}
}

func solve() {
	ans := (n-1)/2 + 1
	fmt.Println(ans)
}

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

/*********** 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"
	"os"
)

func main() {
	reader := bufio.NewReader(os.Stdin)

	tc := readNum(reader)

	for tc > 0 {
		tc--
		n := readNum(reader)
		fmt.Println(solve(n))
	}
}

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(n int) int {
	return (n + 1) / 2
}

package main

import "fmt"

func main() {
	var t int
	fmt.Scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		var s int
		fmt.Scanf("%d\n", &s)
		fmt.Println((s + 1) / 2)
	}
}

// https://codeforces.com/contest/1365/problem/A
package main

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

// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)
var input *bufio.Reader

func main() {
	var T int

	//f, _ := os.Open("input.txt")
	//input := bufio.NewReader(f)
	input = bufio.NewReader(os.Stdin)
	fmt.Fscan(input, &T)
	for i := 0; i < T; i++ {
		fmt.Println(solver())
	}
}

func solver() int {
	var n int
	fmt.Fscan(input, &n)
	if n == 1 { return 1}
	if n % 2 == 0 { return (n  / 2)	 }
	return (n - 3) / 2 + 2
}

package main

import "fmt"

func even(n uint) uint {
	return n / 2
}

func odd(n uint) uint {
	return (n + 1) / 2
}

func test() {
	var n uint
	fmt.Scan(&n)

	if n%2 == 0 {
		fmt.Println(even(n))
	} else {
		fmt.Println(odd(n))
	}
}

func main() {
	var t uint
	fmt.Scan(&t)

	for t != 0 {
		test()
		t--
	}
}

package main

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

var reader = NewWordScanner(os.Stdin)
var writer = NewBufferedWriter(os.Stdout)

func main() {
	defer writer.Flush()
	t := reader.NextInt64()
	for ; t > 0; t-- {
		// n:= reader.NextInt64()
		a:=reader.NextInt64()
		sol(a)
	}
}

func sol(a int64) {
	var val int64
	if(a%2!=0){
		val = (a/2) + 1;
	}else{
	val = (a/2)
	}
	writer.Printf("%d\n",val)
}

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

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

type BufferedWriter interface {
	Printf(format string, a ...interface{})
	Flush()
}

type writerImpl struct {
	*bufio.Writer
}

func NewBufferedWriter(writer io.Writer) BufferedWriter {
	return &writerImpl{Writer: bufio.NewWriter(writer)}
}

func (impl *writerImpl) Printf(f string, a ...interface{}) {
	fmt.Fprintf(impl.Writer, f, a...)
}

func (impl *writerImpl) Flush() {
	impl.Writer.Flush()
}

type WordScanner interface {
	NextInt() int
	NextInt64() int64
	NextString() string
}

type wordScannerImpl struct {
	*bufio.Scanner
}

func NewWordScanner(reader io.Reader) WordScanner {
	s := bufio.NewScanner(reader)
	s.Split(bufio.ScanWords)
	// adjust the following size as needed
	// 2 << 17 is good enough to scan strings of len 2*10^5
	// it could go as high as 2 << 26 before cf judge breaks
	size := 2 << 20
	buf := make([]byte, size)
	s.Buffer(buf, size)
	return &wordScannerImpl{Scanner: s}
}

func (impl *wordScannerImpl) NextInt() int {
	impl.Scan()
	bb := impl.Bytes()
	i := 0
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextInt64() int64 {
	impl.Scan()
	bb := impl.Bytes()
	i := int64(0)
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int64(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int64(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextString() string {
	impl.Scan()
	return impl.Text()
}

package main
import "fmt"
func main() {
	var t int
	var n int
	fmt.Scanln(&t)
	for ; t > 0; t-- {
	    fmt.Scanln(&n)
		fmt.Println(((n - 1)/2) + 1)
	}
}

package main

import "fmt"

func main() {
	var n, t int
	fmt.Scan(&t)
	for i := 1; i <= t; i++ {
		fmt.Scan(&n)
		quo := n / 2
		rem := n % 2
		temp := quo + rem
		fmt.Println(temp)
	}
}

package main

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

var DEBUG = true

func main() {
	defer Flush()

	T := readi()
	for t := 0; t < T; t++ {
		n := readi()
		println((n + 1) / 2)

	}

}

// -----------------------------------------------------------------------------

// IO helper functions

// Returns next token from input.  It must be initialized by SetInput()
// before the first call.
var nextToken func() ([]byte, error)
var nextLine func() ([]byte, error)

// Holds a buffer for output.  It must be initialized by SetOutput().
// All IO fucntions (read*() and [e]print*()) should write to OutputWriter
// instead of this.
var OutputBuffer *bufio.Writer

// Holds an io.Writer.  It must be initialized by SetOutput()
var OutputWriter io.Writer

// Set IO functions for interactive input/output.
func SetInteractive(w io.Writer, r io.Reader) {
	SetUnbefferedInput(r)
	OutputBuffer = nil
	OutputWriter = w
}

// Setup OutputBuffer and OutputWriter.
func SetOutput(w io.Writer) {
	OutputBuffer = bufio.NewWriter(w)
	OutputWriter = OutputBuffer
}

// Flushes OutputBuffer
func Flush() {
	if OutputBuffer != nil {
		OutputBuffer.Flush()
	}
}

// Returns true if c is a white space
func IsSpace(c byte) bool {
	switch c {
	case '\t', '\n', '\v', '\f', '\r', ' ':
		return true
	}
	return false
}

func IsNewLine(c byte) bool {
	switch c {
	case '\n', '\r':
		return true
	}
	return false
}

// Setup nextToken with input buffer.
func SetInput(r io.Reader) {
	buf := new(bytes.Buffer)
	var b []byte

	var i int
	rest := func() ([]byte, error) {
		for i < len(b) && IsSpace(b[i]) {
			i++
		}
		if i == len(b) {
			return nil, io.ErrUnexpectedEOF
		}
		j := i
		for i < len(b) && !IsSpace(b[i]) {
			i++
		}
		return b[j:i], nil
	}
	initial := func() ([]byte, error) {
		io.Copy(buf, r)
		b = buf.Bytes()
		nextToken = rest
		return rest()
	}
	nextToken = initial

	restLn := func() ([]byte, error) {
		for i < len(b) && IsNewLine(b[i]) {
			i++
		}
		if i == len(b) {
			return nil, io.ErrUnexpectedEOF
		}
		j := i
		for i < len(b) && !IsNewLine(b[i]) {
			i++
		}
		return b[j:i], nil
	}

	initialLn := func() ([]byte, error) {
		io.Copy(buf, r)
		b = buf.Bytes()
		nextLine = restLn
		return restLn()
	}
	nextLine = initialLn
}

// Setup nextToken without input buffer.
func SetUnbefferedInput(r io.Reader) {
	buf := bufio.NewReader(r)
	var b []byte

	var i int
	nextToken = func() ([]byte, error) {
		var err error
		if i == len(b) {
			b, err = buf.ReadBytes('\n')
			if err != nil {
				return nil, err
			}
			i = 0
			j := len(b) - 1
			for 0 <= j && IsSpace(b[j]) {
				j--
			}
			b = b[0 : j+1]
		}
		for i < len(b) && IsSpace(b[i]) {
			i++
		}
		j := i
		for i < len(b) && !IsSpace(b[i]) {
			i++
		}
		if i == j {
			return nil, io.ErrUnexpectedEOF
		}
		return b[j:i], nil
	}
}

// -----------------------------------------------------------------------------

// IO functions

// Reads next token and return it as []byte
func readb() []byte {
	b, err := nextToken()
	if err != nil {
		panic(err)
	}
	return b[:len(b):len(b)]
}

// Reads next token and return it as string
func reads() string {
	return string(readb())
}

// Read next line as []byte.  Trailing '\n' will not be included.
// See also comments on readb()
func readbln() []byte {
	b, err := nextLine()
	if err != nil {
		panic(err)
	}
	return b[:len(b):len(b)]
}

// Read next line as string
func readsln() string {
	return string(readbln())
}

// Reads next token and return it as int64
func readll() int64 {
	i, err := strconv.ParseInt(reads(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// Reads next token and return it as int
func readi() int {
	return int(readll())
}

// Reads next token and return it as float64
func readf() float64 {
	f, err := strconv.ParseFloat(reads(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// Write args to OutputWriter with the format f
func printf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(OutputWriter, f, args...)
}

// Write args to OutputWriter without format
func println(args ...interface{}) (int, error) {
	return fmt.Fprintln(OutputWriter, args...)
}

// Write args to stderr with the format f
func eprintf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(os.Stderr, f, args...)
}

// Write args to stderr without format
func eprintln(args ...interface{}) (int, error) {
	return fmt.Fprintln(os.Stderr, args...)
}

func dbgf(f string, args ...interface{}) {
	if !DEBUG {
		return
	}
	fmt.Fprintf(os.Stderr, f, args...)
}

func dbg(args ...interface{}) {
	if !DEBUG {
		return
	}
	fmt.Fprintln(os.Stderr, args...)
}

// -----------------------------------------------------------------------------

// Utilities

func sumSlice(a []int) int {
	var res int
	for _, v := range a {
		res += v
	}
	return res
}

func sumSlicell(a []int64) int64 {
	var res int64
	for _, v := range a {
		res += v
	}
	return res
}

func readInts(N int) (int, []int) {
	if N == 0 {
		N = readi()
	}
	a := make([]int, N)
	for i := range a {
		a[i] = readi()
	}
	return N, a
}

func readIntsll(N int) (int, []int64) {
	if N == 0 {
		N = readi()
	}
	a := make([]int64, N)
	for i := range a {
		a[i] = readll()
	}
	return N, a
}

// -----------------------------------------------------------------------------

// Simple math functions

const (
	// big prime
	INF  = 1000000007
	INF2 = 1000000009
	INF3 = 998244353
)

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

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

func minf(a, b float64) float64 {
	if a < b {
		return a
	}
	return b
}

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

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

func maxf(a, b float64) float64 {
	if a < b {
		return b
	}
	return a
}

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

func absll(a int64) int64 {
	if a < 0 {
		return -a
	}
	return a
}

func absf(a float64) float64 {
	if a < 0 {
		return -a
	}
	return a
}

// egcd(a, b) returns d, x, y:
//   d is gcd(a,b)
//   x, y are  integers that satisfy ax + by = d
func egcd(a, b int) (int, int, int) {
	if b == 0 {
		return a, 1, 0
	}
	d, x, y := egcd(b, a%b)
	return d, y, x - a/b*y
}

func egcdll(a, b int64) (int64, int64, int64) {
	if b == 0 {
		return a, 1, 0
	}
	d, x, y := egcdll(b, a%b)
	return d, y, x - a/b*y
}

func gcd(a, b int) int {
	d, _, _ := egcd(a, b)
	return d
}

func gcdll(a, b int64) int64 {
	d, _, _ := egcdll(a, b)
	return d
}

// set up IO functions
func init() {
	// for non-interactive
	SetInput(os.Stdin)
	SetOutput(os.Stdout)

	// Enable below when interactive.  Its ok to leave above intact.
	// SetInteractive(os.Stdout, os.Stdin)
}

package main
import (
        "fmt"
        "os"
        "bufio"
)
func main(){
    var t, n int
    in := bufio.NewReader(os.Stdin)
    out := bufio.NewWriter(os.Stdout)
    defer out.Flush()
    fmt.Fscan(in, &t)
    for ; t > 0; t-- {
        fmt.Fscan(in, &n)
        fmt.Fprintln(out, n/2 + n%2)
    }
}

package main

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

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

	var t int

	fmt.Fscan(r, &t)

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

		if n&1 == 0 {
			fmt.Fprintln(w, n/2)
			continue
		}

		fmt.Fprintln(w, (n/2)+1)
	}
}

package main

import("fmt")

func main(){
	var t int32
	var n int32

	fmt.Scan(&t)

	for ;t>0;t-- {
		fmt.Scan(&n)

		if n%2 == 0 {
			fmt.Println(n/2)
		} else {
			fmt.Println(n/2 + 1)
		}
	}
}

package main

import "fmt"

func main() {
	var tc int
	fmt.Scanf("%d\n", &tc)
	for ; tc > 0; tc-- {
		var x int
		fmt.Scanf("%d\n", &x)
		fmt.Println((x+1)/2)
	}
}

package main

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

func main() {
	sc := NewScanner()
	t := sc.NextInt()
	for i := 0; i < t; i++ {
		N := sc.NextInt()
		fmt.Println((N + 1) / 2)
	}

}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r: rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextFloat() float64 {
	v, _ := strconv.ParseFloat(s.Next(), 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

package main

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

func main() {
	defer writer.Flush()
	t := NextInt()
	for t > 0 {
		t--
		n := NextInt()
		Println((n+1)/2)
	}
}

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

func init() {
	sc.Buffer(make([]byte, 256), 1e9)
	sc.Split(bufio.ScanWords)
}

func Println(data interface{}) {
	writer.WriteString(fmt.Sprintf("%v\n", data))
}

func Print(data interface{}) {
	writer.WriteString(fmt.Sprintf("%v", data))
}

func Next() string {
	sc.Scan()
	return sc.Text()
}

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

func NextInt64() int64 {
	i64, err := strconv.ParseInt(Next(), 10, 64)
	if err != nil {
		panic(err)
	}
	return i64
}

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

package main

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

var in *bufio.Reader
var out *bufio.Writer

func printf(x string, a ...interface{}) (n int, err error) {
	return fmt.Fprintf(out, x, a...)
}

func scanf(x string, a ...interface{}) (n int, err error) {
	return fmt.Fscanf(in, x, a...)
}

func main() {
	out = bufio.NewWriterSize(os.Stdout, 8192)
	defer out.Flush()
	if false {
		file, err := os.Open("in.txt")
		if err != nil {
			log.Fatal(err)
		}
		in = bufio.NewReaderSize(file, 8192)
	} else {
		in = bufio.NewReaderSize(os.Stdin, 8192)
	}

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

	for ; t > 0; t-- {
		scanf("\n%d", &n)
		printf("%d\n", (n+1)/2)
	}
}

package main

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

func main() {
	var t, n int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {
		fmt.Fscan(in, &n)
		fmt.Printf("%.0f\n", math.Ceil(float64(n)/2))
	}
}

package main

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

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-- {
		var n int64
		fmt.Fscan(in, &n)
		fmt.Fprintln(out, (n+1)/2)
	}
}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	input, _ := reader.ReadString('\n')
	trimmedInput := strings.TrimSpace(input)
	testCases, _ := strconv.Atoi(trimmedInput)

	for testCases > 0 {
		input, _ = reader.ReadString('\n')
		trimmedInput = strings.TrimSpace(input)
		number, _ := strconv.Atoi(trimmedInput)
		fmt.Println((number / 2) + (number % 2))
		testCases--
	}

}

package main

import "fmt"

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

	for testCases > 0 {
		var number int
		fmt.Scanf("%d", &number)
		fmt.Println((number / 2) + (number % 2))
		testCases--
	}
}

package main

import "fmt"

func maxSticks(tc int) {
	var number int
	for tc > 0 {
		fmt.Scanf("%d", &number)
		quotient := number / 2
		reminder := number % 2
		fmt.Println(quotient + reminder)
		tc--
	}
}

func main() {
	var testCases int
	fmt.Scanf("%d", &testCases)
	maxSticks(testCases)
}

// https://codeforces.com/contest/1365/problem/A
package main

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

// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)
var input *bufio.Reader

func main() {
	var T int

	//f, _ := os.Open("input.txt")
	//input := bufio.NewReader(f)
	input = bufio.NewReader(os.Stdin)
	fmt.Fscan(input, &T)
	for i := 0; i < T; i++ {
		fmt.Println(solver())
	}
}

func solver() int {
	var n int
	fmt.Fscan(input, &n)
	if n == 1 { return 1}
	if n == 3 { return 2}
	return (n  / 2)
}

package main
import (
        "fmt"
        "os"
        "bufio"
)
func main(){
    var t, n int
    in := bufio.NewReader(os.Stdin)
    out := bufio.NewWriter(os.Stdout)
    defer out.Flush()
    fmt.Fscan(in, &t)
    for ; t > 0; t-- {
        fmt.Fscan(in, &n)
        if n == 1 || n == 2 {
            fmt.Fprintln(out, 1)
        } else if n == 3 {
            fmt.Fprintln(out, 2)
        } else {
            fmt.Fprintln(out, n/2)
        }
    }
}

package main

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

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

	var t int

	fmt.Fscan(r, &t)

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

		if n&1 == 0 {
			fmt.Fprintln(w, n/2)
			continue
		}

		fmt.Fprintln(w, (n/2)+1)
	}
}

package main

import "fmt"

func main() {
	var tc int
	fmt.Scanf("%d", &tc)
	for ; tc > 0; tc-- {
		var x int
		fmt.Scanf("%d", &x)
		fmt.Println((x + 1) / 2)
	}
}


package main

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

func main() {
	var n int
	fmt.Scanln(&n)
	r := bufio.NewReader(os.Stdin)
	line, err := r.ReadString('\n')
	if err != nil {
		fmt.Println(err)
	}
	sum, err := parseInts(line, n)
	if err != nil {
		fmt.Println(err)
	}
	fmt.Println(sum)
}

func parseInts(s string, l int) (uint64, error) {
	var (
		fields = strings.Fields(s)
		sum, prev, v uint64
		err    error
	)
	prev, _ = strconv.ParseUint(fields[l-1], 10, 32)
	sum += prev
	for i := l - 2; i >= 0; i-- {
		v, err = strconv.ParseUint(fields[i], 10, 32)
		if err != nil {
			return 0, err
		}
		if prev == 0{
			break
		}
		if prev > v{
			prev = v
		} else{
			prev = prev - 1
		}
		sum += prev
    }
	return sum, nil
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	n := 0;
	fmt.Fscanf(in, "%d\n", &n);

    var slice = make([]int, 223456);
	for i:=0; i < n; i++ {
        a := 0;
        fmt.Fscanf(in, "%d", &a);
        slice[i] = a;
	}
    var ans int64 = 0;
    var cur = slice[n-1];
    ans = int64(cur);
    for i := 1; i < n; i++ {
        if cur > slice[n-1-i] {
            cur = slice[n-1-i];
        } else {
            cur = cur - 1;
        }
        if cur == -1 {
            break;
        }
        ans += int64(cur);
    }
	fmt.Println(ans);
}

package main

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

func main() {
	buf := bufio.NewReader(os.Stdin)

	var n int
	fmt.Fscanf(buf, "%d\n", &n)
	mat := make([]int,n+1)
	for i:=0;i < n;i++{
		fmt.Fscanf(buf, "%d", &mat[i])
	}
	fmt.Fscanf(buf, "\n")
	var ans int64 = int64(mat[n-1])
	var pre int = mat[n-1]
	for i:=n-2;pre>0&&i >=0 ;i--{
		if mat[i] >= pre{
			ans += int64(pre-1)
			pre--
		}else{
			ans += int64(mat[i])
			pre = mat[i]
		}
	}
	fmt.Printf("%d\n",ans)

}

package main

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

func main()  {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var n int
	var x int
	a := make([]int,0)
	fmt.Fscanln(in,&n)
	for i := 0 ;i  < n ;i++{
		fmt.Fscan(in,&x)
		a = append(a,x)
	}
	var ans int64
	ans = int64(a[n - 1])
	curr := a[n - 1]
	for i := n - 2 ;i  >= 0; i--{
		if(curr > a[i]){
			curr = a[i]
			ans += int64(a[i])
		}else{
			if(curr - 1 >= 0){
				ans += int64(curr - 1)
				curr = min1(curr - 1 , a[i])
			}
		}
	}
	fmt.Fprint(out,ans)

}
func min1(x1,x2 int) int  {
	if(x1 < x2){
		return x1
	}else{
		return x2
	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	n := 0
	fmt.Fscanf(in, "%d\n", &n)
	a := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Fscanf(in, "%d", &a[i])
	}
	ans := int64(a[n-1])
	cur := a[n-1] - 1
	for i := n - 2; i >= 0; i-- {
		if cur <= 0 {
			break
		}
		if a[i] < cur {
			cur = a[i]
		}
		ans += int64(cur)
		cur--
	}
	fmt.Fprintf(out, "%d\n", ans)
	return
}

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

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

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)

	var n int

	fmt.Fscan(reader, &n)

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

	for i := n - 2; i >= 0; i-- {
		arr[i] = max(0, min(arr[i], arr[i+1]-1))
	}

	var count int64
	for _, vl := range arr {
		count += int64(vl)
	}

	fmt.Println(count)
}

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

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

package main

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

func main()  {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var n int
	var x int
	a := make([]int,0)
	fmt.Fscanln(in,&n)
	for i := 0 ;i  < n ;i++{
		fmt.Fscan(in,&x)
		a = append(a,x)
	}
	ans := a[n - 1]
	curr := a[n - 1]
	for i := n - 2 ;i  >= 0; i--{
		if(curr > a[i]){
			curr = a[i]
			ans += a[i]
		}else{
			if(curr - 1 >= 0){
				ans += curr - 1
				curr = min(curr - 1 , a[i])
			}

		}
	}
	fmt.Fprint(out,ans)

}
func min(x1,x2 int) int  {
	if(x1 < x2){
		return x1
	}else{
		return x2
	}
}

package main

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

func main()  {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var n int
	var x int
	a := make([]int,0)
	fmt.Fscanln(in,&n)
	for i := 0 ;i  < n ;i++{
		fmt.Fscan(in,&x)
		a = append(a,x)
	}
	ans := a[n - 1]
	curr := a[n - 1]
	for i := n - 2 ;i  >= 0; i--{
		if(curr > a[i]){
			curr = a[i]
			ans += a[i]
		}else{
			if(curr - 1 >= 0){
				ans += curr - 1
				curr -= 1
			}

		}
	}
	fmt.Fprint(out,ans)

}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	n := 0
	fmt.Fscanf(in, "%d\n", &n)
	a := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Fscanf(in, "%d", &a[i])
	}
	ans := int64(a[n-1])
	cur := a[n-1] - 1
	for i := n - 2; i >= 0; i-- {
		if cur <= 0 {
			break
		}
		if a[i] < cur-1 {
			cur = a[i]
		}
		ans += int64(cur)
		cur--
	}
	fmt.Fprintf(out, "%d\n", ans)
	return
}

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

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

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	n := 0
	fmt.Fscanf(in, "%d\n", &n)
	a := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Fscanf(in, "%d", &a[i])
	}
	ans := int64(0)

	queue := []int{}
	for i := 0; i < n; i++ {
		queue = append(queue, a[i])
		for j := len(queue) - 2; j >= 0; j-- {
			if queue[j] >= queue[j+1] {
				queue[j] = queue[j+1] - 1
			}
		}
		for len(queue) > 0 && queue[0] <= 0 {
			queue = queue[1:]
		}
		cur := int64(0)
		for j := 0; j < len(queue); j++ {
			cur += int64(queue[j])
		}
		if cur > ans {
			ans = cur
		}
	}
	fmt.Fprintf(out, "%d\n", ans)
	return
}

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

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

package main

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

func main() {
	var n int
	fmt.Scanln(&n)
	r := bufio.NewReader(os.Stdin)
	line, err := r.ReadString('\n')
	if err != nil {
		fmt.Println(err)
	}
	sum, err := parseInts(line, n)
	if err != nil {
		fmt.Println(err)
	}
	fmt.Println(sum)
}

func parseInts(s string, l int) (int, error) {
	var (
		fields = strings.Fields(s)
		sum, prev, v int
		err    error
	)
	prev, _ = strconv.Atoi(fields[l-1])
	sum += prev
	for i := l - 2; i >= 0; i-- {
		v, err = strconv.Atoi(fields[i])
		if err != nil {
			return 0, err
		}
		if prev == 0{
			break
		}
		if prev > v{
			prev = v
		} else{
			prev = prev - 1
		}
		sum += prev
    }
	return sum, nil
}

package main

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

func main() {
	var n int
	fmt.Scanln(&n)
	r := bufio.NewReader(os.Stdin)
	line, err := r.ReadString('\n')
	if err != nil {
		fmt.Println(err)
	}
	sum, err := parseInts(line, n)
	if err != nil {
		fmt.Println(err)
	}
	fmt.Println(sum)
}

func parseInts(s string, l int) (int, error) {
	var (
		fields = strings.Fields(s)
		sum, prev, v int
		err    error
	)
	for i := l - 1; i >= 0; i-- {
		v, err = strconv.Atoi(fields[i])
		if err != nil {
			return 0, err
		}
		if i == l - 1{
			prev = v
			sum += v
			continue
		}
		if prev > v{
			prev = v
			sum += v
		} else{
			if prev > 0{
				prev = prev - 1
			}
			sum += prev
		}
	}
	return sum, nil
}


package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	var n, m, s, t int
	fmt.Fscan(reader, &n, &m, &s, &t)
	g := make([][]int, n+1)
	for i := 0; i < m; i++ {
		var x, y int
		fmt.Fscan(reader, &x, &y)
		g[x] = append(g[x], y)
		g[y] = append(g[y], x)
	}
	gao(n, m, s, t, g)
}

func gao(n, m, s, t int, g [][]int) {
	distS := bfs(n, m, s, g)
	distT := bfs(n, m, t, g)
	minDist := distS[t]

	ans := 0
	for x := 1; x <= n; x++ {
		has := make(map[int]bool)
		for _, y := range g[x] {
			has[y] = true
		}
		for y := x + 1; y <= n; y++ {
			if !has[y] {
				dec := false
				// Choice 1: s -> x -> y -> t
				if distS[x]+1+distT[y] < minDist {
					dec = true
				}
				// Choice 2: s -> y -> x -> t
				if distS[y]+1+distT[x] < minDist {
					dec = true
				}
				if !dec {
					ans++
				}
			}
		}
	}

	fmt.Println(ans)
}

func bfs(n, m, beg int, g [][]int) []int {
	dist := make([]int, n+1)
	const maxdist = 10000
	for i := 1; i <= n; i++ {
		dist[i] = maxdist
	}

	dist[beg] = 0
	que := []int{beg}
	for len(que) > 0 {
		x := que[0]
		que = que[1:]
		for _, y := range g[x] {
			if dist[x]+1 < dist[y] {
				dist[y] = dist[x] + 1
				que = append(que, y)
			}
		}
	}
	return dist
}

package main

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

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

	var n, m, v, w, start, end, ans int
	Fscan(in, &n, &m, &start, &end)
	start--
	end--
	g := make([][]int, n)
	for i := 0; i < m; i++ {
		Fscan(in, &v, &w)
		v--
		w--
		g[v] = append(g[v], w)
		g[w] = append(g[w], v)
	}

	bfs := func(st int) []int {
		depths := make([]int, n)
		vis := make([]bool, n)
		vis[st] = true
		type pair struct{ v, dep int }
		q := []pair{{st, 0}}
		for len(q) > 0 {
			var p pair
			p, q = q[0], q[1:]
			depths[p.v] = p.dep
			for _, w := range g[p.v] {
				if !vis[w] {
					vis[w] = true
					q = append(q, pair{w, p.dep + 1})
				}
			}
		}
		return depths
	}
	stDepths, edDepths := bfs(start), bfs(end)
	minDis := stDepths[end]
	for v, gi := range g {
		sort.Ints(gi)
		j := 0
		for w := range g {
			if j == len(gi) || w < gi[j] {
				if w > v && stDepths[v]+edDepths[w]+1 >= minDis && stDepths[w]+edDepths[v]+1 >= minDis {
					ans++
				}
			} else {
				j++
			}
		}
	}
	Fprint(out, ans)
}

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

package main

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

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

	var n, m, v, w, start, end, ans int
	Fscan(in, &n, &m, &start, &end)
	start--
	end--
	g := make([][]int, n)
	for i := 0; i < m; i++ {
		Fscan(in, &v, &w)
		v--
		w--
		g[v] = append(g[v], w)
		g[w] = append(g[w], v)
	}

	bfs := func(st int) []int {
		depths := make([]int, n)
		vis := make([]bool, n)
		vis[st] = true
		queue := []int{st}
		for len(queue) > 0 {
			v, queue = queue[0], queue[1:]
			for _, w := range g[v] {
				if !vis[w] {
					vis[w] = true
					depths[w] = depths[v] + 1
					queue = append(queue, w)
				}
			}
		}
		return depths
	}
	stDepths, edDepths := bfs(start), bfs(end)
	minDis := stDepths[end]
	for v, gi := range g {
		sort.Ints(gi)
		j := 0
		for w := range g {
			if j == len(gi) || w < gi[j] {
				if w > v && stDepths[v]+edDepths[w]+1 >= minDis && stDepths[w]+edDepths[v]+1 >= minDis {
					ans++
				}
			} else {
				j++
			}
		}
	}
	Fprint(out, ans)
}

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

package main

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

var scanner = bufio.NewScanner(os.Stdin)

func scanNum() int {
	scanner.Scan()
	num, _ := strconv.Atoi(scanner.Text())
	return num
}

func main() {
	scanner.Split(bufio.ScanWords)
	n, r, x, y := scanNum(), scanNum(), scanNum(), scanNum()
	adjMap := map[int]map[int]bool{}
	for i := 0; i < r; i++ {
		u, v := scanNum(), scanNum()
		if adjMap[u] == nil {
			adjMap[u] = map[int]bool{}
		}
		if adjMap[v] == nil {
			adjMap[v] = map[int]bool{}
		}
		adjMap[u][v], adjMap[v][u] = true, true
	}

	bfs := func(i int, s []int) {
		q, v := []int{i}, map[int]bool{i: true}
		for len(q) > 0 {
			task, distance := q[0], s[q[0]]
			q = q[1:]
			for item := range adjMap[task] {
				if !v[item] {
					v[item] = true
					s[item] = distance + 1
					q = append(q, item)
				}
			}
		}
	}
	sX, sY := make([]int, n+1), make([]int, n+1)
	sX[x], sY[y] = 0, 0
	bfs(x, sX)
	bfs(y, sY)

	sum, shortest := 0, sX[x]+sY[x]
	for i := 1; i < n; i++ {
		for j := i + 1; j <= n; j++ {
			if adjMap[i][j] {
				continue
			}
			// If the relax result generate a shorter path then the current one,
			// it creates an "bad" case.
			iX, iY := sX[i], sY[i]
			if sX[j] < iX {
				iX = sX[j] + 1
			}
			if sY[j] < iY {
				iY = sY[j] + 1
			}
			if (iX + iY) >= shortest {
				sum++
			}
		}
	}
	fmt.Println(sum)
}

package main

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

const (
	MaxN = 1024
)

var n, m, s, t int
var a [MaxN][MaxN]bool
var ds, dt [MaxN]int

func bfs(start int, dist *[MaxN]int) {
	var visited [MaxN]bool
	q := []int{start}
	visited[start] = true

	for len(q) > 0 {
		top := q[0]
		q = q[1:]

		for i := 1; i <= n; i++ {
			if a[top][i] && !visited[i] {
				q = append(q, i)
				dist[i] = dist[top] + 1
				visited[i] = true
			}
		}
	}
}

func main() {
	buf := bufio.NewReader(os.Stdin)
	fmt.Fscanf(buf, "%d %d %d %d\n", &n, &m, &s, &t)
	for i := 0; i < m; i++ {
		var t1, t2 int
		fmt.Fscanf(buf, "%d %d\n", &t1, &t2)
		a[t1][t2] = true
		a[t2][t1] = true
	}

	bfs(s, &ds)
	bfs(t, &dt)

	ans := 0
	for i := 1; i <= n; i++ {
		for j := i + 1; j <= n; j++ {
			if !a[i][j] && ds[i] + dt[j] + 1 >= ds[t] && ds[j] + dt[i] + 1 >= ds[t] {
				ans++
			}
		}
	}
	fmt.Printf("%d\n", ans)
}

package main

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

const (
	MaxN = 1024
)

var n, m, s, t int
var a [MaxN][MaxN]bool
var ds, dt [MaxN]int

func bfs(start int, dist *[MaxN]int) {
	var visited [MaxN]bool
	q := []int{start}

	for len(q) > 0 {
		t := q[0]
		q = q[1:]
		visited[t] = true

		for i := 1; i <= n; i++ {
			if a[t][i] && !visited[i] {
				q = append(q, i)
				dist[i] = dist[t] + 1
			}
		}
	}
}

func main() {
	buf := bufio.NewReader(os.Stdin)
	fmt.Fscanf(buf, "%d %d %d %d\n", &n, &m, &s, &t)
	for i := 0; i < m; i++ {
		var t1, t2 int
		fmt.Fscanf(buf, "%d %d\n", &t1, &t2)
		a[t1][t2] = true
		a[t2][t1] = true
	}

	bfs(s, &ds)
	bfs(t, &dt)

	ans := 0
	for i := 1; i <= n; i++ {
		for j := i + 1; j <= n; j++ {
			if !a[i][j] && ds[i] + dt[j] + 1 >= ds[t] && ds[j] + dt[i] +1 >= ds[t] {
				ans++
			}
		}
	}
	fmt.Printf("%d\n", ans)
}

package main

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

const (
	MaxN = 1024
)

var n, m, s, t int
var a [MaxN][MaxN]bool
var ds, dt [MaxN]int

func bfs(start int, dist *[MaxN]int) {
	var visited [MaxN]bool
	q := []int{start}

	for len(q) > 0 {
		t := q[0]
		q = q[1:]
		visited[t] = true

		for i := 1; i <= n; i++ {
			if a[t][i] && !visited[i] {
				q = append(q, i)
				dist[i] = dist[t] + 1
			}
		}
	}
}

func main() {
	buf := bufio.NewReader(os.Stdin)
	fmt.Fscanf(buf, "%d %d %d %d\n", &n, &m, &s, &t)
	for i := 0; i < m; i++ {
		var t1, t2 int
		fmt.Fscanf(buf, "%d %d\n", &t1, &t2)
		a[t1][t2] = true
		a[t2][t1] = true
	}

	bfs(s, &ds)
	bfs(t, &dt)

	ans := 0
	for i := 1; i <= n; i++ {
		for j := i + 1; j <= n; j++ {
			if !a[i][j] && ds[i] + dt[j] + 1 >= ds[t] {
				ans++
			}
		}
	}
	fmt.Printf("%d\n", ans)
}


//Author: devACE
package main

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

func inv(bit_array *[]int64)int64{
	var ct0 int64 = 0
	var count int64= 0
	for i:=len(*bit_array)-1;i>=0;i--{
		if (*bit_array)[i]==1{
			count += ct0
		}else{
			ct0+=1
		}
	}

	return count
}

func f(v *[]int64, dp *[][]int64, arr []int64, lev int64){
	if lev<0 || len(arr)==0{
		return
	}

	bit_array0 := []int64{}
	bit_array1 := []int64{}

	for _,i := range(arr){
		bit_array0 = append(bit_array0,((*v)[i]>>lev)&1)
		bit_array1 = append(bit_array1,(((*v)[i]>>lev)&1)^1)
	}

	count0 := inv(&bit_array0)
	count1 := inv(&bit_array1)

	(*dp)[lev][0] += count0
	(*dp)[lev][1] += count1

	arr0 := []int64{}
	arr1 := []int64{}

	for _,i := range(arr){
		if (((*v)[i]>>lev)&1)==1 {
			arr1 = append(arr1,i)
		}else{
			arr0 = append(arr0,i)
		}
	}

	f(v,dp,arr0,lev-1)
	f(v,dp,arr1,lev-1)

	return

}

func Numbers(s string)[]int64{ //Converts a list of strings into list of integer
	a := []int64{}
	for _,val := range strings.Fields(s){
		int_val,conversion_err := strconv.Atoi(val)
		if conversion_err == nil{
			a = append(a,int64(int_val))
		}
	}
	return a
}

func main(){

	// var line1,line2 []int64 //Reading Input
	// scanner := bufio.NewScanner(os.Stdin)
	// for i:=0;i<2 && scanner.Scan(); i++{
	// 	if i==0{
	// 		line1 = Numbers(scanner.Text())
	// 	}else{
	// 		line2 = Numbers(scanner.Text())
	// 	}
	// }

	in := bufio.NewReader(os.Stdin)
	var n int64
	Fscan(in, &n)
	v := make([]int64, n)
	for i := range v {
		Fscan(in, &v[i])
	}

	// var (
	// 	n int64
	// 	v []int64
	// )

	// n = line1[0]
	// v = line2

	dp := make([][]int64,32) //Creating 32 slices
	for i:=0;i<32;i++{
		dp[i] = make([]int64,2)
	}

	arr := make([]int64,n)

	for i:=int64(0);i<n;i++{
		arr[i]=int64(i)
	}

	f(&v,&dp,arr,31)

	var ans,x int64 = 0,0
	for i:=0;i<32;i++{
		if dp[i][1]<dp[i][0]{
			ans += dp[i][1]
			x |= (1<<i)
		}else{
			ans += dp[i][0]
		}
	}

	fmt.Printf("%d %d\n",ans,x)
}

package main

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

// github.com/EndlessCheng/codeforces-go
func CF1416C(_r io.Reader, out io.Writer) {
	in := bufio.NewReader(_r)
	min := func(a, b int64) int64 {
		if a < b {
			return a
		}
		return b
	}
	var n int
	Fscan(in, &n)
	a := make([]int, n)
	for i := range a {
		Fscan(in, &a[i])
	}

	cnt, x := int64(0), 0
	group := [][]int{a}
	for i := 29; i >= 0; i-- {
		g := group
		group = nil
		s := [2]int64{}
		for _, a := range g {
			b := [2][]int{}
			c := [2]int64{}
			for _, v := range a {
				w := v >> i & 1
				b[w] = append(b[w], v)
				s[w] += c[w^1]
				c[w]++
			}
			for _, a := range b {
				if len(a) > 0 {
					group = append(group, a)
				}
			}
		}
		cnt += min(s[0], s[1])
		if s[0] > s[1] {
			x |= 1 << i
		}
	}
	Fprintln(out, cnt, x)
}

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

package main

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

// github.com/EndlessCheng/codeforces-go
func CF1416C(_r io.Reader, out io.Writer) {
	in := bufio.NewReader(_r)
	var n int
	Fscan(in, &n)
	a := make([]int, n)
	for i := range a {
		Fscan(in, &a[i])
	}

	x := 0
	set := [][]int{a}
	for i := 29; i >= 0; i-- {
		newSet := [][]int{}
		var c10, c01 int64
		for _, a := range set {
			b := make([][]int, 2)
			var c0, c1 int64
			for _, v := range a {
				w := v >> i & 1
				b[w] = append(b[w], v)
				if w > 0 {
					c1++
					c01 += c0
				} else {
					c0++
					c10 += c1
				}
			}
			for _, a := range b {
				if len(a) > 0 {
					newSet = append(newSet, a)
				}
			}
		}
		if c01 < c10 {
			x |= 1 << i
		}
		set = newSet
	}
	for i, v := range a {
		a[i] = v ^ x
	}

	b := append([]int(nil), a...)
	sort.Ints(b)
	k := 1
	kth := map[int]int{b[0]: k}
	for i := 1; i < n; i++ {
		if b[i] != b[i-1] {
			k++
			kth[b[i]] = k
		}
	}
	tree := make([]int, k+1)
	add := func(i int) {
		for ; i <= k; i += i & -i {
			tree[i]++
		}
	}
	sum := func(i int) (res int) {
		for ; i > 0; i &= i - 1 {
			res += tree[i]
		}
		return
	}
	cnt := int64(0)
	for i, v := range a {
		v = kth[v]
		cnt += int64(i - sum(v))
		add(v)
	}
	Fprintln(out, cnt, x)
}

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

package main

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

var in *bufio.Reader
var out *bufio.Writer

func printf(x string, a ...interface{}) (n int, err error) {
	return fmt.Fprintf(out, x, a...)
}

func scanf(x string, a ...interface{}) (n int, err error) {
	return fmt.Fscanf(in, x, a...)
}

func scan(a ...interface{}) (n int, err error) {
	return fmt.Fscan(in, a...)
}

var err error

func next() (n string) {
	scan(&n)
	return n
}

func nextInt() (n int) {
	scan(&n)
	return n
}

func nextLong() (n int64) {
	scan(&n)
	return n
}

func nextDouble() (n float64) {
	scan(&n)
	return n
}

func Max(a, b int64) int64 {
	if a > b {
		return a
	}
	return b
}

var res [30][2]int64

func solve() {
	n := nextInt()
	arr := make([]int, n)
	for i := range arr {
		arr[i] = nextInt()
	}
	recurse(arr, 29)
	ans := 0
	var tot int64
	for i, v := range res {
		if v[1] < v[0] {
			ans += 1 << i
			tot += v[1]
		} else {
			tot += v[0]
		}
	}
	printf("%d %d\n", tot, ans)
}

func recurse(arr []int, bit int) {
	if bit < 0 || len(arr) == 0 {
		return
	}
	var a, b int64 = 0, 0
	var x, y []int

	for _, v := range arr {
		if v&(1<<bit) == 0 {
			a++
			res[bit][0] += b
			x = append(x, v)
		} else {
			b++
			res[bit][1] += a
			y = append(y, v)
		}
	}
	recurse(x, bit-1)
	recurse(y, bit-1)
}

func main() {
	in = bufio.NewReaderSize(os.Stdin, 8192)
	out = bufio.NewWriterSize(os.Stdout, 8192)
	name := "in"
	file1, err := os.Open(name + ".in")
	if err == nil {
		in = bufio.NewReaderSize(file1, 8192)
	}
	// file2, err := os.Create(name + ".out")
	// if err != nil {
	// 	log.Fatal(err)
	// }
	// out = bufio.NewWriterSize(file2, 8192)
	defer out.Flush()
	// start := time.Now()

	// for t, i := nextInt(), 1; t > 0; t, i = t-1, i+1 {
	// printf("Case #%d:\n", i)
	solve()
	// }

	// printf("%v\n", time.Now().Sub(start))
}

package main

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

// github.com/EndlessCheng/codeforces-go
func CF1416C(_r io.Reader, out io.Writer) {
	in := bufio.NewReader(_r)
	var n int
	Fscan(in, &n)
	a := make([]int, n)
	for i := range a {
		Fscan(in, &a[i])
	}

	x := 0
	group := [][]int{a}
	for i := 29; i >= 0; i-- {
		g := group
		group = nil
		s := [2]int64{}
		for _, a := range g {
			b := [2][]int{}
			c := [2]int64{}
			for _, v := range a {
				w := v >> i & 1
				b[w] = append(b[w], v)
				s[w] += c[w^1]
				c[w]++
			}
			for _, a := range b {
				if len(a) > 0 {
					group = append(group, a)
				}
			}
		}
		if s[0] > s[1] {
			x |= 1 << i
		}
	}
	for i, v := range a {
		a[i] = v ^ x
	}

	b := append([]int(nil), a...)
	sort.Ints(b)
	k := 1
	kth := map[int]int{b[0]: k}
	for i := 1; i < n; i++ {
		if b[i] != b[i-1] {
			k++
			kth[b[i]] = k
		}
	}
	tree := make([]int, k+1)
	add := func(i int) {
		for ; i <= k; i += i & -i {
			tree[i]++
		}
	}
	sum := func(i int) (res int) {
		for ; i > 0; i &= i - 1 {
			res += tree[i]
		}
		return
	}
	c := int64(0)
	for i, v := range a {
		v = kth[v]
		c += int64(i - sum(v))
		add(v)
	}
	Fprintln(out, c, x)
}

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


/*
URL:
https://codeforces.com/problemset/problem/1091/C
*/

package main

import (
	"bufio"
	"errors"
	"fmt"
	"io"
	"math"
	"os"
	"sort"
	"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
	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 int
)

func main() {
	n = ReadInt()

	D := divisor(n)
	answers := []int64{}
	for i := 0; i < len(D); i++ {
		d := D[i]
		ans := int64(0)
		// for j := int64(1); j <= int64(n); j += int64(d) {
		// 	ans += j
		// }
		x := int64((n-1)/d) + 1
		ans = ArithmeticSequenceSum(1, int64(d), x)

		answers = append(answers, ans)
	}

	sort.Slice(answers, func(i, j int) bool { return answers[i] < answers[j] })
	fmt.Println(PrintInts64Line(answers...))
}

// ArithmeticSequenceSum returns a sum of an arithmetic sequence.
// a: 初項, d: 公差, n: 項数
func ArithmeticSequenceSum(a, d, n int64) int64 {
	return (2*a + (n-1)*d) * n / 2
}

// 約数の列挙: O(sqrt(n))
func divisor(n int) []int {
	res := []int{}

	for i := 1; i*i <= n; i++ {
		if n%i == 0 {
			res = append(res, i)
			if i != (n / i) {
				res = append(res, (n / i))
			}
		}
	}

	return res
}

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

/*********** 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"
	"sort"
)

// github.com/EndlessCheng/codeforces-go
func CF1091C(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	doDivisors := func(n int, do func(d int)) {
		for d := 1; d*d <= n; d++ {
			if n%d == 0 {
				do(d)
				if d*d < n {
					do(n / d)
				}
			}
		}
		return
	}

	var n int
	Fscan(in, &n)
	ans := []int64{}
	doDivisors(n, func(d int) { ans = append(ans, int64(n-d+2)*int64(n/d)/2) })
	sort.Slice(ans, func(i, j int) bool { return ans[i] < ans[j] })
	for _, v := range ans {
		Fprint(out, v, " ")
	}
}

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

// Package main provides
//
// File:  c.go
// Author: ymiyamoto
//
// Created on Mon Dec 31 01:14:12 2018
//
package main

import (
	"fmt"
	"sort"
)

func calcDivisors(n int64) []int64 {
	ret := []int64{1}
	for i := int64(2); i*i <= n; i++ {
		if n%i == 0 {
			ret = append(ret, i)
			if n/i != i {
				ret = append(ret, n/i)
			}
		}
	}

	if n != 1 {
		ret = append(ret, n)
	}

	return ret
}

func main() {
	var n int64
	fmt.Scan(&n)

	divisors := calcDivisors(n)
	ans := make([]int64, 0)
	for i := range divisors {
		d := divisors[i]
		num := n / d
		ans = append(ans, num+num*(num-1)*d/2)
	}
	sort.Slice(ans, func(i, j int) bool {
		return ans[i] < ans[j]
	})

	for i := range ans {
		if i != 0 {
			fmt.Print(" ")
		}
		fmt.Print(ans[i])
	}

	fmt.Println()
}

package main

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

func main() {
	var n int64
	fmt.Scan(&n)

	divisors := findDivisors(n)

	var ans []int64
	for _, v := range divisors {
		ans = append(ans, calculateSum(n, v))
	}

	for i := len(ans) - 1; i >= 0; i-- {
		fmt.Print(ans[i])
		if i > 0 {
			fmt.Print(" ")
		}
	}
	fmt.Println()
}

func findDivisors(n int64) []int64 {
	sqrtn := int64(math.Sqrt(float64(n))) + 2
	var divisors []int64
	for x := int64(1); x < sqrtn; x++ {
		if n%x != 0 {
			continue
		}
		divisors = append(divisors, x)
		if x != n/x {
			divisors = append(divisors, n/x)
		}
	}
	sort.Slice(divisors, func(i, j int) bool { return divisors[i] < divisors[j] })
	divisors = uniqueSlice(divisors)
	return divisors
}

func uniqueSlice(slice []int64) []int64 {
	var uniquedSlice []int64
	for i, _ := range slice {
		if i == 0 || slice[i-1] != slice[i] {
			uniquedSlice = append(uniquedSlice, slice[i])
		}
	}
	return uniquedSlice
}

func calculateSum(n, k int64) int64 {
	number := n / k
	last := 1 + (number-1)*k
	return (1 + last) * number / 2
}

// Package main provides
//
// File:  c.go
// Author: ymiyamoto
//
// Created on Mon Dec 31 01:14:12 2018
//
package main

import (
	"fmt"
	"sort"
)

func calcDivisors(n int) []int {
	ret := []int{1}
	for i := 2; i*i <= n; i++ {
		if n%i == 0 {
			ret = append(ret, i)
			if n/i != i {
				ret = append(ret, n/i)
			}
		}
	}

	if n != 1 {
		ret = append(ret, n)
	}

	return ret
}

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

	divisors := calcDivisors(n)
	ans := make([]int, 0)
	for i := range divisors {
		d := divisors[i]
		num := n / d
		ans = append(ans, num+num*(num-1)*d/2)
	}
	sort.Ints(ans)

	for i := range ans {
		if i != 0 {
			fmt.Print(" ")
		}
		fmt.Print(ans[i])
	}

	fmt.Println()
}

// Package main provides
//
// File:  c.go
// Author: ymiyamoto
//
// Created on Mon Dec 31 01:14:12 2018
//
package main

import (
	"fmt"
	"sort"
)

func calcDivisors(n int) []int {
	ret := make([]int, 0)
	for i := 1; i*i <= n; i++ {
		if n%i == 0 {
			ret = append(ret, i)
			if i != 1 && n/i != i {
				ret = append(ret, n/i)
			}
		}
	}
	ret = append(ret, n)
	return ret
}

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

	divisors := calcDivisors(n)
	ans := make([]int, 0)
	for i := range divisors {
		d := divisors[i]
		num := n / d
		ans = append(ans, num+num*(num-1)*d/2)
	}
	sort.Ints(ans)

	for i := range ans {
		if i != 0 {
			fmt.Print(" ")
		}
		fmt.Print(ans[i])
	}

	fmt.Println()
}

// Package main provides
//
// File:  c.go
// Author: ymiyamoto
//
// Created on Mon Dec 31 01:14:12 2018
//
package main

import (
	"fmt"
	"sort"
)

func calcDivisors(n int) []int {
	ret := make([]int, 0)
	for i := 1; i*i <= n; i++ {
		if n%i == 0 {
			ret = append(ret, i)
		}
	}
	ret = append(ret, n)
	return ret
}

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

	divisors := calcDivisors(n)
	ans := make([]int, 0)
	for i := range divisors {
		d := divisors[i]
		num := n / d
		ans = append(ans, num+num*(num-1)*d/2)
	}
	sort.Ints(ans)

	for i := range ans {
		if i != 0 {
			fmt.Print(" ")
		}
		fmt.Print(ans[i])
	}

	fmt.Println()
}


package main

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

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

func init() {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 4096), 1e9)
}

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

func sint64() int64 {
	s := sstring()
	i := int64(0)
	if s[0] == '-' {
		for _, r := range s[1:] {
			i *= 10
			i -= int64(r - '0')
		}
		return i
	}
	for _, r := range s {
		i *= 10
		i += int64(r - '0')
	}
	return i
}

func sint64s(n int64) []int64 {
	a := make([]int64, n)
	for i := range a {
		a[i] = sint64()
	}
	return a
}

func sstring() string {
	if !scanner.Scan() {
		panic(scanner.Err())
	}
	return scanner.Text()
}

func gcd(a, b int64) int64 {
	for b != 0 {
		a, b = b, a%b
	}
	if a < 0 {
		a *= -1
	}
	return a
}

func lcm(a, b int64) int64 {
	if a == 0 || b == 0 {
		panic("invalid input")
	}
	ret := a / gcd(a, b) * b
	if ret < 0 {
		ret *= -1
	}
	return ret
}

func main() {
	defer writer.Flush()
	n, m := sint64(), sint64()
	a := make([][]int64, n)
	for i := range a {
		a[i] = sint64s(m)
	}
	res := sol(n, m, a)
	for i := range res {
		for j := range res[i] {
			printf("%d ", res[i][j])
		}
		printf("\n")
	}
}

var lcm16 = func() int64 {
	ret := int64(1)
	for i := int64(1); i <= 16; i++ {
		ret = lcm(ret, i)
	}
	return ret
}()

func sol(n, m int64, a [][]int64) [][]int64 {
	ret := make([][]int64, n)
	for i := range ret {
		ret[i] = make([]int64, m)
		for j := range ret[i] {
			if (i+j)&1 == 0 {
				ret[i][j] = lcm16
			} else {
				ret[i][j] = lcm16 + pow4(a[i][j])
			}
		}
	}
	return ret
}

func pow4(n int64) int64 {
	return n * n * n * n
}

package main

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

// github.com/EndlessCheng/codeforces-go
func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	var n, m, v int
	Fscan(in, &n, &m)
	for i := 0; i < n; i++ {
		for j := 0; j < m; j++ {
			if Fscan(in, &v); (i+j)&1 > 0 {
				Fprint(out, 720720-v*v*v*v, " ")
			} else {
				Fprint(out, "720720 ")
			}
		}
		Fprintln(out)
	}
}

package main

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

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

	var n, m, v int
	Fscan(in, &n, &m)
	for i := 0; i < n; i++ {
		for j := 0; j < m; j++ {
			Fscan(in, &v)
			if (i+j)&1 > 0 {
				Fprint(out, 720720-v*v*v*v, " ")
			} else {
				Fprint(out, "720720 ")
			}
		}
		Fprintln(out)
	}
}

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

package main

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

const (
	LCM int = 720720
	MOD int = 1e9+7
	NL byte = byte('\n')
	SP byte = byte(' ')
)

var (
	in *bufio.Scanner
	out *bufio.Writer

	n, m int
	a [500][500]int
)

func main() {
	initBuffer()
	var t int = 1
	// t = getInt()
	for i := 0; i < t; i++ {
		solve()
	}
	// test()
	out.Flush()
}

func solve() {
	initialize()
	input()
	count()
	output()
}

func initialize() {

}

func input() {
	n = getInt()
	m = getInt()
	for i := 0; i < n; i++ {
		for j := 0; j < m; j++ {
			a[i][j] = getInt()
		}
	}
}

func count() {
	for i := 0; i < n; i++ {
		for j := 0; j < m; j++ {
			if (i + j) % 2 == 1 {
				a[i][j] *= a[i][j]
				a[i][j] *= a[i][j]
				a[i][j] += LCM
			} else {
				a[i][j] = LCM
			}
		}
	}
}

func output() {
	for i := 0; i < n; i++ {
		for j := 0; j < m; j++ {
			out.Write(intToBytes(a[i][j]))
			out.WriteByte(SP)
		}
		out.WriteByte(NL)
	}
}

func test() {
	fmt.Print()
}

func initBuffer() {
	in = bufio.NewScanner(os.Stdin)
	in.Buffer([]byte{}, 4 * 1024 * 1024)
	in.Split(scanWords)
	out = bufio.NewWriter(os.Stdout)
}

func scanWords(data []byte, atEOF bool) (advance int, token []byte, err error) {
	if atEOF && len(data) == 0 {
		return 0, nil, nil
	}
	i := bytes.IndexByte(data, '\n')
	j := bytes.IndexByte(data, ' ')
	ind := min(i, j)
	if ind < 0 {
		ind = max(i, j)
	}
	if ind >= 0 {
		return ind + 1, dropCR(data[0:ind]), nil
	}
	if atEOF {
		return len(data), dropCR(data), nil
	}
	return 0, nil, nil
}

func dropCR(data []byte) []byte {
	if len(data) > 0 && data[len(data)-1] == '\r' {
		return data[:len(data)-1]
	}
	return data
}

func getFloat() float64 {
	in.Scan()
	b := in.Bytes()
	var isNeg bool
	if b[0] == '-' {
		isNeg = true
		b = b[1:]
	}
	var res1 int64
	for i := 0; i < len(b); i++ {
		if b[i] == '.' {
			b = b[i+1:]
			break
		}
		res1 *= 10
		res1 += int64(b[i]) - 48
		if i == len(b) - 1 {
			b = b[:0]
		}
	}
	var res2 float64
	for i := len(b); i > 0; i-- {
		res2 += float64(b[i-1]) - 48
		res2 /= 10
	}
	if isNeg {
		res1 *= -1
		res2 *= -1
	}
	return float64(res1) + res2
}

func getInt() int {
	return int(getInt64())
}

func getInt64() int64 {
	in.Scan()
	b := in.Bytes()
	var isNeg bool
	if b[0] == '-' {
		isNeg = true
		b = b[1:]
	}
	var res int64
	for i := 0; i < len(b); i++ {
		res *= 10
		res += int64(b[i]) - 48
	}
	if isNeg {
		res *= -1
	}
	return res
}

func getString() string {
	in.Scan()
	return in.Text()
}

func intToBytes(n int) []byte {
	return int64ToBytes(int64(n))
}

func int64ToBytes(n int64) []byte {
	var res [65]byte
	var isNeg bool
	if n < 0 {
		isNeg = true
		n = -n
	}
	var l int = 65
	for n > 0 {
		l--
		res[l] = byte(n % 10 + 48)
		n /= 10
	}
	if l == 65 {
		l--
		res[l] = byte(48)
	}
	if isNeg {
		l--
		res[l] = byte(45)
	}
	return res[l:]
}

func bsLower(arr []int, n int) int {
	var minN, midN, maxN int
	maxN = len(arr)
	for maxN - 1 > minN {
		midN = (minN + maxN) / 2
		if arr[midN] < n {
			minN = midN
		} else {
			maxN = midN
		}
	}
	if arr[minN] >= n {
		return minN
	}
	return maxN
}

func bsLower64(arr []int64, n int64) int {
	var minN, midN, maxN int
	maxN = len(arr)
	for maxN - 1 > minN {
		midN = (minN + maxN) / 2
		if arr[midN] < n {
			minN = midN
		} else {
			maxN = midN
		}
	}
	if arr[minN] >= n {
		return minN
	}
	return maxN
}

func bsUpper(arr []int, n int) int {
	var minN, midN, maxN int
	maxN = len(arr)
	for maxN - 1 > minN {
		midN = (minN + maxN) / 2
		if arr[midN] <= n {
			minN = midN
		} else {
			maxN = midN
		}
	}
	if arr[minN] > n {
		return minN
	}
	return maxN
}

func bsUpper64(arr []int64, n int64) int {
	var minN, midN, maxN int
	maxN = len(arr)
	for maxN - 1 > minN {
		midN = (minN + maxN) / 2
		if arr[midN] <= n {
			minN = midN
		} else {
			maxN = midN
		}
	}
	if arr[minN] > n {
		return minN
	}
	return maxN
}

func max(n1, n2 int) int {
	return int(max64(int64(n1), int64(n2)))
}

func max64(n1, n2 int64) int64 {
	if n1 > n2 {
		return n1
	}
	return n2
}

func min(n1, n2 int) int {
	return int(min64(int64(n1), int64(n2)))
}

func min64(n1, n2 int64) int64 {
	if n1 < n2 {
		return n1
	}
	return n2
}

func yes(res, isUpperCase bool) bool {
	var arr [4]string = [4]string{"No", "Yes", "NO", "YES"}
	var ind int
	if res == true {
		ind = 1
	}
	if isUpperCase == true {
		ind += 2
	}
	out.WriteString(arr[ind])
	out.WriteByte(NL)
	return res
}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)

	var buf bytes.Buffer

	n, m := readTwoNums(reader)

	A := make([][]int, n)
	for i := 0; i < n; i++ {
		A[i] = readNNums(reader, m)
	}
	solve(A)

	for i := 0; i < n; i++ {
		for j := 0; j < m; j++ {
			buf.WriteString(fmt.Sprintf("%d ", A[i][j]))
		}
		buf.WriteByte('\n')
	}
	fmt.Print(buf.String())
}

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
}

const H = 720720 // lcm(1, 2, 3,... 16)

func solve(A [][]int) {
	for i := 0; i < len(A); i++ {
		for j := 0; j < len(A[i]); j++ {
			if (i+j)&1 == 0 {
				A[i][j] = H
			} else {
				A[i][j] = H + pow4(A[i][j])
			}
		}
	}
}

func pow4(a int) int {
	return a * a * a * a
}

package main

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

func primeFactors(x int) map[int]int {
	res := make(map[int]int)
	for i := 2; i <= x; i++ {
		if x%i != 0 {
			continue
		}
		for x%i == 0 {
			res[i]++
			x = x / i
		}
	}
	return res
}

func main() {
	maxFactors := make(map[int]int)

	for i := 2; i <= 16; i++ {
		factors := primeFactors(i)
		for i, c := range factors {
			if maxFactors[i] < c {
				maxFactors[i] = c
			}
		}
	}
	var mul int = 1
	for i, c := range maxFactors {
		for j := 0; j < c; j++ {
			mul *= i
		}
	}
	input := bufio.NewReader(os.Stdin)
	var m, n int
	fmt.Fscanln(input, &m, &n)
	for i := 0; i < m; i++ {
		for j := 0; j < n; j++ {
			var data int
			fmt.Fscan(input, &data)
			res := mul
			if (i+j)%2 == 1 {
				res += data * data * data * data
			}
			if j != n-1 {
				fmt.Printf("%d ", res)
			} else {
				fmt.Printf("%d\n", res)
				fmt.Fscanf(input, "\n")
			}
		}
	}
}

package main

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

const maxn int = 510

var a [maxn][maxn]int64

func gcd(a, b int64) int64 {
	if b == 0 {
		return a
	} else {
		return gcd(b, a%b)
	}
}
func lcm(a, b int64) int64 {
	return (a * b) / gcd(a, b)
}
func main() {

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

	var LCM int64 = 1
	for i := 1; i <= 16; i++ {
		LCM = lcm(LCM, int64(i))
	}
	var m, n int

	Fscan(in, &m, &n)

	for i := 0; i < m; i++ {
		for j := 0; j < n; j++ {
			Fscan(in, &a[i][j])
			if (i+j)%2 == 1 {
				Fprint(out, LCM, " ")
			} else {
				Fprint(out, a[i][j]*a[i][j]*a[i][j]*a[i][j]+LCM, " ")
			}

		}
		Fprintln(out)
	}

}

package main

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

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

func init() {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 4096), 1e9)
}

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

func sint64() int64 {
	s := sstring()
	i := int64(0)
	if s[0] == '-' {
		for _, r := range s[1:] {
			i *= 10
			i -= int64(r - '0')
		}
		return i
	}
	for _, r := range s {
		i *= 10
		i += int64(r - '0')
	}
	return i
}

func sint64s(n int64) []int64 {
	a := make([]int64, n)
	for i := range a {
		a[i] = sint64()
	}
	return a
}

func sstring() string {
	if !scanner.Scan() {
		panic(scanner.Err())
	}
	return scanner.Text()
}

func gcd(a, b int64) int64 {
	for b != 0 {
		a, b = b, a%b
	}
	if a < 0 {
		a *= -1
	}
	return a
}

func lcm(a, b int64) int64 {
	if a == 0 || b == 0 {
		panic("invalid input")
	}
	ret := a / gcd(a, b) * b
	if ret < 0 {
		ret *= -1
	}
	return ret
}

func main() {
	defer writer.Flush()
	n, m := sint64(), sint64()
	a := make([][]int64, n)
	for i := range a {
		a[i] = sint64s(m)
	}
	res := sol(n, m, a)
	for i := range res {
		for j := range res[i] {
			printf("%d ", res[i][j])
		}
		printf("\n")
	}
}

var lcm16 = func() int64 {
	ret := int64(1)
	for i := int64(1); i <= 16; i++ {
		ret = lcm(ret, i)
	}
	return ret
}()

func sol(n, m int64, a [][]int64) [][]int64 {
	w := lcm16
	x := lcm16 + pow4(2)
	y := lcm16 + pow4(3)
	z := lcm16 + pow4(4)
	ret := make([][]int64, n)
	for i := range ret {
		ret[i] = make([]int64, m)
		for j := range ret[i] {
			if i&1 == 0 && j&1 == 0 {
				ret[i][j] = w
			}
			if i&1 == 0 && j&1 == 1 {
				ret[i][j] = x
			}
			if i&1 == 1 && j&1 == 0 {
				ret[i][j] = y
			}
			if i&1 == 1 && j&1 == 1 {
				ret[i][j] = z
			}
		}
	}
	return ret
}

func pow4(n int64) int64 {
	return n * n * n * n
}


package main

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

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

	scanner.Scan()

	t := scanner.Text()

	testCases, err := strconv.Atoi(t)

	if err != nil {
		panic(err)
	}

	for j := 0; j < int(testCases); j ++ {

		scanner.Scan()

		nn := scanner.Text()

		n, _  := strconv.Atoi(nn)

		res := solve4(n)

		if res == nil {
			fmt.Println(-1)

		} else {
			for _, r := range res {
				fmt.Println(r)
				fmt.Print(" ")
			}
		}
	}
}

func solve4 (n int ) []int {
	if n <= 3 {
		return  nil
	}

	if n % 4 == 0 {
		ans := make([]int, n)

		ans[0] = 2
		ans[1] = 4
		ans[2] = 1
		ans[3] = 3

		for i := 4 ; i < n; i += 4 {
			ans[i] = i + 2
			ans[i + 1] = i + 4
			ans[i + 2] = i + 1
			ans[i + 3] = i + 3
		}

		return ans

	} else if n % 4 == 1 {
		ans := make([]int, n)

		ans[0] = 2
		ans[1] = 4
		ans[2] = 1
		ans[3] = 3
		ans[4] = 5

		for i := 5 ; i < n; i += 4 {
			ans[i] = i + 2
			ans[i + 1] = i + 4
			ans[i + 2] = i + 1
			ans[i + 3] = i + 3
		}

		return ans

	} else if n % 4 == 2 {
		ans := make([]int, n)

		ans[0] = 1
		ans[1] = 3
		ans[2] = 5
		ans[3] = 2
		ans[4] = 4
		ans[5] = 6

		for i := 6 ; i < n; i += 4 {
			ans[i] = i + 2
			ans[i + 1] = i + 4
			ans[i + 2] = i + 1
			ans[i + 3] = i + 3
		}

		return ans

	} else {
		ans := make([]int, n)

		ans[0] = 2
		ans[1] = 4
		ans[2] = 7
		ans[3] = 5
		ans[4] = 1
		ans[5] = 3
		ans[6] = 6

		for i := 7 ; i < n; i += 4 {
			ans[i] = i + 2
			ans[i + 1] = i + 4
			ans[i + 2] = i + 1
			ans[i + 3] = i + 3
		}

		return ans
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"

	//"os"

	//"os"
	"strconv"
	"strings"
)

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

func Assert(b bool) {
	if !b {
		panic("Assertion error")
	}
}

func main() {
	input := os.Stdin
	/*
			input := strings.NewReader(`6
		10
		2
		4
		6
		7
		13`)
	*/
	scanner := bufio.NewScanner(input)

	getLine := func() string {
		if !scanner.Scan() {
			panic("expected line")
		}
		return scanner.Text()
	}

	parseNumber := func(s string) int {
		t, err := strconv.ParseInt(s, 10, 64)
		CheckError(err)
		return int(t)
	}

	getNumber := func() int {
		return parseNumber(getLine())
	}

	t := getNumber()
	for i := 0; i < t; i++ {
		n := getNumber()

		//fmt.Println(n)
		constructPermutation(n)
	}

}

var (
	lst4 = []int{2, 4, 1, 3}
	lst5 = []int{2, 4, 1, 3, 5}
	lst6 = []int{2, 4, 1, 5, 3, 6}
	lst7 = []int{2, 6, 3, 1, 4, 7, 5}
)

func constructPermutation(n int) {
	if n < 4 {
		fmt.Println("-1")
		return
	}

	printList := func(lst []int) {
		// f := "%d" + strings.Repeat(" %d", len(lst)-1) + "\n"

		// b := make([]interface{}, len(lst))
		// for i := range lst {
		//   b[i] = lst[i]
		// }

		// fmt.Printf(f, b...)
		var sLst []string
		for _, v := range lst {
			sLst = append(sLst, strconv.Itoa(v))
		}
		fmt.Println(strings.Join(sLst, " "))
	}

	if n == 4 {
		printList(lst4)
		return
	}

	if n == 5 {
		printList(lst5)
		return
	}

	if n == 6 {
		printList(lst6)
		return
	}

	if n == 7 {
		printList(lst7)
		return
	}

	p := n / 4
	q := n % 4

	var lst []int
	appendShiftedList := func(aLst []int, shift int) {
		for _, v := range aLst {
			lst = append(lst, v+shift)
		}
	}

	for i := 0; i < p-1; i++ {
		shift := i * 4
		appendShiftedList(lst4, shift)
	}

	if q == 0 {
		appendShiftedList(lst4, (p-1)*4)
		printList(lst)
		return
	}

	if q == 1 {
		appendShiftedList(lst5, (p-1)*4)
		printList(lst)
		return
	}

	if q == 2 {
		appendShiftedList(lst6, (p-1)*4)
		printList(lst)
		return
	}

	if q == 3 {
		appendShiftedList(lst7, (p-1)*4)
		printList(lst)
		return
	}
}

/*
URL:
https://codeforces.com/contest/1352/problem/G
*/

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
	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 (
	t int
	n int
)

func main() {
	t = ReadInt()
	for i := 0; i < t; i++ {
		n = ReadInt()
		if n <= 3 {
			fmt.Println(-1)
			continue
		}

		solve(n)
	}
}

func solve(n int) {
	if n%2 == 1 {
		odd(n)
	} else {
		even(n)
	}
}

func odd(n int) {
	answers := []int{}
	for i := 1; i <= n; i += 2 {
		answers = append(answers, i)
	}
	answers = append(answers, n-3)
	answers = append(answers, n-1)

	for i := n - 5; i >= 1; i -= 2 {
		answers = append(answers, i)
	}

	fmt.Println(PrintIntsLine(answers...))
}

func even(n int) {
	A := []int{}
	for i := 2; i <= n; i += 2 {
		A = append(A, i)
	}
	A = append(A, n-3)
	A = append(A, n-1)

	for i := n - 5; i >= 1; i -= 2 {
		A = append(A, i)
	}

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

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

/*********** 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"
)

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

	var t, n int
	for Fscan(in, &t); t > 0; t-- {
		Fscan(in, &n)
		if n <= 3 {
			Fprintln(out, -1)
			continue
		}
		ans := make([]interface{}, 0, n)
		if n&1 == 1 {
			for i := n; i > 0; i -= 2 {
				ans = append(ans, i)
			}
			n--
		} else {
			for i := n-1; i > 0; i -= 2 {
				ans = append(ans, i)
			}
		}
		if n%4==0 {
			for i :=4;i<=n;i+=4 {
				ans = append(ans, i)
			}
			for i:=n-2;i>0;i-=4 {
				ans = append(ans, i)
			}
		} else {
			for i :=4;i<n;i+=4 {
				ans = append(ans, i)
			}
			for i:=n;i>0;i-=4 {
				ans = append(ans, i)
			}
		}
		Fprintln(out, ans...)
	}
}

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 scanf(f string, a ...interface{})  { fmt.Fscanf(reader, f, a...) }
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }

func solve() {
	n := 0
	scanf("%d\n", &n)
	if n < 4 {
		printf("-1\n")
	} else if n == 4 {
		printf("3 1 4 2\n")
	} else {
		i := 1
		for i <= n {
			printf("%d ", i)
			i += 2
		}
		printf("%d ", i - 5)
		if n & 1 == 0 {
			printf("%d ", i - 1)
		}
		i -= 3
		printf("%d ", i)
		i -= 4
		for i > 0 {
			printf("%d ", i)
			i -= 2
		}
		printf("\n")
	}
}

func main() {
	t := 0
	scanf("%d\n", &t)
	for t > 0 {
		solve()
		t--
	}
	writer.Flush()
}

package main

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

type BufferedWriter interface {
	Printf(format string, a ...interface{})
	Flush()
}

type writerImpl struct {
	*bufio.Writer
}

func NewBufferedWriter(writer io.Writer) BufferedWriter {
	return &writerImpl{Writer: bufio.NewWriter(writer)}
}

func (impl *writerImpl) Printf(f string, a ...interface{}) {
	fmt.Fprintf(impl.Writer, f, a...)
}

func (impl *writerImpl) Flush() {
	impl.Writer.Flush()
}

type WordScanner interface {
	NextInt64() int64
	NextUInt64() uint64
	NextString() string
}

type wordScannerImpl struct {
	*bufio.Scanner
}

func NewWordScanner(reader io.Reader) WordScanner {
	s := bufio.NewScanner(reader)
	s.Split(bufio.ScanWords)
	// adjust the following size as needed
	// 2 << 17 is good enough to scan strings of len 2*10^5
	// it could go as high as 2 << 26 before cf judge breaks
	size := 2 << 20
	buf := make([]byte, size)
	s.Buffer(buf, size)
	return &wordScannerImpl{Scanner: s}
}

func (impl *wordScannerImpl) NextInt64() int64 {
	impl.Scan()
	bb := impl.Bytes()
	i := int64(0)
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int64(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int64(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextUInt64() uint64 {
	impl.Scan()
	bb := impl.Bytes()
	i := uint64(0)
	for _, b := range bb {
		i *= 10
		i += uint64(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextString() string {
	impl.Scan()
	return impl.Text()
}

func gcd(x, y int64) int64 {
	for y != 0 {
		x, y = y, x%y
	}
	return x
}

func abs(a int64) int64 {
	if a < 0 {
		return a * -1
	}
	return a
}

func min(a int64, rest ...int64) int64 {
	for _, r := range rest {
		if r < a {
			a = r
		}
	}
	return a
}

func max(a int64, rest ...int64) int64 {
	for _, r := range rest {
		if r > a {
			a = r
		}
	}
	return a
}

const (
	INF = math.MaxInt64
	MOD = 1e9 + 7
)

var reader = NewWordScanner(os.Stdin)
var writer = NewBufferedWriter(os.Stdout)

func main() {
	defer writer.Flush()
	t := reader.NextInt64()
	for ; t > 0; t-- {
		n := reader.NextInt64()
		res := sol(n)
		if res == nil {
			writer.Printf("-1\n")
		} else {
			for _, r := range res {
				writer.Printf("%d ", r)
			}
			writer.Printf("\n")
		}
	}
}

func sol(n int64) []int64 {
	if n <= 3 {
		return nil
	}
	if n & 1 == 0 {
		ret := []int64{}
		for i := int64(2); i <= n; i += 2 {
			ret = append(ret, i)
		}
		ret = append(ret, n-3, n-1)
		for i := n-5; i >= 1; i -= 2 {
			ret = append(ret, i)
		}
		return ret
	}
	ret := []int64{}
	for i := int64(1); i <= n; i+= 2 {
		ret = append(ret, i)
	}
	ret = append(ret, n-3, n-1)
	for i := n-5; i >= 1; i-= 2 {
		ret = append(ret, i)
	}
	return ret
}

package main

import (
	"fmt"
)

func solve() {
	var n int
	fmt.Scanf("%d\n", &n)
	if n >= 4 {
		for i := n; i >= 0; i-- {
			if i&1 == 1 {
				fmt.Printf("%d ", i)
			}
		}
		fmt.Printf("4 2 ")
		for i := 6; i <= n; i += 2 {
			fmt.Printf("%d ", i)
		}
		fmt.Println()
	} else {
		fmt.Printf("-1\n")
	}

}

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

package main

import (
	"fmt"
	"math"
)

func main() {
	var n int
	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		var a int
		fmt.Scan(&a)
		N := float64(a) / 10
		x := math.Ceil(float64(N))
		var number int = 2
		var list []int
		list = append(list, number)
		var (
			lst4  = []int{2, 4, 1, 3}
			lst5  = []int{2, 4, 1, 3, 5}
			lst6  = []int{2, 4, 1, 5, 3, 6}
			lst7  = []int{2, 6, 3, 1, 4, 7, 5}
			lst10 = []int{2, 4, 1, 3, 6, 8, 5, 9, 7, 10}
		)
		if a < 4 {
			fmt.Println("-1")
		} else if a == 4 {
			for j := 0; j < len(lst4); j++ {
				fmt.Print(lst4[j], " ")
			}
			fmt.Println()

		} else if a == 5 {

			for j := 0; j < len(lst5); j++ {

				fmt.Print(lst5[j], " ")

			}
			fmt.Println()
		} else if a == 6 {

			for j := 0; j < len(lst6); j++ {

				fmt.Print(lst6[j], " ")

			}
			fmt.Println()
		} else if a == 7 {

			for j := 0; j < len(lst7); j++ {

				fmt.Print(lst7[j], " ")

			}
			fmt.Println()
		} else if a == 10 {

			for j := 0; j < len(lst10); j++ {

				fmt.Print(lst10[j], " ")

			}
			fmt.Println()
		} else {
			for j := 0; j < int(x)*3; j++ {
				number += 2
				list = append(list, number)
				number -= 3
				list = append(list, number)
				number += 2
				list = append(list, number)
				number += 3
				list = append(list, number)
			}
			//var newList []int
			for j := 0; j < len(list); j++ {
				if list[j] <= a {
					fmt.Print(list[j], " ")
				}
			}
			fmt.Println()
		}

	}
}

package main

import (
	"fmt"
	"math"
)

func main() {
	var n int
	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		var a int
		fmt.Scan(&a)
		N := float64(a) / 10
		x := math.Ceil(float64(N))
		var number int = 2
		var list []int
		list = append(list, number)
		if a < 4 {
			fmt.Println("-1")
		} else {
			for j := 0; j < int(x)*3; j++ {
				number += 2
				list = append(list, number)
				number -= 3
				list = append(list, number)
				number += 2
				list = append(list, number)
				number += 3
				list = append(list, number)
			}
			//var newList []int
			for j := 0; j < len(list); j++ {
				if list[j] <= a {
					fmt.Print(list[j], " ")
				}
			}
			fmt.Println()
		}

	}
}

package main

import (
	"fmt"
	"math"
)

func main() {
	var n int
	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		var a int
		fmt.Scan(&a)
		N := float64(a) / 10
		x := math.Ceil(float64(N))
		var number int = 2
		var list []int
		list = append(list, number)
		var (
			lst4 = []int{2, 4, 1, 3}
			lst5 = []int{2, 4, 1, 3, 5}
			lst6 = []int{2, 4, 1, 5, 3, 6}
			lst7 = []int{2, 6, 3, 1, 4, 7, 5}
		)
		if a < 4 {
			fmt.Println("-1")
		} else if a == 4 {
			for j := 0; j < len(lst4); j++ {
				fmt.Print(lst4[j], " ")
			}
			fmt.Println()

		} else if a == 5 {

			for j := 0; j < len(lst5); j++ {

				fmt.Print(lst5[j], " ")

			}
			fmt.Println()
		} else if a == 6 {

			for j := 0; j < len(lst6); j++ {

				fmt.Print(lst6[j], " ")

			}
			fmt.Println()
		} else if a == 7 {

			for j := 0; j < len(lst7); j++ {

				fmt.Print(lst7[j], " ")

			}
			fmt.Println()
		} else {
			for j := 0; j < int(x)*3; j++ {
				number += 2
				list = append(list, number)
				number -= 3
				list = append(list, number)
				number += 2
				list = append(list, number)
				number += 3
				list = append(list, number)
			}
			//var newList []int
			for j := 0; j < len(list); j++ {
				if list[j] <= a {
					fmt.Print(list[j], " ")
				}
			}
			fmt.Println()
		}

	}
}

package main

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

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

	scanner.Scan()

	t := scanner.Text()

	testCases, err := strconv.Atoi(t)

	if err != nil {
		panic(err)
	}

	for j := 0; j < int(testCases); j ++ {

		scanner.Scan()

		nn := scanner.Text()

		n, _  := strconv.Atoi(nn)

		res := solve4(n)

		if res == nil {
			fmt.Println(-1)

		} else {
			fmt.Println(res)
		}
	}
}

func solve4 (n int ) []int {
	if n <= 3 {
		return  nil
	}

	if n % 4 == 0 {
		ans := make([]int, n)

		ans[0] = 2
		ans[1] = 4
		ans[2] = 1
		ans[3] = 3

		for i := 4 ; i < n; i += 4 {
			ans[i] = i + 2
			ans[i + 1] = i + 4
			ans[i + 2] = i + 1
			ans[i + 3] = i + 3
		}

		return ans

	} else if n % 4 == 1 {
		ans := make([]int, n)

		ans[0] = 2
		ans[1] = 4
		ans[2] = 1
		ans[3] = 3
		ans[4] = 5

		for i := 5 ; i < n; i += 4 {
			ans[i] = i + 2
			ans[i + 1] = i + 4
			ans[i + 2] = i + 1
			ans[i + 3] = i + 3
		}

		return ans

	} else if n % 4 == 2 {
		ans := make([]int, n)

		ans[0] = 1
		ans[1] = 3
		ans[2] = 5
		ans[3] = 2
		ans[4] = 4
		ans[5] = 6

		for i := 6 ; i < n; i += 4 {
			ans[i] = i + 2
			ans[i + 1] = i + 4
			ans[i + 2] = i + 1
			ans[i + 3] = i + 3
		}

		return ans

	} else {
		ans := make([]int, n)

		ans[0] = 2
		ans[1] = 4
		ans[2] = 7
		ans[3] = 5
		ans[4] = 1
		ans[5] = 3
		ans[6] = 6

		for i := 7 ; i < n; i += 4 {
			ans[i] = i + 2
			ans[i + 1] = i + 4
			ans[i + 2] = i + 1
			ans[i + 3] = i + 3
		}

		return ans
	}
}

package main

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

type BufferedWriter interface {
	Printf(format string, a ...interface{})
	Flush()
}

type writerImpl struct {
	*bufio.Writer
}

func NewBufferedWriter(writer io.Writer) BufferedWriter {
	return &writerImpl{Writer: bufio.NewWriter(writer)}
}

func (impl *writerImpl) Printf(f string, a ...interface{}) {
	fmt.Fprintf(impl.Writer, f, a...)
}

func (impl *writerImpl) Flush() {
	impl.Writer.Flush()
}

type WordScanner interface {
	NextInt64() int64
	NextUInt64() uint64
	NextString() string
}

type wordScannerImpl struct {
	*bufio.Scanner
}

func NewWordScanner(reader io.Reader) WordScanner {
	s := bufio.NewScanner(reader)
	s.Split(bufio.ScanWords)
	// adjust the following size as needed
	// 2 << 17 is good enough to scan strings of len 2*10^5
	// it could go as high as 2 << 26 before cf judge breaks
	size := 2 << 20
	buf := make([]byte, size)
	s.Buffer(buf, size)
	return &wordScannerImpl{Scanner: s}
}

func (impl *wordScannerImpl) NextInt64() int64 {
	impl.Scan()
	bb := impl.Bytes()
	i := int64(0)
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int64(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int64(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextUInt64() uint64 {
	impl.Scan()
	bb := impl.Bytes()
	i := uint64(0)
	for _, b := range bb {
		i *= 10
		i += uint64(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextString() string {
	impl.Scan()
	return impl.Text()
}

func gcd(x, y int64) int64 {
	for y != 0 {
		x, y = y, x%y
	}
	return x
}

func abs(a int64) int64 {
	if a < 0 {
		return a * -1
	}
	return a
}

func min(a int64, rest ...int64) int64 {
	for _, r := range rest {
		if r < a {
			a = r
		}
	}
	return a
}

func max(a int64, rest ...int64) int64 {
	for _, r := range rest {
		if r > a {
			a = r
		}
	}
	return a
}

const (
	INF = math.MaxInt64
	MOD = 1e9 + 7
)

var reader = NewWordScanner(os.Stdin)
var writer = NewBufferedWriter(os.Stdout)

func main() {
	defer writer.Flush()
	t := reader.NextInt64()
	for ; t > 0; t-- {
		n := reader.NextInt64()
		res := sol(n)
		if res == nil {
			writer.Printf("-1\n")
		} else {
			for _, r := range res {
				writer.Printf("%d ", r)
			}
			writer.Printf("\n")
		}
	}
}

func sol(n int64) []int64 {
	if n <= 3 {
		return nil
	}
	ret := []int64{}
	for i := int64(2); i <= n; i += 2 {
		ret = append(ret, i)
	}
	if ret[len(ret)-1] == n {
		ret = append(ret, n-3, n-1)
		for i := n-5; i >= 1; i -= 2 {
			ret = append(ret, i)
		}
		return ret
	}
	ret = append(ret, n-2, n)
	for i := n-4; i >= 1; i -= 2 {
		ret = append(ret, i)
	}
	return ret
}


package main

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

func solve() {
    _, a, b, _, s := readInt(), readInt(), readInt(), readInt(), readString() + "1"
    slots, start := []int{}, -1
    for i, ch := range s {
        if ch == '1' {
            for i-start-1 >= b {
                slots, start = append(slots, start+b), start+b
            }
            start = i
        }
    }
    ans := len(slots)-a+1
    fmt.Println(ans)
    for i := 0; i < ans; i++ {
        fmt.Print(slots[i]+1, " ")
    }
    fmt.Println()
}

var scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)

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

// Math
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 {
	return x + y - max(x, y)
}

// 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 readArray(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = readInt()
	}
	return res
}

/* Sort tempalte
func (a ) Len() int           { return len(a) }
func (a ) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ) Less(i, j int) bool { return  }
*/

package main

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

func main() {
	reader := bufio.NewReaderSize(os.Stdin, 1<<13)
	writer := bufio.NewWriterSize(os.Stdout, 1<<13)
	var n, a, b, k int
	fmt.Fscanln(reader, &n, &a, &b, &k)
	var shots string
	fmt.Fscanln(reader, &shots)

	ans := getCells([]byte(shots), a, b, n)
	fmt.Fprintln(writer, len(ans))
	for i, value := range ans {
		if i == n {
			break
		}
		fmt.Fprint(writer, value+1, " ")
	}
	fmt.Fprintln(writer)
	writer.Flush()
}

func getCells(shots []byte, a, b, n int) []int {
	res := make([]int, 0)
	empty := 0
	for i, shot := range shots {
		if shot == '0' {
			empty++
		} else {
			empty = 0
		}
		if empty == b {
			res = append(res, i)
			empty = 0
		}
	}
	return res[:len(res)-a+1]
}

func ReadInt(reader *bufio.Reader) int {
	b, err := reader.ReadByte()
	for !isValid(b, err) {
		b, err = reader.ReadByte()
	}
	res := 0
	for isValid(b, err) {
		res = res*10 + int(b-'0')
		b, err = reader.ReadByte()
	}
	return res
}

func isValid(b byte, err error) bool {
	return err == nil && '0' <= b && b <= '9'
}

package main

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

func main() {
	reader := bufio.NewReaderSize(os.Stdin, 1<<13)
	writer := bufio.NewWriterSize(os.Stdout, 1<<13)
	n, a, b, _ := ReadInt(reader), ReadInt(reader), ReadInt(reader), ReadInt(reader)
	shots := make([]int, n)
	for i := 0; i < n; i++ {
		b, err := reader.ReadByte()
		if err != nil {
			panic(err)
		}
		shots[i] = int(b - '0')
	}
	ans := getCells(shots, a, b, n)
	fmt.Fprintln(writer, len(ans))
	for _, value := range ans {
		fmt.Fprint(writer, value+1, " ")
	}
	writer.Flush()
}

func getCells(shots []int, a, b, n int) []int {
	res := make([]int, 0)
	empty := 0
	for i, shot := range shots {
		if shot == 0 {
			empty++
		} else {
			empty = 0
		}
		if empty == b {
			res = append(res, i)
			empty = 0
		}
	}
	return res[:len(res)-a+1]
}

func ReadInt(reader *bufio.Reader) int {
	b, err := reader.ReadByte()
	for !isValid(b, err) {
		b, err = reader.ReadByte()
	}
	res := 0
	for isValid(b, err) {
		res = res*10 + int(b-'0')
		b, err = reader.ReadByte()
	}
	return res
}

func isValid(b byte, err error) bool {
	return err == nil && '0' <= b && b <= '9'
}

package main

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

func main() {
	reader := bufio.NewReaderSize(os.Stdin, 1<<13)
	writer := bufio.NewWriterSize(os.Stdout, 1<<13)
	n, a, b, _ := ReadInt(reader), ReadInt(reader), ReadInt(reader), ReadInt(reader)
	shots := make([]int, n)
	for i := 0; i < n; i++ {
		b, err := reader.ReadByte()
		if err != nil {
			panic(err)
		}
		shots[i] = int(b - '0')
	}
	ans := getCells(shots, a, b, n)
	fmt.Fprintln(writer, len(ans))
	for _, value := range ans {
		fmt.Fprint(writer, value+1, " ")
	}
	fmt.Fprintln(writer)
	writer.Flush()
}

func getCells(shots []int, a, b, n int) []int {
	res := make([]int, 0)
	empty := 0
	for i, shot := range shots {
		if shot == 0 {
			empty++
		} else {
			empty = 0
		}
		if empty == b {
			res = append(res, i)
			empty = 0
		}
	}
	return res[:len(res)-a+1]
}

func ReadInt(reader *bufio.Reader) int {
	b, err := reader.ReadByte()
	for !isValid(b, err) {
		b, err = reader.ReadByte()
	}
	res := 0
	for isValid(b, err) {
		res = res*10 + int(b-'0')
		b, err = reader.ReadByte()
	}
	return res
}

func isValid(b byte, err error) bool {
	return err == nil && '0' <= b && b <= '9'
}