/*
URL:
https://codeforces.com/problemset/problem/1373/D
*/

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
	A []int64
)

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

		solve()
	}
}

func solve() {
	dp := make([][]int64, n+10)
	for i := 0; i <= n+5; i++ {
		dp[i] = make([]int64, 3)
	}
	A = append(A, 0)

	for i := 0; i < n; i++ {
		a := A[i]
		b := A[i+1]
		if i%2 == 0 {
			ChMax(&dp[i+1][0], dp[i][0]+a)

			ChMax(&dp[i+2][1], dp[i][0]+b)
			ChMax(&dp[i+2][1], dp[i][1]+b)

			// ChMax(&dp[i+1][2], dp[i][0]+a)
			ChMax(&dp[i+1][2], dp[i][1]+a)
			ChMax(&dp[i+1][2], dp[i][2]+a)
		} else {
			ChMax(&dp[i+1][0], dp[i][0])

			ChMax(&dp[i+2][1], dp[i][0]+a)
			ChMax(&dp[i+2][1], dp[i][1]+a)

			// ChMax(&dp[i+1][2], dp[i][0])
			ChMax(&dp[i+1][2], dp[i][1])
			ChMax(&dp[i+1][2], dp[i][2])
		}
	}

	fmt.Println(Max(dp[n][0], dp[n][1], dp[n][2]))
}

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

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

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

/*********** 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...)
}

// --- In the name of Allah ---
package main
import(
	"fmt"
	"bufio"
	"os"
	"strconv"
)
func main(){
	t := InputInt();
	var answers []int64;
	for ;t>0;t--{
		n := InputInt();
		var array []int;
		var sum int64;
		for i:=0; i<n; i ++{
			x := InputInt();
			if i % 2 == 0{
				sum += int64(x);
			}
			array = append(array, x);
		}
		var cnt, ans int64 =0, sum;
		for i:=0; i < n-1; i += 2{
			cnt -= int64(array[i]);
			cnt += int64(array[i+1]);
			if cnt < 0{
				cnt = 0;
			}
			ans = max( ans, sum + cnt );
		}
		cnt = 0;
		for i:=1; i < n-1; i +=2 {
			cnt += int64(array[i]);
			cnt -= int64(array[i+1]);
			if( cnt < 0 ){
				cnt = 0;
			}
			ans = max( ans, sum + cnt);
		}
		answers = append(answers, ans);
	}
	for _, val := range answers{
		fmt.Println(val);
	}
}
func max( a int64, b int64)int64{
	if( a > b){
		return a;
	}else{
		return b;
	}
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
var Scanner = bufio.NewScanner(os.Stdin);

func init(){
	//Scanner.Buffer(make([]byte,256), 1e6);
	Scanner.Split(bufio.ScanWords);
}
func Input() string{
	Scanner.Scan();
	return Scanner.Text();
}
func InputInt()int{
	i, err := strconv.Atoi(Input());
	if err != nil {
		panic(err);
	}
	return i;
}

package main

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

func main() {
	var cases int
	fmt.Scanf("%d\n", &cases)
	reader := bufio.NewReader(os.Stdin)
	for i := 0; i < cases; i++ {
		line := readLine(reader)
		n, _ := strconv.ParseInt(string(line), 10, 64)
		line = readLine(reader)
		ans := strings.Split(string(line), " ")
		an := make([]int64, n)
		srcSum := int64(0)
		for j, ai := range ans {
			an[j], _ = strconv.ParseInt(ai, 10, 64)
			if j%2 == 0 {
				srcSum += an[j]
			}
		}
		if n == 1 {
			fmt.Println(an[0])
			continue
		}
		bn := make([]int64, n/2) // pairs
		cn := make([]int64, (n-1)/2)
		if n%2 == 0 {
			for i := int64(0); i < n; {
				bn[i/2] = an[i+1] - an[i]
				if i > 1 {
					cn[(i-1)/2] = an[i-1] - an[i]
				}
				i = i + 2
			}

		} else {
			start := int64(0)
			for ; start < n-1; {
				bn[start/2] = an[start+1] - an[start]
				start = start + 2
			}
			for start=1;start<n-1; {
				cn[(start-1)/2] = an[start] - an[start+1]
				start = start + 2
			}
		}
		// find max sum
		// fmt.Println(bn)
		// fmt.Println(cn)
		// fmt.Println(srcSum)
		max := findMax(bn)
		if max < 0 {
			max = 0
		}
		maxcn := findMax(cn)
		if maxcn > max {
			max = maxcn
		}

		fmt.Println(srcSum + max)
	}
}

func findMax(bn []int64) int64 {
	current := int64(0)
	max := int64(0)
	for j := 0; j < len(bn); j++ {
		current += bn[j]
		if current < 0 {
			current = 0
		} else if current > 0 {
			if current > max {
				max = current
			}
		}
	}
	return max
}

func readLine(reader *bufio.Reader) []byte {
	result := make([]byte, 0)
	for {
		s, isPrefix, err := reader.ReadLine()
		if err != nil {
			fmt.Printf("error=%+v\n", err)
			break
		}
		result = append(result, s...)
		if !isPrefix {
			break
		}
	}
	return result
}

/*
URL:
https://codeforces.com/contest/1373/problem/D
*/

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
	A []int64
)

func main() {
	t = ReadInt()

	for i := 0; i < t; i++ {
		n = ReadInt()
		A = ReadInt64Slice(n)

		solve()
	}
}

func solve() {
	B, C := []int64{}, []int64{}

	for i := 0; i+1 < n; i += 2 {
		val := A[i+1] - A[i]
		B = append(B, val)
	}
	for i := 1; i+1 < n; i += 2 {
		val := A[i] - A[i+1]
		C = append(C, val)
	}

	bpref := make([]int64, len(B)+1)
	cpref := make([]int64, len(C)+1)
	for i := 0; i < len(B); i++ {
		bpref[i+1] = bpref[i] + B[i]
	}
	for i := 0; i < len(C); i++ {
		cpref[i+1] = cpref[i] + C[i]
	}
	// PrintfDebug("bpref: %v\n", bpref)
	// PrintfDebug("cpref: %v\n", cpref)

	bb, cc := make([]int64, len(bpref)), make([]int64, len(cpref))
	mini := int64(0)
	for i := 1; i < len(bb); i++ {
		bb[i] = bpref[i] - mini
		ChMin(&mini, bpref[i])
	}
	mini = 0
	for i := 1; i < len(cc); i++ {
		cc[i] = cpref[i] - mini
		ChMin(&mini, cpref[i])
	}

	base := int64(0)
	for i := 0; i < n; i += 2 {
		base += A[i]
	}
	fmt.Println(base + Max(Max(cc...), Max(bb...)))
}

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

// func solve() {
// 	dp := make([][]int64, n+10)
// 	for i := 0; i <= n+3; i++ {
// 		dp[i] = make([]int64, 3)
// 	}

// 	for i := 0; i < n; i++ {
// 		if i%2 == 0 {
// 			// A[i]は偶数番目
// 			ChMax(&dp[i+2][0], dp[i][0]+A[i])
// 			ChMax(&dp[i+2][2], dp[i][2]+A[i])
// 		} else {
// 			// A[i]は奇数番目
// 			ChMax(&dp[i+1][1], dp[i][0]+A[i])
// 			ChMax(&dp[i+2][1], dp[i][1]+A[i])
// 			ChMax(&dp[i+1][2], dp[i][1]+A[i])
// 		}
// 	}

// 	fmt.Println(Max(dp[n][2], dp[n+1][2], dp[n][0], dp[n+1][0]))
// }

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

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

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

/*********** 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...)
}

/*
URL:
https://codeforces.com/problemset/problem/1373/D
*/

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
	A []int64
)

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

		solve()
	}
}

func solve() {
	dp := make([][]int64, n+10)
	for i := 0; i <= n+5; i++ {
		dp[i] = make([]int64, 3)
	}
	A = append(A, 0)

	for i := 0; i < n; i++ {
		a := A[i]
		b := A[i+1]
		if i%2 == 0 {
			ChMax(&dp[i+1][0], dp[i][0]+a)

			ChMax(&dp[i+2][1], dp[i][0]+b)
			ChMax(&dp[i+2][1], dp[i][1]+b)

			ChMax(&dp[i+1][2], dp[i][0]+a)
			ChMax(&dp[i+1][2], dp[i][1]+a)
			ChMax(&dp[i+1][2], dp[i][2]+a)
		} else {
			ChMax(&dp[i+1][0], dp[i][0])

			ChMax(&dp[i+2][1], dp[i][0]+a)
			ChMax(&dp[i+2][1], dp[i][1]+a)

			ChMax(&dp[i+1][2], dp[i][0])
			ChMax(&dp[i+1][2], dp[i][1])
			ChMax(&dp[i+1][2], dp[i][2])
		}
	}

	fmt.Println(Max(dp[n][0], dp[n][1], dp[n][2]))
}

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

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

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

/*********** 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 CF1373D(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	max := func(a, b int64) int64 {
		if a > b {
			return a
		}
		return b
	}
	f := func(a []int64) int64 {
		if len(a) == 0 {
			return 0
		}
		curS, maxS := a[0], a[0]
		for _, v := range a[1:] {
			curS = max(curS+v, v)
			maxS = max(maxS, curS)
		}
		return max(maxS, 0)
	}
	var t, n int
	for Fscan(in, &t); t > 0; t-- {
		Fscan(in, &n)
		s := int64(0)
		a := make([]int64, n)
		var b, c []int64
		for i := range a {
			Fscan(in, &a[i])
			if i&1 == 0 {
				s += a[i]
				if i > 0 {
					c = append(c, a[i-1]-a[i])
				}
			} else {
				b = append(b, a[i]-a[i-1])
			}
		}
		Fprintln(out, s+max(f(b), f(c)))
	}
}

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

/**
https://codeforces.com/contest/1373/problem/D
**/

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	line1, _ := reader.ReadString('\n')
	line1_arr := strings.Fields(line1)
	//fmt.Println(line1_arr)
	T, _ := strconv.Atoi(line1_arr[0])
	// fmt.Println("T:", T)
	for t := 0; t < T; t++ {
		line2, _ := reader.ReadString('\n')
		line2_arr := strings.Fields(line2)
		N, _ := strconv.Atoi(line2_arr[0])
		// fmt.Println("N: ", N)
		line3, _ := reader.ReadString('\n')
		//fmt.Println("line3: ", line3)
		line3_arr := strings.Fields(line3)
		A := make([]int64, N)
		for n := 0; n < N; n++ {
			v, _ := strconv.Atoi(line3_arr[n])
			A[n] = int64(v)
		}

		if N == 1 {
			fmt.Println(A[0])
			continue
		}
		//fmt.Println("A: ", A)

		// Approach as per
		// https://codeforces.com/blog/entry/79376
		dp_arr := make([][]int64, N)
		for i := 0; i < N; i++ {
			dp_arr[i] = make([]int64, 3)
		}
		dp_arr[0][0] = A[0] // even
		dp_arr[0][1] = 0 // even
		dp_arr[0][2] = A[0] // even

		dp_arr[1][0] = A[0] // even
		dp_arr[1][1] = A[1] // even
		dp_arr[1][2] = A[0] // even

		for j := 0; j < 3; j++ {
			for i := 2; i < N; i++ {
				max_1_2 := max(dp_arr[i-2][0], dp_arr[i-2][1])
				max_1_2_3 := max(max(dp_arr[i-1][0], dp_arr[i-1][1]), dp_arr[i-1][2])
				if i%2 == 0 {
					dp_arr[i][0] = dp_arr[i-1][0] + A[i]
					dp_arr[i][1] = max_1_2 + A[i-1]
					dp_arr[i][2] = max_1_2_3 + A[i]
				} else {
					dp_arr[i][0] = dp_arr[i-1][0]
					dp_arr[i][1] = max_1_2 + A[i]
					dp_arr[i][2] = max_1_2_3
				}
			}
		}

		//fmt.Println("dp_arr: ", dp_arr)

		max_sum := max(dp_arr[N-1][0], dp_arr[N-1][1])
		max_sum = max(max_sum, dp_arr[N-1][2])
		fmt.Println(max_sum)

	}
}

func max(a, b int64) int64 {
	return int64(math.Max(float64(a), float64(b)))
}

package main

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

var (
	inn = bufio.NewScanner(os.Stdin)
	out = bufio.NewWriter(os.Stdout)
)

func main() {
	defer out.Flush()
	inn.Buffer([]byte{}, 10000000)
	inn.Split(bufio.ScanWords)
	//prep
	for tt := rd(); tt > 0; tt-- {
		n := rd()
		a := make([]int64, n)
		for i := range a {
			a[i] = rdint64()
		}
		var sum int64
		for i := 0; i < n; i += 2 {
			sum += a[i]
		}
		var cur, mx int64
		for i := 1; i < n; i += 2 {
			cur = maxint64(cur+a[i]-a[i-1], a[i]-a[i-1])
			mx = maxint64(mx, cur)
		}
		cur = 0
		for i := 2; i < n; i += 2 {
			cur = maxint64(cur+a[i-1]-a[i], a[i-1]-a[i])
			mx = maxint64(cur, mx)
		}
		Fprintln(out, sum+mx)
	}
}

//-------------------template------------------
func gcd(a, b int) int {
	for b != 0 {
		a, b = b, a%b
	}
	return a
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}
func maxint64(a, b int64) int64 {
	if a > b {
		return a
	}
	return b
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func minint64(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}
func rd() (x int) {
	inn.Scan()
	x, _ = strconv.Atoi(string(inn.Bytes()))
	return x
}
func rdint64() (x int64) {
	inn.Scan()
	x, _ = strconv.ParseInt(string(inn.Bytes()), 10, 64)
	return x
}
func rds() string {
	inn.Scan()
	return string(inn.Bytes())
}

package main

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

func main() {
	t := NextInt()
	for t > 0 {
		t--

		n := NextInt()
		a := make([]int64, n)

		sum := int64(0)
		for i := 0; i < n; i++ {
			a[i] = int64(NextInt())
			if i % 2 == 0 {
				sum += int64(a[i])
			}
		}

		s1 := int64(0)
		s2 := int64(0)
		minSum1 := int64(0)
		maxSum1 := int64(0)
		minSum2 := int64(0)
		maxSum2 := int64(0)
		for i := 1; i < n; i += 2 {
			if i + 1 < n {
				s1 += a[i] - a[i+1]
				if s1 - minSum1 > maxSum1 {
					maxSum1 = s1 - minSum1
				}
				if s1 < minSum1 {
					minSum1 = s1
				}
			}
			s2 += a[i] - a[i-1]
			if s2 - minSum2 > maxSum2 {
				maxSum2 = s2 - minSum2
			}
			if s2 < minSum2 {
				minSum2 = s2
			}
		}

		ans := sum + maxSum1
		if sum + maxSum2 > ans {
			ans = sum + maxSum2
		}
		fmt.Println(ans)
	}
}

var sc = bufio.NewScanner(os.Stdin)

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

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

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

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

// --- In the name of Allah ---
package main
import "fmt"

func max( a int64, b int64)int64{
	if( a > b){
		return a;
	}else{
		return b;
	}
}
func main(){
	var t int;
	fmt.Scanln(&t);
	for ;t>0;t--{
		var n int;
		fmt.Scanln(&n);
		var array []int;
		var sum int64;
		for i:=0; i<n; i ++{
			var x int;
			fmt.Scanln(&x," ");
			if i % 2 == 0{
				sum += int64(x);
			}
			array = append(array, x);
		}
		var cnt, ans int64 =0, sum;
		for i:=0; i < n-1; i += 2{
			cnt -= int64(array[i]);
			cnt += int64(array[i+1]);
			if cnt < 0{
				cnt = 0;
			}
			ans = max( ans, sum + cnt );
		}
		cnt = 0;
		for i:=1; i < n-1; i +=2 {
			cnt += int64(array[i]);
			cnt -= int64(array[i+1]);
			if( cnt < 0 ){
				cnt = 0;
			}
			ans = max( ans, sum + cnt);
		}
		fmt.Println(ans);
	}

}

package main

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

func main() {
	var cases int
	fmt.Scanf("%d\n", &cases)
	reader := bufio.NewReader(os.Stdin)
	for i := 0; i < cases; i++ {
		line := readLine(reader)
		n, _ := strconv.ParseInt(string(line), 10, 64)
		line = readLine(reader)
		ans := strings.Split(string(line), " ")
		an := make([]int64, n)
		srcSum := int64(0)
		for j, ai := range ans {
			an[j], _ = strconv.ParseInt(ai, 10, 64)
			if j%2 == 0 {
				srcSum += an[j]
			}
		}
		if n == 1 {
			fmt.Println(an[0])
			continue
		}
		bn := make([]int64, n/2) // pairs
		cn := make([]int64, (n-1)/2)
		if n%2 == 0 {
			for i := int64(0); i < n; {
				bn[i/2] = an[i+1] - an[i]
				if i > 1 {
					cn[(i-1)/2] = an[i-1] - an[i]
				}
				i = i + 2
			}

		} else {
			start := int64(0)
			for ; start < n-1; {
				bn[start/2] = an[start+1] - an[start]
				if start > 1 {
					cn[(start-1) / 2] = an[start-1] - an[start]
				}
				start = start + 2
			}
		}
		// find max sum
		// fmt.Println(bn)
		max := findMax(bn)
		if n % 2 == 0 {
			maxcn := findMax(cn)
			if maxcn > max {
				max = maxcn
			}
		}
		fmt.Println(srcSum + max)
	}
}

func findMax(bn []int64) int64 {
	current := int64(0)
	max := int64(0)
	for j := 0; j < len(bn); j++ {
		current += bn[j]
		if current < 0 {
			current = 0
		} else if current > 0 {
			if current > max {
				max = current
			}
		}
	}
	return max
}

func readLine(reader *bufio.Reader) []byte {
	result := make([]byte, 0)
	for {
		s, isPrefix, err := reader.ReadLine()
		if err != nil {
			fmt.Printf("error=%+v\n", err)
			break
		}
		result = append(result, s...)
		if !isPrefix {
			break
		}
	}
	return result
}

package main

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

func main() {
	var cases int
	fmt.Scanf("%d\n", &cases)
	reader := bufio.NewReader(os.Stdin)
	for i := 0; i < cases; i++ {
		line := readLine(reader)
		n, _ := strconv.ParseInt(string(line), 10, 64)
		line = readLine(reader)
		ans := strings.Split(string(line), " ")
		an := make([]int64, n)
		srcSum := int64(0)
		for j, ai := range ans {
			an[j], _ = strconv.ParseInt(ai, 10, 64)
			if j%2 == 0 {
				srcSum += an[j]
			}
		}
		// fmt.Println(n, an)
		if n == 1 {
			fmt.Println(an[0])
			continue
		}
		bn := make([]int64, n/2) // pairs
		cn := make([]int64, (n-1)/2)
		if n%2 == 0 {
			for i := int64(0); i < n; {
				bn[i/2] = an[i+1] - an[i]
				if i > 1 {
					cn[(i-1)/2] = an[i-1] - an[i]
				}
				i = i + 2
			}

		} else {
			start := int64(0)
			if an[n-1] > an[0] {
				start = 1
			}
			for ; start < n-1; {
				// fmt.Println(start)
				bn[start/2] = an[start+1] - an[start]
				start = start + 2
			}
		}
		// find max sum
		// fmt.Println(bn)
		max := findMax(bn)
		if n % 2 == 0 {
			maxcn := findMax(cn)
			if maxcn > max {
				max = maxcn
			}
		}
		fmt.Println(srcSum + max)
	}
}

func findMax(bn []int64) int64 {
	current := int64(0)
	max := int64(0)
	for j := 0; j < len(bn); j++ {
		current += bn[j]
		if current < 0 {
			current = 0
		} else if current > 0 {
			if current > max {
				max = current
			}
		}
	}
	return max
}

func readLine(reader *bufio.Reader) []byte {
	result := make([]byte, 0)
	for {
		s, isPrefix, err := reader.ReadLine()
		if err != nil {
			fmt.Printf("error=%+v\n", err)
			break
		}
		result = append(result, s...)
		if !isPrefix {
			break
		}
	}
	return result
}

package main

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

func main() {
	var cases int
	fmt.Scanf("%d\n", &cases)
	reader := bufio.NewReader(os.Stdin)
	for i := 0; i < cases; i++ {
		line := readLine(reader)
		n, _ := strconv.ParseInt(string(line), 10, 64)
		line = readLine(reader)
		ans := strings.Split(string(line), " ")
		an := make([]int64, n)
		srcSum := int64(0)
		for j, ai := range ans {
			an[j], _ = strconv.ParseInt(ai, 10, 64)
			if j%2 == 0 {
				srcSum += an[j]
			}
		}
		if n == 1 {
			fmt.Println(an[0])
			continue
		}
		bn := make([]int64, n/2) // pairs
		cn := make([]int64, (n-1)/2)
		if n%2 == 0 {
			for i := int64(0); i < n; {
				bn[i/2] = an[i+1] - an[i]
				if i > 1 {
					cn[(i-1)/2] = an[i-1] - an[i]
				}
				i = i + 2
			}

		} else {
			start := int64(0)
			for ; start < n-1; {
				bn[start/2] = an[start+1] - an[start]
				if start > 1 {
					cn[(start-1)/2] = an[start-1] - an[start]
				}
				start = start + 2
			}
		}
		// find max sum
		// fmt.Println(bn)
		// fmt.Println(cn)
		// fmt.Println(srcSum)
		max := findMax(bn)
		maxcn := findMax(cn)
		if maxcn > max {
			max = maxcn
		}

		fmt.Println(srcSum + max)
	}
}

func findMax(bn []int64) int64 {
	current := int64(0)
	max := int64(0)
	for j := 0; j < len(bn); j++ {
		current += bn[j]
		if current < 0 {
			current = 0
		} else if current > 0 {
			if current > max {
				max = current
			}
		}
	}
	return max
}

func readLine(reader *bufio.Reader) []byte {
	result := make([]byte, 0)
	for {
		s, isPrefix, err := reader.ReadLine()
		if err != nil {
			fmt.Printf("error=%+v\n", err)
			break
		}
		result = append(result, s...)
		if !isPrefix {
			break
		}
	}
	return result
}

/**
https://codeforces.com/contest/1373/problem/D
**/

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	line1, _ := reader.ReadString('\n')
	line1_arr := strings.Fields(line1)
	//fmt.Println(line1_arr)
	T, _ := strconv.Atoi(line1_arr[0])
	// fmt.Println("T:", T)
	for t := 0; t < T; t++ {
		line2, _ := reader.ReadString('\n')
		line2_arr := strings.Fields(line2)
		N, _ := strconv.Atoi(line2_arr[0])
		// fmt.Println("N: ", N)
		line3, _ := reader.ReadString('\n')
		//fmt.Println("line3: ", line3)
		line3_arr := strings.Fields(line3)
		A := make([]int, N)
		for n := 0; n < N; n++ {
			v, _ := strconv.Atoi(line3_arr[n])
			A[n] = v
		}

		if N == 1 {
			fmt.Println(A[0])
			continue
		}
		//fmt.Println("A: ", A)

		// Approach as per
		// https://codeforces.com/blog/entry/79376
		dp_arr := make([][]int, N)
		for i := 0; i < N; i++ {
			dp_arr[i] = make([]int, 3)
		}
		dp_arr[0][0] = A[0] // even
		dp_arr[0][1] = 0 // even
		dp_arr[0][2] = A[0] // even

		dp_arr[1][0] = A[0] // even
		dp_arr[1][1] = A[1] // even
		dp_arr[1][2] = A[0] // even

		for j := 0; j < 3; j++ {
			for i := 2; i < N; i++ {
				max_1_2 := max(dp_arr[i-2][0], dp_arr[i-2][1])
				max_1_2_3 := max(max(dp_arr[i-1][0], dp_arr[i-1][1]), dp_arr[i-1][2])
				if i%2 == 0 {
					dp_arr[i][0] = dp_arr[i-1][0] + A[i]
					dp_arr[i][1] = max_1_2 + A[i-1]
					dp_arr[i][2] = max_1_2_3 + A[i]
				} else {
					dp_arr[i][0] = dp_arr[i-1][0]
					dp_arr[i][1] = max_1_2 + A[i]
					dp_arr[i][2] = max_1_2_3
				}
			}
		}

		//fmt.Println("dp_arr: ", dp_arr)

		max_sum := max(dp_arr[N-1][0], dp_arr[N-1][1])
		max_sum = max(max_sum, dp_arr[N-1][2])
		fmt.Println(max_sum)

	}
}

func max(a, b int) int {
	return int(math.Max(float64(a), float64(b)))
}


package main

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

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

	digitCount := 0
	if scanner.Scan() {
		line := scanner.Text()

		fmt.Sscanf(line, "%d", &digitCount)
	}

	if scanner.Scan() {
		line := scanner.Text()

		output := ""
		for i, r := range line {
			output += string(r)
			if i%2 == 1 && i != digitCount-2 && i != digitCount-1 {
				output += "-"
			}
		}
		fmt.Println(output)
	}
}

// 25B
package main

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

func main() {
	var i, n int
	in := bufio.NewScanner(os.Stdin)
	in.Split(bufio.ScanWords)
	fmt.Scan(&n)
	s := make([]byte, n)
	in.Scan()
	s = in.Bytes()
	for i = 0; i < n; i++ {
		fmt.Print(string(s[i]))
		if i%2 != 0 && i < n-2 {
			fmt.Print("-")
		}
	}
}

// 25B-mic
package main

import (
	"fmt"
)

func main() {
	var s string
	var n, k, i, j int
	fmt.Scan(&n)
	fmt.Scan(&s)
	if n%2 == 0 {
		for i = 0; i < n; i++ {
			fmt.Print(string(s[i]))
			k++
			if k == 2 && i != n-1 {
				fmt.Print("-")
				k = 0
			}
		}
	} else {
		for i = 0; i < n-3; i++ {
			fmt.Print(string(s[i]))
			k++
			if k == 2 {
				fmt.Print("-")
				k = 0
			}
		}
		for j = i; j < n; j++ {
			fmt.Print(string(s[j]))

		}
	}
	fmt.Println()
}

package main

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

var r *bufio.Reader = bufio.NewReader(os.Stdin)
var w *bufio.Writer = bufio.NewWriter(os.Stdout)

func main() {
        defer w.Flush()

        var n int
        var s string
        fmt.Fscanf(r, "%d\n", &n)
        fmt.Fscanf(r, "%s\n", &s)
        var ans strings.Builder
        var i int
        if n % 2 == 0 {
                ans.WriteString(s[:2])
                i = 2
        } else {
                ans.WriteString(s[:3])
                i = 3
        }
        for ; i < n - 1; i += 2 {
                ans.WriteString("-" + s[i:i+2])
        }
        fmt.Fprintf(w, "%v", ans.String())
}

package main

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

func dsuGet(p []int, v int) int {
	if v == p[v] {
		return v
	}
	p[v] = dsuGet(p, p[v])
	return p[v]
}

func dsuUnite(p []int, a, b int) {
	a = dsuGet(p, a)
	b = dsuGet(p, b)
	if rand.Int() & 1 == 1 {
		a, b = b, a
	}
	if a != b {
		p[a] = b
	}
}

func main() {

	//stdin, err := os.Open("file.in")
	//if err != nil {
	//	panic(err)
	//}
	//defer stdin.Close()
	stdin := os.Stdin
	reader := bufio.NewReaderSize(stdin, 1024*1024)

	//stdout, err := os.Create("file.out")
	//if err != nil {
	//	panic(err)
	//}
	//defer stdout.Close()
	stdout := os.Stdout
	writer := bufio.NewWriterSize(stdout, 1024*1024)

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

	var s string
	fmt.Fscanf(reader, "%s\n", &s)

	for len(s) > 0 {
		if len(s) % 3 == 2 || len(s) % 3 == 1 {
			fmt.Fprintf(writer, "%s", s[0:2])
			s = s[2:]
		} else {
			fmt.Fprintf(writer, "%s", s[0:3])
			s = s[3:]
		}
		if len(s) > 0 {
			fmt.Fprintf(writer, "-")
		}
	}

	writer.Flush()
}

package main

import (
	"fmt"
	"io/ioutil"
	"bytes"
	"os"
)

func main() {
	bs, _ := ioutil.ReadAll(os.Stdin)
	reader := bytes.NewBuffer(bs)

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

	digits := []byte(s)
	for ;; {
		if len(digits) <= 3 {
			fmt.Printf("%s", string(digits))
			return
		} else {
			fmt.Printf("%s-", string(digits[:2]))
			digits = digits[2:]
		}
	}
}

package main

import "os"
import "bufio"
import "strconv"

func main(){
	var n int
	var num string
	r := bufio.NewScanner(os.Stdin)
	r.Split(bufio.ScanWords)
	w := bufio.NewWriter(os.Stdout)
	r.Scan()
	n, _ = strconv.Atoi(r.Text())
	r.Scan()
	num = r.Text()
	for i:=0; i<n; i++ {
		w.WriteString(string(num[i]))
		if i%2 != 0 && i < n-(n%2)-2  {
			w.WriteString("-")
		}
	}
	w.WriteString("\n")
	w.Flush()
}

package main

import (
	"fmt"
)

func main() {

	var (
		lo, i     int32
		orig, ans string
	)

	fmt.Scan(&lo)
	fmt.Scan(&orig)
	if lo < 4 {
		ans = orig
	} else {
		if lo%2 > 0 {
			ans = orig[0:3]
			i = 3
		} else {
			ans = orig[0:2]
			i = 2
		}
		for i < lo {
			ans += "-"
			ans += orig[i : i+2]
			i += 2
		}
	}

	fmt.Println(ans)
}

package main

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

func main() {
	z := bufio.NewScanner(os.Stdin)
	z.Scan()
	z.Scan()
	s := z.Text()
	initial, recurrent := 0,0
	switch {
	case len(s)%3 == 0:
		initial, recurrent = 3, 3
		break
	case len(s)%2 == 0:
		initial, recurrent = 2, 2
		break
	default:
		initial, recurrent = 3, 2
		break
	}

	fmt.Print(s[0:initial])
	for i := initial; i < len(s); i+=recurrent {
		fmt.Print("-" + s[i:i+recurrent])
	}
}

package main

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

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

	digitCount := 0
	if scanner.Scan() {
		line := scanner.Text()

		fmt.Sscanf(line, "%d", &digitCount)
	}

	if scanner.Scan() {
		line := scanner.Text()

		output := ""
		for i, r := range line {
			output += string(r)
			if i%2 == 1 && i != digitCount-2 {
				output += "-"
			}
		}
		fmt.Println(output)
	}
}

// 25B
package main

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

func main() {
	var i, n int
	in := bufio.NewScanner(os.Stdin)
	in.Split(bufio.ScanWords)
	fmt.Scan(&n)
	s := make([]byte, n)
	in.Scan()
	s = in.Bytes()
	for i = 0; i < n; i++ {
		fmt.Print(s[i])
		if i%2 != 0 && i < n-2 {
			fmt.Print("-")
		}
	}
}


package main

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

// github.com/EndlessCheng/codeforces-go
type trieNode struct {
	son    [27]*trieNode
	val    int
}

type trie struct{ root *trieNode }

func (*trie) ord(c byte) byte { return c - 'a' }

func (t *trie) put(s []byte, val int) {
	o := t.root
	for _, c := range s {
		c = t.ord(c)
		if o.son[c] == nil {
			o.son[c] = &trieNode{}
		}
		o = o.son[c]
	}
	o.val = val
}

func (t *trie) get(s []byte) *trieNode {
	o := t.root
	for _, c := range s {
		o = o.son[t.ord(c)]
		if o == nil {
			return nil
		}
	}
	return o
}

func newTrie() *trie {
	return &trie{&trieNode{}}
}

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

	var n, m, k, mt int
	var s []byte
	Fscan(in, &n, &m, &k)
	t := newTrie()
	for i := 0; i < n; i++ {
		Fscan(in, &s)
		s = bytes.ReplaceAll(s, []byte{'_'}, []byte{'z' + 1})
		t.put(s, i)
	}

	var ids []int
	var f func(p int)
	f = func(p int) {
		if p == k {
			o := t.get(s)
			if o != nil {
				ids = append(ids, o.val)
			}
			return
		}
		f(p + 1)
		tmp := s[p]
		s[p] = 'z' + 1
		f(p + 1)
		s[p] = tmp
	}

	g := make([][]int, n)
	deg := make([]int, n)

	for i := 0; i < m; i++ {
		Fscan(in, &s, &mt)
		mt--

		ids = []int{}
		f(0)
		find := false
		for _, id := range ids {
			if id == mt {
				find = true
				break
			}
		}
		if !find {
			Fprintln(out, "NO")
			return
		}
		for _, id := range ids {
			if id != mt {
				g[mt] = append(g[mt], id)
				deg[id]++
			}
		}
	}

	orders := []int{}
	q := []int{}
	for i, d := range deg {
		if d == 0 {
			q = append(q, i)
		}
	}
	for len(q) > 0 {
		v := q[0]
		q = q[1:]
		orders = append(orders, v)
		for _, w := range g[v] {
			if deg[w]--; deg[w] == 0 {
				q = append(q, w)
			}
		}
	}

	if len(orders) < n {
		Fprintln(out, "NO")
		return
	}
	Fprintln(out, "YES")

	for _, v := range orders {
		Fprint(out, v+1, " ")
	}
}

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

package main

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

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

	var buf bytes.Buffer

	n, m, k := readThreeNums(reader)

	P := make([]string, n)
	for i := 0; i < n; i++ {
		P[i], _ = reader.ReadString('\n')
		P[i] = P[i][:k]
	}

	S := make([]string, m)
	T := make([]int, m)

	for i := 0; i < m; i++ {
		s, _ := reader.ReadBytes('\n')
		S[i] = string(s[:k])
		readInt(s, k+1, &T[i])
	}

	res := solve(k, P, S, T)

	if len(res) == 0 {
		fmt.Println("NO")
		return
	}
	buf.WriteString("YES\n")
	for i := 0; i < n; i++ {
		buf.WriteString(fmt.Sprintf("%d ", res[i]))
	}
	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
}

func solve(k int, P []string, S []string, T []int) []int {
	K := 1 << k
	ii := make([]*Node, K)

	for i := 0; i < K; i++ {
		ii[i] = new(Node)
	}
	var buf bytes.Buffer
	for i := 0; i < len(P); i++ {
		cur := P[i]
		var mask int
		for j := 0; j < k; j++ {
			if cur[j] == '_' {
				mask |= 1 << j
			} else {
				buf.WriteByte(cur[j])
			}
		}
		AddString(ii[mask], buf.String(), i)
		buf.Reset()
	}

	n := len(P)
	que := make([]int, n)
	// at most K * n edges, when each mask contains all node
	var all int

	for i := 0; i < len(S); i++ {
		// lets enumerate the masks
		var p int
		for mask := 0; mask < K; mask++ {
			for j := 0; j < k; j++ {
				if (mask>>j)&1 == 0 {
					//should be same
					buf.WriteByte(S[i][j])
				}
			}
			res := Search(ii[mask], buf.String())
			buf.Reset()
			if len(res) > 0 {
				copy(que[p:], res)
				p += len(res)
			}
		}
		if p == 0 {
			return nil
		}
		all += p - 1
	}

	g := NewGraph(n, all)

	for i := 0; i < len(S); i++ {
		// lets enumerate the masks
		var p int
		for mask := 0; mask < K; mask++ {
			for j := 0; j < k; j++ {
				if (mask>>j)&1 == 0 {
					//should be same
					buf.WriteByte(S[i][j])
				}
			}
			res := Search(ii[mask], buf.String())
			buf.Reset()
			if len(res) > 0 {
				copy(que[p:], res)
				p += len(res)
			}
		}

		// if not found T[i] return nil
		pivot := -1
		for j := 0; j < p; j++ {
			if que[j] == T[i]-1 {
				pivot = j
				break
			}
		}
		if pivot < 0 {
			return nil
		}
		for j := 0; j < p; j++ {
			if j == pivot {
				continue
			}
			g.AddEdge(que[pivot], que[j])
		}
	}
	vis := make([]int, n)
	res := make([]int, 0, n)
	var topo func(u int) bool
	topo = func(u int) bool {
		if vis[u] == 1 {
			return false
		}
		vis[u]++

		for i := g.nodes[u]; i > 0; i = g.next[i] {
			v := g.to[i]
			if vis[v] == 2 {
				continue
			}
			if !topo(v) {
				return false
			}
		}
		vis[u]++
		res = append(res, u+1)
		return true
	}

	for i := 0; i < n; i++ {
		if vis[i] == 0 {
			if !topo(i) {
				return nil
			}
		}
	}

	reverse(res)

	return res
}

func reverse(arr []int) {
	for i, j := 0, len(arr)-1; i < j; i, j = i+1, j-1 {
		arr[i], arr[j] = arr[j], arr[i]
	}
}

type Graph struct {
	nodes []int
	next  []int
	to    []int
	cur   int
}

func NewGraph(n int, e int) *Graph {
	nodes := make([]int, n)
	next := make([]int, e+10)
	to := make([]int, e+10)
	cur := 1
	return &Graph{nodes, next, to, cur}
}

func (g *Graph) AddEdge(u, v int) {
	g.cur++
	g.next[g.cur] = g.nodes[u]
	g.nodes[u] = g.cur
	g.to[g.cur] = v
}

type Node struct {
	children [26]*Node
	pos      []int
}

func AddString(root *Node, s string, p int) {
	node := root
	for i := 0; i < len(s); i++ {
		x := int(s[i] - 'a')
		if node.children[x] == nil {
			node.children[x] = new(Node)
		}
		node = node.children[x]
	}
	if node.pos == nil {
		node.pos = make([]int, 0, 2)
	}
	node.pos = append(node.pos, p)
}

func Search(root *Node, s string) []int {
	node := root
	for i := 0; i < len(s); i++ {
		x := int(s[i] - 'a')
		if node.children[x] == nil {
			return nil
		}
		node = node.children[x]
	}
	return node.pos
}

package main

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

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

	var n, m, k, v int
	Fscan(in, &n, &m, &k)
	mp := make(map[string]int, n)
	for i := 1; i <= n; i++ {
		var s string
		Fscan(in, &s)
		mp[s] = i
	}

	var s []byte
	var ids []int
	var f func(p int)
	f = func(p int) {
		if p == k {
			if id := mp[string(s)]; id > 0 {
				ids = append(ids, id-1)
			}
			return
		}
		f(p + 1)
		tmp := s[p]
		s[p] = '_'
		f(p + 1)
		s[p] = tmp
	}

	g := make([][]int, n)
	deg := make([]int, n)
o:
	for i := 0; i < m; i++ {
		Fscan(in, &s, &v)
		v--
		ids = []int{}
		f(0)
		for _, id := range ids {
			if id == v {
				for _, w := range ids {
					if w != v {
						g[v] = append(g[v], w)
						deg[w]++
					}
				}
				continue o
			}
		}
		Fprintln(out, "NO")
		return
	}

	ans := []int{}
	q := []int{}
	for i, d := range deg {
		if d == 0 {
			q = append(q, i)
		}
	}
	for len(q) > 0 {
		v := q[0]
		q = q[1:]
		ans = append(ans, v)
		for _, w := range g[v] {
			if deg[w]--; deg[w] == 0 {
				q = append(q, w)
			}
		}
	}

	if len(ans) < n {
		Fprint(out, "NO")
		return
	}
	Fprintln(out, "YES")
	for _, v := range ans {
		Fprint(out, v+1, " ")
	}
}

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


// Турба го в Го
package main

import (
	"fmt"
)

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

func main() {
	var (
		n, i, j, minp int
		p             [50]int
		f             bool
	)
	fmt.Scanf("%d", &n)
	for i = 0; i < n; i++ {
		for p[i], j = 0, 0; j < n; j++ {
			fmt.Scan(&minp)
			p[i] = max(p[i], minp)
		}

	}
	for i, f = 0, true; i < n; i++ {
		if p[i] == n-1 && f {
			p[i], f = p[i]+1, false
		}
		fmt.Printf("%d ", p[i])
	}
	fmt.Printf("\n")
}

package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	a := make([][]int, n)
	for i := range a {
		a[i] = make([]int, n)
		for j := range a[i] {
			fmt.Scan(&a[i][j])
		}
	}
	res := make([]int, n)
	for c := 1; c < n - 1; c++ {
		for i := range a {
			if res[i] != 0 {
				continue
			}
			good := true
			for _, v := range a[i] {
				if v > c {
					good = false
					break
				}
			}
			if good {
				res[i] = c
				break
			}
		}
	}
	next := n - 1
	for i := range res {
		if res[i] == 0 {
			res[i] = next
			next++
		}
	}
	for i := range res {
		fmt.Print(res[i])
		if i+1 == n {
			fmt.Println()
		} else {
			fmt.Print(" ")
		}
	}
}

package main

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

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

func main() {
	defer out.Flush()
	var n int
	fmt.Fscan(in, &n)
	a := make([][]int, n)
	for i, _ := range a {
		a[i] = make([]int, n)
		for j, _ := range a[i] {
			fmt.Fscan(in, &a[i][j])
		}
	}
	ans := make([]int, n)
	nPos := 0
	for i, _ := range a {
		for x := 1; x <= n; x++ {
			xCount := 0
			for j, _ := range a[i] {
				if a[i][j] == x {
					xCount++
				}
			}
			if xCount == n-x {
				ans[i] = x
				if x == n-1 {
					nPos = i
				}
				break
			}
		}
	}
	ans[nPos] = n
	for i, x := range ans {
		if i != 0 {
			fmt.Fprint(out, " ")
		}
		fmt.Fprint(out, x)
	}
	fmt.Fprintln(out)
}

// Турба го в Го
package main

import (
	"fmt"
)

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

func main() {
	var (
		n, i, j, minp int
		p             [50]int
		f             bool
	)
	fmt.Scanf("%d", &n)
	for i = 0; i < n; i++ {
		for p[i], j = 0, 0; j < n; j++ {
			fmt.Scanf("%d", &minp)
			p[i] = max(p[i], minp)
		}
	}
	for i, f = 0, true; i < n; i++ {
		if p[i] == n-1 && f {
			p[i], f = p[i]+1, false
		}
		fmt.Printf("%d ", p[i])
	}
	fmt.Printf("\n")
}

package main

import (
	"bufio"
	"os"
)

var in = bufio.NewScanner(os.Stdin)

func readInt() int64 {
	if !in.Scan() {
		panic(in.Err())
	}
	res := int64(0)
	for _, b := range in.Bytes() {
		res = res*10 + int64(b-'0')
	}
	return res
}

func readString() string {
	if !in.Scan() {
		panic(in.Err())
	}
	return in.Text()
}

func main() {
	in.Split(bufio.ScanWords)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
}


package main

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

var (
	reader = bufio.NewReader(os.Stdin)
)

func ToBit(s string) (b int) {
	for _, c := range s {
		b |= 1 << uint(c-'a')
	}
	return
}

func main() {
	const m = 1 << 24
	var (
		n   int
		ans int
		f   = make([]int, m)
	)

	fmt.Fscan(reader, &n)
	for i := 0; i < n; i++ {
		var s string
		fmt.Fscan(reader, &s)
		b := ToBit(s)
		f[b]++
	}

	var k int
	for j := 2; j <= m; j *= 2 {
		sub := j / 2
		for i := 0; i < m; i += j {
			for k = 0; k < sub; k++ {
				f[i+k+sub] += f[i+k]
			}
		}
	}

	for i := 0; i < m; i++ {
		x := (n - f[i])
		ans ^= x * x
	}
	fmt.Println(ans)
}

package main

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

var (
	reader = bufio.NewReader(os.Stdin)
)

func ToBit(s string) (b int) {
	for _, c := range s {
		b |= 1 << uint(c-'a')
	}
	return
}

func main() {
	const m = 1 << 24
	var (
		n   int
		ans int
		f   = make([]int, m)
	)

	fmt.Fscan(reader, &n)
	for i := 0; i < n; i++ {
		var s string
		fmt.Fscan(reader, &s)
		b := ToBit(s)
		f[b]++
	}

	for j := 2; j <= m; j *= 2 {
		sub := j / 2
		for i := 0; i < m; i += j {
			for k := 0; k < sub; k++ {
				f[i+k+sub] += f[i+k]
			}
		}
	}

	for i := 0; i < m; i++ {
		x := (n - f[i])
		ans ^= x * x
	}
	fmt.Println(ans)
}

package main

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

var (
	reader = bufio.NewReader(os.Stdin)
)

func ToBit(s string) (b int) {
	for _, c := range s {
		b |= 1 << uint(c-'a')
	}
	return
}

func main() {
	var (
		n   int
		ans int
		f   = make([]int, 1<<24)
	)

	fmt.Fscan(reader, &n)
	for i := 0; i < n; i++ {
		var s string
		fmt.Fscan(reader, &s)
		b := ToBit(s)

		for j := b; j > 0; j = (j - 1) & b {
			if ones := strings.Count(strconv.FormatInt(int64(j), 2), "1"); ones%2 == 1 {
				f[j]++
			} else {
				f[j]--
			}
		}
	}

	for j := uint(0); j < 24; j++ {
		for i := 1; i < (1 << 24); i++ {
			if i>>j&1 != 0 {
				f[i] += f[i-(1<<j)]
			}
		}
	}

	for i := 1; i < (1 << 24); i++ {
		ans ^= f[i] * f[i]
	}
	fmt.Println(ans)
}

package main

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

var (
	reader = bufio.NewReader(os.Stdin)
)

func ToBit(s string) (b int) {
	for _, c := range s {
		b |= 1 << uint(c-'a')
	}
	return
}

func main() {
	var (
		n int
	)

	fmt.Fscan(reader, &n)
	dict := make([]int, n)
	for i := 0; i < n; i++ {
		var s string
		fmt.Fscan(reader, &s)
		dict[i] = ToBit(s)
	}

	ans := 0
	for i := 0; i < (1 << 24); i++ {
		s := 0
		for _, j := range dict {
			if (i & j) != 0 {
				s++
			}
		}
		ans ^= s
	}
	fmt.Println(ans)
}


package main

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

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

	var T, n, m, x int
	for Fscan(in, &T); T > 0; T-- {
		Fscan(in, &n, &m, &x, &x)
		Fprintln(out, 1, 1, n, m)
	}
}

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

package main

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

func main() {
    reader := bufio.NewReader(os.Stdin)
    input, _ := reader.ReadString('\n')

	// Get t
	t, _ := GetInt(input)

	for i:=0; i<t; i++ {
		// Get n
		input, _ = reader.ReadString('\n')
		var n,m int
		n, input = GetInt(input)
		m, _ = GetInt(input)

		fmt.Printf("1 1 %d %d\n", n, m)

	}
}

// func abs(val float64) float64 {
//     if val >= 0.0 {
//         return val
//     }
//     return -val
// }

func GetInt(s string) (result int, output string) {
	iter, n := 0, len(s)
	for iter < n && s[iter] >= '0' && s[iter] <= '9' {
		iter++
	}
	result, _ = strconv.Atoi(s[:iter])
	// Skip the redundant characters
	for iter < n && (s[iter] < '0' || s[iter] > '9') {
		iter++
	}
	if iter == n {
		output = ""

	} else {
		output = s[iter:]
	}
	return
}

func GetInt64(s string) (result int64, output string) {
	iter, n := 0, len(s)
	for iter < n && s[iter] >= '0' && s[iter] <= '9' {
		iter++
	}
	result, _ = strconv.ParseInt(s[:iter], 10, 64)
	// Skip the redundant characters
	for iter < n && (s[iter] < '0' || s[iter] > '9') {
		iter++
	}
	if iter == n {
		output = ""

	} else {
		output = s[iter:]
	}
	return
}

package main

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

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

	solve := func(Case int) {
		var n,m,x0,y0 int
		Fscan(in, &n, &m, &x0, &y0)
		Fprintln(out, 1,1,n,m)
	}

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

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

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

package main

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

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

	var t int
	fmt.Fscan(reader, &t)

	var n, m, i, j int

	for ; t > 0; t-- {
		fmt.Fscan(reader, &n, &m, &i, &j)
		fmt.Fprintln(writer, 1, 1, n, m)
	}
}

package main

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

var tc,n,m,a,b int64

func main() {
  var cin io.Reader = bufio.NewReader(os.Stdin)
  fmt.Fscan(cin, &tc)
  for tc>0{
    tc--
    var n,m int
    fmt.Fscan(cin, &n ,&m,&a,&b)
    fmt.Println(1,1,n,m)
  }
}

package main

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

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

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

    var t int

    fmt.Fscan(in, &t)

    type array []int

    for ; t > 0; t -= 1 {
        var n, m, x, y int
        fmt.Fscan(in, &n, &m, &x, &y)

        ax, ay, bx, by, ans := -1, -1, -1, -1, int64(-1)
        pos := []array{ { 1, 1 }, { n, 1 }, { 1, m }, { n, m } }

        for i := 0; i < 4; i += 1 {
            for j := 0; j < 4; j += 1 {
                if i == j {
                    continue
                }

                cur := abs(pos[i][0] - x) + abs(pos[i][1] - y) + abs(pos[i][0] - pos[j][0]) + abs(pos[i][1] - pos[j][1])

                if cur > ans {
                    ax, ay, bx, by = pos[i][0], pos[i][1], pos[j][0], pos[j][1]
                    ans = cur
                }
            }
        }

        fmt.Fprintln(out, ax, ay, bx, by)
    }
}

package main

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

func init() {
	log.SetFlags(0)
	log.SetOutput(ioutil.Discard)
}

func abs(v int64) int64 {
	if v > 0 {
		return v
	}
	return -v

}
func max(a ...int64) int64 {
	m := a[0]
	v := m
	for _, v = range a[1:] {
		if v > m {
			m = v
		}
	}
	return v
}

func solve(n, m, i, j int64) (x1, y1, x2, y2 int64) {
	log.Printf("params: %d %d %d %d\n", n, m, i, j)
	points := [][]int64{
		{1, 1},
		{1, m},
		{n, 1},
		{n, m},
	}

	var lala int64 = -1

	for haha, p1 := range points {
		for _, p2 := range points[haha+1:] {
			z := abs(i-p1[0]) + abs(j-p1[1]) + abs(i-p2[0]) + abs(j-p2[1]) + abs(p1[0]-p2[0]) + abs(p1[1]-p2[1])
			if z > lala {
				lala = z
				// log.Printf("     params: %d %d %d %d         %d\n", n, m, i, j, lala)
				x1, y1, x2, y2 = p1[0], p1[1], p2[0], p2[1]
			}
		}
	}
	return
}

func main() {
	log.Println("start")

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

	num := 0
	fmt.Fscan(in, &num)
	for i := 0; i < num; i++ {
		// a := make([]int, size)
		// for i := 0; i < size; i++ {
		// 	fmt.Fscan(in, &a[i])
		// }
		var n, m, i, j int64
		fmt.Fscan(in, &n, &m, &i, &j)

		x1, y1, x2, y2 := solve(n, m, i, j)
		fmt.Printf("%d %d %d %d\n", x1, y1, x2, y2)

		// z := 1000000000
		// log.Printf("z = %#v\n", z)
	}
	log.Println("__end__")
}

package main

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

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

	for tc := 0; tc < tcs; tc++ {
		var n, m, dummy int
		_, _ = fmt.Fscan(in, &n, &m, &dummy, &dummy)

		fmt.Printf("1 1 %d %d \n", n, m)
	}
}

// 1537B. Bad Boy
package main

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

func main() {
	var T int
	reader := bufio.NewReader(os.Stdin)
	fmt.Fscan(reader, &T)
	for t := 1; t <= T; t++ {
		var n, m, i, j int
		fmt.Fscan(reader, &n, &m, &i, &j)
		fmt.Println(1, 1, n, m)
	}
}

package main

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

type Cell struct {
	x, y, dist int
}

func dist(a, b Cell) int {
	return Abs(a.x-b.x) + Abs(a.y-b.y)
}

func Abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

func solve() {
	f := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)
	N, n, m, i, j := 0, 0, 0, 0, 0
	fmt.Fscan(f, &N)
	for k := 0; k < N; k++ {
		fmt.Fscan(f, &n, &m, &i, &j)
		corners := []Cell{{1, 1, 0}, {1, m, 0}, {n, 1, 0}, {n, m, 0}}
		for p := 0; p < 4; p++ {
			corners[p].dist = dist(corners[p], Cell{i, j, 0})
		}
		sort.Slice(corners, func(i, j int) bool { return corners[i].dist < corners[j].dist })
		fmt.Fprintln(w, corners[0].x, corners[0].y, corners[3].x, corners[3].y)
	}
	w.Flush()
}

func main() {
	solve()
}

package main

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

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

func solve(n, m, i, j int) string {
	return fmt.Sprintf("%d %d %d %d", 1, 1, n, m)
}

func main() {
	fmt.Fscan(reader, &t)
	for ; t > 0; t-- {
		fmt.Fscan(reader, &n, &m, &i, &j)
		fmt.Println(solve(n, m, i, j))
	}
}

package main

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

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

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

func process() {
	var x, y, i, j int
	scanf("%d %d %d %d\n", &x, &y, &i, &j)
	printf("1 %d %d 1\n", y, x)
}

func main() {
	defer writer.Flush()
	var t int
	scanf("%d\n", &t)
	// printf("%d\n", t)
	for i := 0; i < t; i++ {
		process()
	}
}

package main

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

type IO struct {
	in  io.Reader
	out io.Writer
}

func NewIO(in io.Reader, out io.Writer) *IO {
	return &IO{in: bufio.NewReader(in), out: bufio.NewWriter(out)}
}

func (io *IO) ReadInt() int64 {
	var res int64
	fmt.Fscanf(io.in, "%d\n", &res)
	return res
}

func (io *IO) ReadPairInt() (int64, int64) {
	var a, b int64
	fmt.Fscanf(io.in, "%d %d\n", &a, &b)
	return a, b
}

func (io *IO) ReadString() string {
	var res string
	fmt.Fscanf(io.in, "%s\n", &res)
	return res
}

func (io *IO) ReadIntSlice(n int) []int64 {
	var t int64
	res := make([]int64, 0, n)
	for i := 0; i < n; i++ {
		fmt.Fscanf(io.in, "%d", &t)
		res = append(res, t)
	}
	fmt.Fscanf(io.in, "\n")
	return res
}

type Point struct {
	x, y int64
}

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

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

func abs(v int64) int64 {
	if v < 0 {
		return -v
	}
	return v
}

func calcDist(from, to Point) int64 {
	return abs(from.x-to.x) + abs(from.y-to.y)
}

func main() {
	io := NewIO(os.Stdin, os.Stdout)
	for t := io.ReadInt(); t > 0; t-- {
		a := io.ReadIntSlice(4)
		from := Point{a[2], a[3]}
		nowp1, nowp2 := from, from
		points := []Point{
			{1, 1},
			{a[0], 1},
			{1, a[1]},
			{a[0], a[1]},
		}
		for _, p1 := range points {
			for _, p2 := range points {
				if p1 == p2 {
					continue
				}
				nn := calcDist(from, p1) + calcDist(from, p2) + calcDist(p1, p2)
				if nn > calcDist(from, nowp1) + calcDist(from, nowp2) + calcDist(nowp1, nowp2) {
					nowp1, nowp2 = p1, p2
				}
			}
		}
		fmt.Fprintln(os.Stdout, nowp1.x, nowp1.y, nowp2.x, nowp2.y)
	}
}

package main

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

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

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

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

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

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

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

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

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

		}
		return initial
	}
}

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

	}
	return m
}

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

func PrimeFactorization(n int) (pfs map[int]int) {
	pfs = make(map[int]int)

	// Get the number of 2s that divide n
	for n%2 == 0 {
		if _, ok := pfs[2]; ok {
			pfs[2] += 1
		} else {
			pfs[2] = 1
		}
		n = n / 2
	}

	// n must be odd at this point. so we can skip one element
	// (note i = i + 2)
	for i := 3; i*i <= n; i = i + 2 {
		// while i divides n, append i and divide n
		for n%i == 0 {
			if _, ok := pfs[i]; ok {
				pfs[i] += 1
			} else {
				pfs[i] = 1
			}
			n = n / i
		}
	}

	// This condition is to handle the case when n is a prime number
	// greater than 2
	if n > 2 {
		pfs[n] = 1
	}

	return
}

func NumberOfDivisors(n int) int {
	pfs := PrimeFactorization(n)

	num := 1
	for _, exponents := range pfs {
		num *= (exponents + 1)
	}

	return num
}

func KthPrime(x int) (y int) {
	if x == 1 {
		y = 2
	}
	if x == 2 {
		y = 3
	}
	if x > 2 {
		var sum int = 2
		begin := 5
		for sum < x+1 {
			if IsItPrime(begin) == true {
				sum++
			}
			if sum == x {
				y = begin
				break
			} else {
				if begin%6 == 1 {
					begin = begin + 4
				} else {
					begin = begin + 2
				}
			}
		}
	}
	return
}

var t int

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

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

		if n == 1 {
			fmt.Println(1)
			fmt.Println(1)
			fmt.Println(1)
			fmt.Println(m)

		} else {
			if m == 1 {
				fmt.Println(1)
				fmt.Println(1)
				fmt.Println(n)
				fmt.Println(1)
			} else {
				fmt.Println(n)
				fmt.Println(1)
				fmt.Println(1)
				fmt.Println(m)
			}
		}

	}

}

package main

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

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

	var t int
	fmt.Fscan(reader, &t)

	var n, m, i, j int
	for ; t > 0; t-- {
		fmt.Fscan(reader, &n, &m, &i, &j)

		if i == 1 {
			fmt.Fprintln(writer, n, 1, n, m)
		} else if j == 1 {
			fmt.Fprintln(writer, 1, m, n, m)
		} else if i == n {
			fmt.Fprintln(writer, 1, 1, 1, m)
		} else if j == m {
			fmt.Fprintln(writer, 1, 1, n, 1)
		} else {
			fmt.Fprintln(writer, n, 1, 1, m)
		}
	}
}

package main

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

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

	var t int

	fmt.Fscan(r, &t)

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

		var n, m, i, j int

		fmt.Fscan(r, &n, &m, &i, &j)

		fmt.Println(solve(n, m, i, j))
	}
}

func solve(n, m, i, j int) (int, int, int, int) {

	var x1, x2, y1, y2 int

	if n - i > i - 1 {
		x1 = n
	} else {
		x1 = 1
	}
	if m - j > j - 1 {
		y1 = m
	} else {
		y1 = 1
	}

	if n - x1 > x1 - 1 {
		x2 = n
	} else {
		x2 = 1
	}

	if m - y1 > y1 - 1 {
		y2 = m
	}  else {
		y2 = 1
	}

	return x1, y1, x2, y2
}

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

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

package main

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

func main() {
    reader := bufio.NewReader(os.Stdin)
    input, _ := reader.ReadString('\n')

	// Get t
	t, _ := GetInt(input)

	for i:=0; i<t; i++ {
		// Get n
		input, _ = reader.ReadString('\n')
		var n,m,row,col int
		n, input = GetInt(input)
		m, input = GetInt(input)
		row, input = GetInt(input)
		col, _ = GetInt(input)

		x, distance_a := 0, 0
		if row - 1 > n - row {
			x = 1
			distance_a = row * 2 + m * 2

		} else {
			x = n
			distance_a = (n-row+1) * 2 + m * 2
		}
		// fmt.Printf("%d %d %d %d\n", x, 1, x, m)
		y, distance_b := 0, 0
		if col - 1 > m - col {
			y = 1
			distance_b = col * 2 + n * 2

		} else {
			y = m
			distance_b = (m-col+1) * 2 + n * 2
		}
		// fmt.Printf("%d %d %d %d\n", 1, y, n, y)
		if distance_a > distance_b {
			fmt.Printf("%d %d %d %d\n", x, 1, x, m)

		} else {
			fmt.Printf("%d %d %d %d\n", 1, y, n, y)
		}

	}
}

// func abs(val float64) float64 {
//     if val >= 0.0 {
//         return val
//     }
//     return -val
// }

func GetInt(s string) (result int, output string) {
	iter, n := 0, len(s)
	for iter < n && s[iter] >= '0' && s[iter] <= '9' {
		iter++
	}
	result, _ = strconv.Atoi(s[:iter])
	// Skip the redundant characters
	for iter < n && (s[iter] < '0' || s[iter] > '9') {
		iter++
	}
	if iter == n {
		output = ""

	} else {
		output = s[iter:]
	}
	return
}

func GetInt64(s string) (result int64, output string) {
	iter, n := 0, len(s)
	for iter < n && s[iter] >= '0' && s[iter] <= '9' {
		iter++
	}
	result, _ = strconv.ParseInt(s[:iter], 10, 64)
	// Skip the redundant characters
	for iter < n && (s[iter] < '0' || s[iter] > '9') {
		iter++
	}
	if iter == n {
		output = ""

	} else {
		output = s[iter:]
	}
	return
}

package main

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

func main() {
    reader := bufio.NewReader(os.Stdin)
    input, _ := reader.ReadString('\n')

	// Get t
	t, _ := GetInt(input)

	for i:=0; i<t; i++ {
		// Get n
		input, _ = reader.ReadString('\n')
		var n,m,row,col int
		n, input = GetInt(input)
		m, input = GetInt(input)
		row, input = GetInt(input)
		col, _ = GetInt(input)

		if n < m {
			x := 0
			if row - 1 > n - row {
				x = 1

			} else {
				x = n
			}
			fmt.Printf("%d %d %d %d\n", x, 1, x, m)

		} else {
			y := 0
			if col - 1 > m - col {
				y = 1

			} else {
				y = m
			}
			fmt.Printf("%d %d %d %d\n", 1, y, n, y)
		}
	}
}

// func abs(val float64) float64 {
//     if val >= 0.0 {
//         return val
//     }
//     return -val
// }

func GetInt(s string) (result int, output string) {
	iter, n := 0, len(s)
	for iter < n && s[iter] >= '0' && s[iter] <= '9' {
		iter++
	}
	result, _ = strconv.Atoi(s[:iter])
	// Skip the redundant characters
	for iter < n && (s[iter] < '0' || s[iter] > '9') {
		iter++
	}
	if iter == n {
		output = ""

	} else {
		output = s[iter:]
	}
	return
}

func GetInt64(s string) (result int64, output string) {
	iter, n := 0, len(s)
	for iter < n && s[iter] >= '0' && s[iter] <= '9' {
		iter++
	}
	result, _ = strconv.ParseInt(s[:iter], 10, 64)
	// Skip the redundant characters
	for iter < n && (s[iter] < '0' || s[iter] > '9') {
		iter++
	}
	if iter == n {
		output = ""

	} else {
		output = s[iter:]
	}
	return
}

package main

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

var tc int64

func main() {
  var cin io.Reader = bufio.NewReader(os.Stdin)
  fmt.Fscan(cin, &tc)
  for tc>0{
    tc--
    var n,m int
    fmt.Fscan(cin, &n ,&m)
    fmt.Println(1,1,n,m)
  }
}

package main

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

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

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

    var t int

    fmt.Fscan(in, &t)

    type array []int

    for ; t > 0; t -= 1 {
        var n, m, x, y int
        fmt.Fscan(in, &n, &m, &x, &y)

        ax, ay, bx, by, ans := -1, -1, -1, -1, -1
        pos := []array{ { 1, 1 }, { n, 1 }, { 1, m }, { n, m } }

        for i := 0; i < 4; i += 1 {
            for j := 0; j < 4; j += 1 {
                if i == j {
                    continue
                }

                cur := abs(pos[i][0] - x) + abs(pos[i][1] - y) + abs(pos[i][0] - pos[j][0]) + abs(pos[i][1] - pos[j][1])

                if cur > ans {
                    ax, ay, bx, by = pos[i][0], pos[i][1], pos[j][0], pos[j][1]
                    ans = cur
                }
            }
        }

        fmt.Fprintln(out, ax, ay, bx, by)
    }
}

package main

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

func init() {
	log.SetFlags(0)
	log.SetOutput(ioutil.Discard)
}

func abs(v int64) int64 {
	if v > 0 {
		return v
	}
	return -v

}
func max(a ...int64) int64 {
	m := a[0]
	v := m
	for _, v = range a[1:] {
		if v > m {
			m = v
		}
	}
	return v
}

func solve(n, m, i, j int64) (x1, y1, x2, y2 int64) {
	log.Printf("params: %d %d %d %d\n", n, m, i, j)
	points := [][]int64{
		{1, 1},
		{1, m},
		{n, 1},
		{n, m},
	}
	var lala int64 = 0
	for haha, p1 := range points {
		for _, p2 := range points[haha+1:] {
			z := abs(i-p1[0]) + abs(j-p1[1]) + abs(i-p2[0]) + abs(j-p2[1])
			if z > lala {
				lala = z
				x1, y1, x2, y2 = p1[0], p1[1], p2[0], p2[1]
			}
		}
	}
	return
}

func main() {
	log.Println("start")

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

	num := 0
	fmt.Fscan(in, &num)
	for i := 0; i < num; i++ {
		// a := make([]int, size)
		// for i := 0; i < size; i++ {
		// 	fmt.Fscan(in, &a[i])
		// }
		var n, m, i, j int64
		fmt.Fscan(in, &n, &m, &i, &j)

		x1, y1, x2, y2 := solve(n, m, i, j)
		fmt.Printf("%d %d %d %d\n", x1, y1, x2, y2)

		// z := 1000000000
		// log.Printf("z = %#v\n", z)
	}
	log.Println("__end__")
}

package main

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

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

	for tc := 0; tc < tcs; tc++ {
		var n, m, dummy int
		_, _ = fmt.Fscan(in, &n, &m, dummy, dummy)

		fmt.Printf("1 1 %d %d \n", n, m)
	}
}