package main

import (
	"fmt"
	"math"
)

func main() {
	var t int64
	fmt.Scanf("%d\n", &t)
	for i := 0; int64(i) < t; i++ {
		var a, b, c int64
		fmt.Scanf("%d %d %d\n", &a, &b, &c)
		a--
		r := int64(math.Abs(float64(b-c))) + c - 1
		if r == a {
			fmt.Println(3)
		} else if r > a {
			fmt.Println(1)
		} else {
			fmt.Println(2)
		}
	}
}

package main

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

func main() {
	t := readInt64()
	for i := int64(0); i < t; i++ {
		arr := readArrInt64()
		a, b, c := arr[0], arr[1], arr[2]
		t1 := a - 1
		t2 := abs(b-c) + c - 1
		switch {
		case t1 < t2:
			fmt.Println(1)
			continue
		case t1 > t2:
			fmt.Println(2)
			continue
		case t1 == t2:
			fmt.Println(3)
			continue
		}
	}
}

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

var in = bufio.NewReader(os.Stdin)

func readInt64() int64 {
	nStr, _ := in.ReadString('\n')
	nStr = strings.ReplaceAll(nStr, "\r", "")
	nStr = strings.ReplaceAll(nStr, "\n", "")
	n, _ := strconv.ParseInt(nStr, 10, 64)
	return n
}

func readArrString() []string {
	line, _ := in.ReadString('\n')
	line = strings.ReplaceAll(line, "\r", "")
	line = strings.ReplaceAll(line, "\n", "")
	numbs := strings.Split(line, " ")
	return numbs
}

func readArrInt64() []int64 {
	numbs := readArrString()
	arr := make([]int64, len(numbs))
	for i, n := range numbs {
		val, _ := strconv.ParseInt(n, 10, 64)
		arr[i] = val
	}
	return arr
}

package main

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

func main() {
	f := bufio.NewWriter(os.Stdout)
	defer f.Flush()
	var t int64
	fmt.Scanf("%d\n", &t)
	var i int64
	for i = 0; i < t; i++ {
		var a, b, c int64
		fmt.Scanf("%d %d %d\n", &a, &b, &c)
		a--
		r := b - c
		if r < 0 {
			r = c - b
		}
		r = r + c - 1
		if r == a {
			f.Write([]byte("3\n"))
		} else if r > a {
			f.Write([]byte("1\n"))
		} else {
			f.Write([]byte("2\n"))
		}
	}
}

package main

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

func main() {
	var t int64
	fmt.Scanf("%d\n", &t)
	var i int64
	answer := new(bytes.Buffer)
	for i = 0; i < t; i++ {
		var a, b, c int64
		fmt.Scanf("%d %d %d\n", &a, &b, &c)
		a--
		r := b - c
		if r < 0 {
			r = c - b
		}
		r = r + c - 1
		if r == a {
			answer.WriteString("3\n")
		} else if r > a {
			answer.WriteString("1\n")
		} else {
			answer.WriteString("2\n")
		}
	}
	answer.WriteTo(os.Stdout)
}

package main

import (
	"fmt"
	"math"
)

func main() {
	var t float64
	fmt.Scanf("%f\n", &t)
	var i float64
	for i = 0; i < t; i++ {
		var a, b, c float64
		fmt.Scanf("%f %f %f\n", &a, &b, &c)
		a--
		r := math.Abs(b-c) + c - 1
		if r == a {
			fmt.Println(3)
		} else if r > a {
			fmt.Println(1)
		} else {
			fmt.Println(2)
		}
	}
}

package main
import(
    "fmt"
)
func main(){
	var t int
	fmt.Scan(&t)
	for i:=0;i<t;i++{
		var a,b,c int
		fmt.Scan(&a,&b,&c)
		if b >= c {
			if a-1 > b-1 {
				fmt.Println(2)
			} else if a-1 == b-1 {
				fmt.Println(3)
			} else {
				fmt.Println(1)
			}
		} else {
			if a-1 > ((c-b)*2)+ (b-1) {
				fmt.Println(2)
			} else if a-1 == ((c-b)*2)+ (b-1) {
				fmt.Println(3)
			} else {
				fmt.Println(1)
			}
		}
	}
}

package main

import (
	"fmt"
	"math"
)

func main() {
	var t int
	fmt.Scan(&t)
	for t > 0 {
		var a, b, c int
		fmt.Scan(&a, &b, &c)
		// fmt.Println(a,b,c)
		if a-1 < int(math.Abs(float64(c-b))+math.Abs(float64(c)-1)) {
			fmt.Println(1)
		} else if a-1 > int(math.Abs(float64(c-b))+math.Abs(float64(c)-1)) {
			fmt.Println(2)
		} else {
			fmt.Println(3)
		}
		t--
	}
}

// 1 2 1

package main

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

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

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

	var t, a, b, c int
	var time1, time2 int

	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {
		fmt.Fscan(r, &a, &b, &c)

		time1 = abs(a - 1)
		time2 = abs(b - c) + abs(c - 1)

		if time1 < time2 {
			fmt.Fprintln(w, 1)
		} else if time2 < time1 {
			fmt.Fprintln(w, 2)
		} else {
			fmt.Fprintln(w, 3)
		}
	}
}

package main

import (
	"fmt"
)

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

func main() {
	var t, a, b, c int
	var time1, time2 int

	_, _ = fmt.Scanln(&t)

	for i := 0; i < t; i++ {
		_, _ = fmt.Scanln(&a, &b, &c)

		time1 = abs(a - 1)
		time2 = abs(b - c) + abs(c - 1)

		if time1 < time2 {
			fmt.Println(1)
		} else if time2 < time1 {
			fmt.Println(2)
		} else {
			fmt.Println(3)
		}
	}
}

package main

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

func ScanInt(scanner *bufio.Scanner) int {
	if !scanner.Scan() {
		panic("nothing to scan")
	}
	str := scanner.Text()
	n, err := strconv.Atoi(str)
	if err != nil {
		panic(err)
	}
	return n
}

const whitespaceSymbols = "\t\n\v\f\r "

func splitFunc(data []byte, atEOF bool) (advance int, token []byte, err error) {
	if atEOF && len(data) == 0 {
		return 0, nil, nil
	}

	i := bytes.IndexAny(data, whitespaceSymbols)
	if i > 0 {
		return i + 1, data[:i], nil
	}
	if i == -1 {
		if atEOF {
			return len(data), data, nil
		}
		return 0, nil, nil
	}

	trimmed := bytes.TrimLeft(data, whitespaceSymbols)
	advance = len(data) - len(trimmed)
	if atEOF && len(trimmed) != 0 {
		trimmed = trimmed[:bytes.IndexAny(trimmed, whitespaceSymbols)]
		return advance + len(trimmed), trimmed, nil
	}
	return advance, nil, nil
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Buffer(nil, 1<<30)
	scanner.Split(splitFunc)
	t := ScanInt(scanner)
	for i := 0; i < t; i++ {
		a := ScanInt(scanner)
		b := ScanInt(scanner)
		c := ScanInt(scanner)
		if b > c {
			switch {
			case a < b:
				fmt.Println(1)
			case a == b:
				fmt.Println(3)
			default:
				fmt.Println(2)
			}
			continue
		}
		switch {
		case a-1 < c-b+c-1:
			fmt.Println(1)
		case a-1 == c-b+c-1:
			fmt.Println(3)
		default:
			fmt.Println(2)
		}
	}
}

package main

import (
	"fmt"
	"io/ioutil"
	"os"
	"strconv"
	"strings"
	"sync"
	"time"
)

func main() {
	data, _ := ioutil.ReadAll(os.Stdin)
	ctroki := strings.Split(string(data), "\r\n")
	n, _ := strconv.Atoi(ctroki[0])
	pos := 1

	var wg sync.WaitGroup
	wg.Add(n)
	ch := make(chan struct{})

	go func() {
		wg.Wait()
		close(ch)
	}()
	timeout := 5 * time.Second

	output := make([]string, n)
	for i := 0; i < n; i++ {
		if ctroki[pos] == "" {
			continue
		}
		go atomicTotal(&output[i], ctroki[pos], &wg)

		pos = pos + 1
	}
	select {
	case <-time.After(timeout):
		fmt.Println(strings.Join(output, "\n"))
	case <-ch:
		fmt.Println(strings.Join(output, "\n"))
	}

}

func atomicTotal(output *string, nabor string, wg *sync.WaitGroup) {
	defer wg.Done()
	arr := strings.Split(nabor, " ")

	n1 := atoi(arr[0])
	n2 := atoi(arr[1])
	n3 := atoi(arr[2])

	fst := n3 - n2
	if fst < 0 {
		fst *= -1
	}
	if n1 == 1 || fst+n3-1 > n1-1 {
		*output = fmt.Sprint(1)
	} else if fst+n3-1 < n1-1 {
		*output = fmt.Sprint(2)
	} else {
		*output = fmt.Sprint(3)
	}

}

func atoi(str string) int64 {
	var n int64
	for i := 0; i < len(str); i++ {
		var char byte = '0'
		s := str[i]
		c := 0
		for s != char {
			char++
			c++
		}
		n = n*10 + int64(c)
	}
	return n
}

package main

import (
	"fmt"
)

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

func main() {
	var N int;
	fmt.Scan(&N);

	for T := 0; T < N; T++ {
		var a, b, c int;
		fmt.Scan(&a, &b, &c);
		x := a - 1;
		y := abs(b - c) + c - 1;
		if (x < y) {
			fmt.Println(1);
		} else if (x > y) {
			fmt.Println(2);
		} else {
			fmt.Println(3);
		}
	}
}

// cf1729a project main.go
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 a, b, c int64
		fmt.Fscan(r, &a, &b, &c)
		var x int64 = 0
		if b > c {
			x = b
		} else {
			x = c + c - b
		}
		var r int64 = 3
		if a < x {
			r = 1
		} else if a > x {
			r = 2
		}
		fmt.Fprintln(w, r)
	}
}

package main

import "fmt"

func main() {

	var tc int

	fmt.Scan(&tc)

	for t := 1; t <= tc; t++ {
		var a, b, c int
		fmt.Scan(&a, &b, &c)
		if b < c {
			b = (c - b) + c
		}
		ans := 0
		if a < b {
			ans = 1
		}
		if a > b {
			ans = 2
		}
		if a == b {
			ans = 3
		}
		fmt.Println(ans)
	}

}

package main

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

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

////////////////////////////////////////////////

func solve() {
	a := ReadInt()
	b := ReadInt()
	c := ReadInt()

	x := a - 1
	y := Abs(b-c) + c - 1

	if x < y {
		Println(1)
	} else if x == y {
		Println(3)
	} else {
		Println(2)
	}
}

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

	t := 1
	t = ReadInt()

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

func ReadInt() int {
	var x int
	fmt.Fscan(in, &x)
	return x
}

func ReadInts(n int) []int {
	a := make([]int, n)
	for i, _ := range a {
		a[i] = ReadInt()
	}
	return a
}

func Print(a ...any) {
	fmt.Fprint(out, a...)
}

func Println(a ...any) {
	fmt.Fprintln(out, a...)
}

type IntPair struct {
	x int
	y int
}

func Iota(a []int, start int) {
	for i := 0; i < len(a); i++ {
		a[i] = start
		start++
	}
}

func NextPermutation(a []int) bool {
	n := len(a)
	pos := n - 2
	for ; pos >= 0; pos-- {
		if a[pos] < a[pos+1] {
			break
		}
	}
	if pos == -1 {
		return false
	}
	for i := n - 1; i >= 0; i-- {
		if a[i] > a[pos] {
			a[i], a[pos] = a[pos], a[i]
			Reverse(a[pos+1 : n])
			break
		}
	}
	return true
}

func Reverse(a []int) {
	n := len(a)
	for i := 0; i < n/2; i++ {
		a[i], a[n-i-1] = a[n-i-1], a[i]
	}
}

func RemoveIf(a []int, cond func(int) bool) []int {
	n := len(a)
	pos := 0
	for i := 0; i < n; i++ {
		if !cond(a[i]) {
			a[pos] = a[i]
			pos++
		}
	}
	return a[0:pos]
}

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

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

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

package main

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

func main() {
	var (
		t int
		a int
		b int
		c int
	)
	fmt.Scanf("%d\n", &t)
	scanner := bufio.NewScanner(os.Stdin)
	for i := 0; i < t; i++ {
		scanner.Scan()
		st := strings.Split(scanner.Text(), " ")
		a, _ = strconv.Atoi(st[0])
		b, _ = strconv.Atoi(st[1])
		c, _ = strconv.Atoi(st[2])
		if b > c {
			if a > b {
				fmt.Println(2)
			} else if b > a {
				fmt.Println(1)
			} else {
				fmt.Println(3)
			}
		} else {
			d := c - b
			if a > c+d {
				fmt.Println(2)
			} else if c+d > a {
				fmt.Println(1)
			} else {
				fmt.Println(3)
			}
		}
	}
}

package main

import (
	"fmt"
	"math"
)

func main() {

	// output 1 -> |a-1| < |b-c|+|c-1|
	// output 2 -> |a-1| > |b-c|+|c-1|
	// output 3 -> |a-1| = |b-c|+|c-1|

	var t int
	fmt.Scanln(&t)

	for i := 0; i < t; i++ {
		var a, b, c int
		fmt.Scanln(&a, &b, &c)

		if math.Abs(float64(a)-1) < math.Abs(float64(b)-float64(c))+math.Abs(float64(c)-1) {
			fmt.Println(1)
		} else if math.Abs(float64(a)-1) > math.Abs(float64(b)-float64(c))+math.Abs(float64(c)-1) {
			fmt.Println(2)
		} else {
			fmt.Println(3)
		}
	}

}

package main

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

func main() {
	var T int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &T)
	for T > 0 {
		var a, b, c float64
		fmt.Fscan(in, &a)
		fmt.Fscan(in, &b)
		fmt.Fscan(in, &c)
		t1,t2 := a,math.Abs(b-c)+c
		if(t1>t2){
			fmt.Println(2)
		}
		if(t1<t2){
			fmt.Println(1)
		}
		if(t1==t2){
			fmt.Println(3)
		}
		T-=1
	}
}

package main

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

func main() {
	var T int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &T)
	for T > 0 {
		var a, b, c float64
		fmt.Fscan(in, &a)
		fmt.Fscan(in, &b)
		fmt.Fscan(in, &c)
		x := a - 1
		y := math.Abs(b-c) + (c - 1)
		if x < y {
			fmt.Println(1)
		} else if x > y {
			fmt.Println(2)
		} else {
			fmt.Println(3)
		}
		T--
	}
}

package main

import (
	"fmt"
)

func main() {
	solve()
}

func solve() {
	var t, a, b, c int
	fmt.Scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		fmt.Scanf("%d %d %d\n", &a, &b, &c)
		if (a - 1) == abs(c - b) + c - 1 {
			fmt.Println(3)
		} else if (a - 1) < abs(c - b) + c - 1 {
			fmt.Println(1)
		} else {
			fmt.Println(2)
		}
	}
}

func min(a int, 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"
        "strconv"
        "strings"
)

func main() {
        reader := bufio.NewReader(os.Stdin)
        testCnt, _ := reader.ReadString('\n')
        testCnt = strings.TrimSpace(testCnt)
        testCntI, _ := strconv.Atoi(testCnt)
        //fmt.Println("test cnt: ", testCntI)
        for i := 0; i < testCntI; i++ {
                testCase, _ := reader.ReadString('\n')
                //fmt.Println("test case: ", testCase)
                solution(testCase)
        }
}

func solution(input string) {
        //fmt.Println(input)
        //fmt.Println("sol")
        arr := strings.Fields(input)
        //fmt.Println(arr, arr[0])
        liftA, _ := strconv.Atoi(arr[0])
        liftB, _ := strconv.Atoi(arr[1])
        liftC, _ := strconv.Atoi(arr[2])
        //fmt.Println(liftA, liftB, liftC)

        wayA := liftA-1

        wayB := 0
        if liftB > liftC {
                wayB = liftB - liftC
        } else {
                wayB = liftC - liftB
        }
  //fmt.Println("way B: ", wayB)
        wayB = wayB + liftC - 1

        //fmt.Println(wayA, wayB)

  if wayA < wayB {
    fmt.Println(1)
  } else if wayB < wayA {
    fmt.Println(2)
  } else {
    fmt.Println(3)
  }
}

package main

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

var in = bufio.NewReader(os.Stdin)

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

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

	for ; t > 0; t-- {
		var a, b, c int
		fmt.Fscan(in, &a, &b, &c)
		total := b
		if c >= b {
			total = 2*c - b
		}
		if total == a {
			fmt.Println(3)
		} else if total > a {
			fmt.Println(1)
		} else {
			fmt.Println(2)
		}
	}
}

package main

import "fmt"

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

func main() {
	var t, a, b, c int
	fmt.Scanln(&t)
	for i := 0; i < t; i++ {
		fmt.Scan(&a)
		fmt.Scan(&b)
		fmt.Scan(&c)
		if a < Abs(b-c)+c {
			fmt.Println(1)
		} else if a > Abs(b-c)+c {
			fmt.Println(2)
		} else {
			fmt.Println(3)
		}
	}

}

package main

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

type Number interface {
	int | int8 | int16 | int32 | int64 | float32 | float64 | byte | uint | uint16 | uint32 | uint64
}

var (
	scanner  *bufio.Scanner
	byWord   bool   //tokenization flag for scanWordsOrLines
	eof      bool   //flag whether reached end-of-file
	splitter string //scan delimiter for Ints(), etc.
)

func firstElevatorTime(a int) int {
	return a - 1
}

func secondElevatorTime(b, c int) int {
	return abs(b-c) + firstElevatorTime(c)
}

func compareTime(first, second int) int {
	if first < second {
		return 1
	}
	if first > second {
		return 2
	}
	return 3
}

func answer(a, b, c int) int {
	return compareTime(firstElevatorTime(a), secondElevatorTime(b, c))
}

// main
func main() {
	for t := Int(); t > 0; t-- {
		a, b, c := Ints3()
		fmt.Println(answer(a, b, c))
	}
}

// numeric library
func abs[T Number](a T) T {
	if a > 0 {
		return a
	}
	return -a
}

// stdin functions
func init() {
	scanner = bufio.NewScanner(os.Stdin)
	scanner.Split(scanWordsOrLines)
	eof = false
	splitter = " "
}

// its behavior can be changed by byWord variable.
func scanWordsOrLines(data []byte, atEOF bool) (advance int, token []byte, err error) {
	if byWord {
		return bufio.ScanWords(data, atEOF)
	}
	return bufio.ScanLines(data, atEOF)
}

// byword arg changes how to scan.
func text(byword bool) string {
	byWord = byword
	if scanner.Scan() {
		return scanner.Text()
	}
	eof = true //reached end of file
	return ""
}

// EOF returns if scanner cursor has reached end-of-line or not.
func EOF() bool {
	return eof
}

// Word returns word like "dog" or "foobar" at the cursor.
func Word() string {
	return text(true)
}

// Words returns word array like ["dog", "foobar"] at the line.
func Words() []string {
	return strings.Split(Line(), splitter)
}

// Line returns whole line like "dog foobar" at the cursor.
func Line() string {
	return text(false)
}

// Lines returns array of all lines from the current cursor to end-of-file.
func Lines() []string {
	var ret []string
	for {
		l := Line()
		if EOF() {
			break
		}
		ret = append(ret, l)
	}
	return ret
}

func Byte() byte {
	return byte(Uint8())
}

// auto-generated code
func Int() int {
	ret, _ := strconv.ParseInt(Word(), 10, 0)
	return int(ret)
}

func Ints() []int {
	words := Words()
	n := len(words)
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		v, _ := strconv.ParseInt(words[i], 10, 0)
		ret[i] = int(v)
	}
	return ret
}

func Ints2() (int, int) {
	return Int(), Int()
}

func Ints3() (int, int, int) {
	return Int(), Int(), Int()
}

func Ints4() (int, int, int, int) {
	return Int(), Int(), Int(), Int()
}

func Ints5() (int, int, int, int, int) {
	return Int(), Int(), Int(), Int(), Int()
}

func Ints6() (int, int, int, int, int, int) {
	return Int(), Int(), Int(), Int(), Int(), Int()
}

func Ints7() (int, int, int, int, int, int, int) {
	return Int(), Int(), Int(), Int(), Int(), Int(), Int()
}

func Ints8() (int, int, int, int, int, int, int, int) {
	return Int(), Int(), Int(), Int(), Int(), Int(), Int(), Int()
}

func Ints9() (int, int, int, int, int, int, int, int, int) {
	return Int(), Int(), Int(), Int(), Int(), Int(), Int(), Int(), Int()
}

func IntsN(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = Int()
	}
	return ret
}

func Int8() int8 {
	ret, _ := strconv.ParseInt(Word(), 10, 8)
	return int8(ret)
}

func Int8s() []int8 {
	words := Words()
	n := len(words)
	ret := make([]int8, n)
	for i := 0; i < n; i++ {
		v, _ := strconv.ParseInt(words[i], 10, 8)
		ret[i] = int8(v)
	}
	return ret
}

func Int8s2() (int8, int8) {
	return Int8(), Int8()
}

func Int8s3() (int8, int8, int8) {
	return Int8(), Int8(), Int8()
}

func Int8s4() (int8, int8, int8, int8) {
	return Int8(), Int8(), Int8(), Int8()
}

func Int8s5() (int8, int8, int8, int8, int8) {
	return Int8(), Int8(), Int8(), Int8(), Int8()
}

func Int8s6() (int8, int8, int8, int8, int8, int8) {
	return Int8(), Int8(), Int8(), Int8(), Int8(), Int8()
}

func Int8s7() (int8, int8, int8, int8, int8, int8, int8) {
	return Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8()
}

func Int8s8() (int8, int8, int8, int8, int8, int8, int8, int8) {
	return Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8()
}

func Int8s9() (int8, int8, int8, int8, int8, int8, int8, int8, int8) {
	return Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8()
}

func Int8sN(n int) []int8 {
	ret := make([]int8, n)
	for i := 0; i < n; i++ {
		ret[i] = Int8()
	}
	return ret
}

func Int16() int16 {
	ret, _ := strconv.ParseInt(Word(), 10, 16)
	return int16(ret)
}

func Int16s() []int16 {
	words := Words()
	n := len(words)
	ret := make([]int16, n)
	for i := 0; i < n; i++ {
		v, _ := strconv.ParseInt(words[i], 10, 16)
		ret[i] = int16(v)
	}
	return ret
}

func Int16s2() (int16, int16) {
	return Int16(), Int16()
}

func Int16s3() (int16, int16, int16) {
	return Int16(), Int16(), Int16()
}

func Int16s4() (int16, int16, int16, int16) {
	return Int16(), Int16(), Int16(), Int16()
}

func Int16s5() (int16, int16, int16, int16, int16) {
	return Int16(), Int16(), Int16(), Int16(), Int16()
}

func Int16s6() (int16, int16, int16, int16, int16, int16) {
	return Int16(), Int16(), Int16(), Int16(), Int16(), Int16()
}

func Int16s7() (int16, int16, int16, int16, int16, int16, int16) {
	return Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16()
}

func Int16s8() (int16, int16, int16, int16, int16, int16, int16, int16) {
	return Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16()
}

func Int16s9() (int16, int16, int16, int16, int16, int16, int16, int16, int16) {
	return Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16()
}

func Int16sN(n int) []int16 {
	ret := make([]int16, n)
	for i := 0; i < n; i++ {
		ret[i] = Int16()
	}
	return ret
}

func Int32() int32 {
	ret, _ := strconv.ParseInt(Word(), 10, 32)
	return int32(ret)
}

func Int32s() []int32 {
	words := Words()
	n := len(words)
	ret := make([]int32, n)
	for i := 0; i < n; i++ {
		v, _ := strconv.ParseInt(words[i], 10, 32)
		ret[i] = int32(v)
	}
	return ret
}

func Int32s2() (int32, int32) {
	return Int32(), Int32()
}

func Int32s3() (int32, int32, int32) {
	return Int32(), Int32(), Int32()
}

func Int32s4() (int32, int32, int32, int32) {
	return Int32(), Int32(), Int32(), Int32()
}

func Int32s5() (int32, int32, int32, int32, int32) {
	return Int32(), Int32(), Int32(), Int32(), Int32()
}

func Int32s6() (int32, int32, int32, int32, int32, int32) {
	return Int32(), Int32(), Int32(), Int32(), Int32(), Int32()
}

func Int32s7() (int32, int32, int32, int32, int32, int32, int32) {
	return Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32()
}

func Int32s8() (int32, int32, int32, int32, int32, int32, int32, int32) {
	return Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32()
}

func Int32s9() (int32, int32, int32, int32, int32, int32, int32, int32, int32) {
	return Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32()
}

func Int32sN(n int) []int32 {
	ret := make([]int32, n)
	for i := 0; i < n; i++ {
		ret[i] = Int32()
	}
	return ret
}

func Int64() int64 {
	ret, _ := strconv.ParseInt(Word(), 10, 64)
	return int64(ret)
}

func Int64s() []int64 {
	words := Words()
	n := len(words)
	ret := make([]int64, n)
	for i := 0; i < n; i++ {
		v, _ := strconv.ParseInt(words[i], 10, 64)
		ret[i] = int64(v)
	}
	return ret
}

func Int64s2() (int64, int64) {
	return Int64(), Int64()
}

func Int64s3() (int64, int64, int64) {
	return Int64(), Int64(), Int64()
}

func Int64s4() (int64, int64, int64, int64) {
	return Int64(), Int64(), Int64(), Int64()
}

func Int64s5() (int64, int64, int64, int64, int64) {
	return Int64(), Int64(), Int64(), Int64(), Int64()
}

func Int64s6() (int64, int64, int64, int64, int64, int64) {
	return Int64(), Int64(), Int64(), Int64(), Int64(), Int64()
}

func Int64s7() (int64, int64, int64, int64, int64, int64, int64) {
	return Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64()
}

func Int64s8() (int64, int64, int64, int64, int64, int64, int64, int64) {
	return Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64()
}

func Int64s9() (int64, int64, int64, int64, int64, int64, int64, int64, int64) {
	return Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64()
}

func Int64sN(n int) []int64 {
	ret := make([]int64, n)
	for i := 0; i < n; i++ {
		ret[i] = Int64()
	}
	return ret
}

func Uint() uint {
	ret, _ := strconv.ParseUint(Word(), 10, 0)
	return uint(ret)
}

func Uints() []uint {
	words := Words()
	n := len(words)
	ret := make([]uint, n)
	for i := 0; i < n; i++ {
		v, _ := strconv.ParseUint(words[i], 10, 0)
		ret[i] = uint(v)
	}
	return ret
}

func Uints2() (uint, uint) {
	return Uint(), Uint()
}

func Uints3() (uint, uint, uint) {
	return Uint(), Uint(), Uint()
}

func Uints4() (uint, uint, uint, uint) {
	return Uint(), Uint(), Uint(), Uint()
}

func Uints5() (uint, uint, uint, uint, uint) {
	return Uint(), Uint(), Uint(), Uint(), Uint()
}

func Uints6() (uint, uint, uint, uint, uint, uint) {
	return Uint(), Uint(), Uint(), Uint(), Uint(), Uint()
}

func Uints7() (uint, uint, uint, uint, uint, uint, uint) {
	return Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint()
}

func Uints8() (uint, uint, uint, uint, uint, uint, uint, uint) {
	return Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint()
}

func Uints9() (uint, uint, uint, uint, uint, uint, uint, uint, uint) {
	return Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint()
}

func UintsN(n int) []uint {
	ret := make([]uint, n)
	for i := 0; i < n; i++ {
		ret[i] = Uint()
	}
	return ret
}

func Uint8() uint8 {
	ret, _ := strconv.ParseUint(Word(), 10, 8)
	return uint8(ret)
}

func Uint8s() []uint8 {
	words := Words()
	n := len(words)
	ret := make([]uint8, n)
	for i := 0; i < n; i++ {
		v, _ := strconv.ParseUint(words[i], 10, 8)
		ret[i] = uint8(v)
	}
	return ret
}

func Uint8s2() (uint8, uint8) {
	return Uint8(), Uint8()
}

func Uint8s3() (uint8, uint8, uint8) {
	return Uint8(), Uint8(), Uint8()
}

func Uint8s4() (uint8, uint8, uint8, uint8) {
	return Uint8(), Uint8(), Uint8(), Uint8()
}

func Uint8s5() (uint8, uint8, uint8, uint8, uint8) {
	return Uint8(), Uint8(), Uint8(), Uint8(), Uint8()
}

func Uint8s6() (uint8, uint8, uint8, uint8, uint8, uint8) {
	return Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8()
}

func Uint8s7() (uint8, uint8, uint8, uint8, uint8, uint8, uint8) {
	return Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8()
}

func Uint8s8() (uint8, uint8, uint8, uint8, uint8, uint8, uint8, uint8) {
	return Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8()
}

func Uint8s9() (uint8, uint8, uint8, uint8, uint8, uint8, uint8, uint8, uint8) {
	return Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8()
}

func Uint8sN(n int) []uint8 {
	ret := make([]uint8, n)
	for i := 0; i < n; i++ {
		ret[i] = Uint8()
	}
	return ret
}

func Uint16() uint16 {
	ret, _ := strconv.ParseUint(Word(), 10, 16)
	return uint16(ret)
}

func Uint16s() []uint16 {
	words := Words()
	n := len(words)
	ret := make([]uint16, n)
	for i := 0; i < n; i++ {
		v, _ := strconv.ParseUint(words[i], 10, 16)
		ret[i] = uint16(v)
	}
	return ret
}

func Uint16s2() (uint16, uint16) {
	return Uint16(), Uint16()
}

func Uint16s3() (uint16, uint16, uint16) {
	return Uint16(), Uint16(), Uint16()
}

func Uint16s4() (uint16, uint16, uint16, uint16) {
	return Uint16(), Uint16(), Uint16(), Uint16()
}

func Uint16s5() (uint16, uint16, uint16, uint16, uint16) {
	return Uint16(), Uint16(), Uint16(), Uint16(), Uint16()
}

func Uint16s6() (uint16, uint16, uint16, uint16, uint16, uint16) {
	return Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16()
}

func Uint16s7() (uint16, uint16, uint16, uint16, uint16, uint16, uint16) {
	return Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16()
}

func Uint16s8() (uint16, uint16, uint16, uint16, uint16, uint16, uint16, uint16) {
	return Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16()
}

func Uint16s9() (uint16, uint16, uint16, uint16, uint16, uint16, uint16, uint16, uint16) {
	return Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16()
}

func Uint16sN(n int) []uint16 {
	ret := make([]uint16, n)
	for i := 0; i < n; i++ {
		ret[i] = Uint16()
	}
	return ret
}

func Uint32() uint32 {
	ret, _ := strconv.ParseUint(Word(), 10, 32)
	return uint32(ret)
}

func Uint32s() []uint32 {
	words := Words()
	n := len(words)
	ret := make([]uint32, n)
	for i := 0; i < n; i++ {
		v, _ := strconv.ParseUint(words[i], 10, 32)
		ret[i] = uint32(v)
	}
	return ret
}

func Uint32s2() (uint32, uint32) {
	return Uint32(), Uint32()
}

func Uint32s3() (uint32, uint32, uint32) {
	return Uint32(), Uint32(), Uint32()
}

func Uint32s4() (uint32, uint32, uint32, uint32) {
	return Uint32(), Uint32(), Uint32(), Uint32()
}

func Uint32s5() (uint32, uint32, uint32, uint32, uint32) {
	return Uint32(), Uint32(), Uint32(), Uint32(), Uint32()
}

func Uint32s6() (uint32, uint32, uint32, uint32, uint32, uint32) {
	return Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32()
}

func Uint32s7() (uint32, uint32, uint32, uint32, uint32, uint32, uint32) {
	return Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32()
}

func Uint32s8() (uint32, uint32, uint32, uint32, uint32, uint32, uint32, uint32) {
	return Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32()
}

func Uint32s9() (uint32, uint32, uint32, uint32, uint32, uint32, uint32, uint32, uint32) {
	return Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32()
}

func Uint32sN(n int) []uint32 {
	ret := make([]uint32, n)
	for i := 0; i < n; i++ {
		ret[i] = Uint32()
	}
	return ret
}

func Uint64() uint64 {
	ret, _ := strconv.ParseUint(Word(), 10, 64)
	return uint64(ret)
}

func Uint64s() []uint64 {
	words := Words()
	n := len(words)
	ret := make([]uint64, n)
	for i := 0; i < n; i++ {
		v, _ := strconv.ParseUint(words[i], 10, 64)
		ret[i] = uint64(v)
	}
	return ret
}

func Uint64s2() (uint64, uint64) {
	return Uint64(), Uint64()
}

func Uint64s3() (uint64, uint64, uint64) {
	return Uint64(), Uint64(), Uint64()
}

func Uint64s4() (uint64, uint64, uint64, uint64) {
	return Uint64(), Uint64(), Uint64(), Uint64()
}

func Uint64s5() (uint64, uint64, uint64, uint64, uint64) {
	return Uint64(), Uint64(), Uint64(), Uint64(), Uint64()
}

func Uint64s6() (uint64, uint64, uint64, uint64, uint64, uint64) {
	return Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64()
}

func Uint64s7() (uint64, uint64, uint64, uint64, uint64, uint64, uint64) {
	return Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64()
}

func Uint64s8() (uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64) {
	return Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64()
}

func Uint64s9() (uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64) {
	return Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64()
}

func Uint64sN(n int) []uint64 {
	ret := make([]uint64, n)
	for i := 0; i < n; i++ {
		ret[i] = Uint64()
	}
	return ret
}

func Float32() float32 {
	ret, _ := strconv.ParseFloat(Word(), 32)
	return float32(ret)
}

func Float32s() []float32 {
	words := Words()
	n := len(words)
	ret := make([]float32, n)
	for i := 0; i < n; i++ {
		v, _ := strconv.ParseFloat(words[i], 32)
		ret[i] = float32(v)
	}
	return ret
}

func Float32s2() (float32, float32) {
	return Float32(), Float32()
}

func Float32s3() (float32, float32, float32) {
	return Float32(), Float32(), Float32()
}

func Float32s4() (float32, float32, float32, float32) {
	return Float32(), Float32(), Float32(), Float32()
}

func Float32s5() (float32, float32, float32, float32, float32) {
	return Float32(), Float32(), Float32(), Float32(), Float32()
}

func Float32s6() (float32, float32, float32, float32, float32, float32) {
	return Float32(), Float32(), Float32(), Float32(), Float32(), Float32()
}

func Float32s7() (float32, float32, float32, float32, float32, float32, float32) {
	return Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32()
}

func Float32s8() (float32, float32, float32, float32, float32, float32, float32, float32) {
	return Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32()
}

func Float32s9() (float32, float32, float32, float32, float32, float32, float32, float32, float32) {
	return Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32()
}

func Float32sN(n int) []float32 {
	ret := make([]float32, n)
	for i := 0; i < n; i++ {
		ret[i] = Float32()
	}
	return ret
}

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

func Float64s() []float64 {
	words := Words()
	n := len(words)
	ret := make([]float64, n)
	for i := 0; i < n; i++ {
		v, _ := strconv.ParseFloat(words[i], 64)
		ret[i] = float64(v)
	}
	return ret
}

func Float64s2() (float64, float64) {
	return Float64(), Float64()
}

func Float64s3() (float64, float64, float64) {
	return Float64(), Float64(), Float64()
}

func Float64s4() (float64, float64, float64, float64) {
	return Float64(), Float64(), Float64(), Float64()
}

func Float64s5() (float64, float64, float64, float64, float64) {
	return Float64(), Float64(), Float64(), Float64(), Float64()
}

func Float64s6() (float64, float64, float64, float64, float64, float64) {
	return Float64(), Float64(), Float64(), Float64(), Float64(), Float64()
}

func Float64s7() (float64, float64, float64, float64, float64, float64, float64) {
	return Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64()
}

func Float64s8() (float64, float64, float64, float64, float64, float64, float64, float64) {
	return Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64()
}

func Float64s9() (float64, float64, float64, float64, float64, float64, float64, float64, float64) {
	return Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64()
}

func Float64sN(n int) []float64 {
	ret := make([]float64, n)
	for i := 0; i < n; i++ {
		ret[i] = Float64()
	}
	return ret
}

func Words2() (string, string) {
	return Word(), Word()
}

func Words3() (string, string, string) {
	return Word(), Word(), Word()
}

func Words4() (string, string, string, string) {
	return Word(), Word(), Word(), Word()
}

func Words5() (string, string, string, string, string) {
	return Word(), Word(), Word(), Word(), Word()
}

func Words6() (string, string, string, string, string, string) {
	return Word(), Word(), Word(), Word(), Word(), Word()
}

func Words7() (string, string, string, string, string, string, string) {
	return Word(), Word(), Word(), Word(), Word(), Word(), Word()
}

func Words8() (string, string, string, string, string, string, string, string) {
	return Word(), Word(), Word(), Word(), Word(), Word(), Word(), Word()
}

func Words9() (string, string, string, string, string, string, string, string, string) {
	return Word(), Word(), Word(), Word(), Word(), Word(), Word(), Word(), Word()
}

func WordsN(n int) []string {
	ret := make([]string, n)
	for i := 0; i < n; i++ {
		ret[i] = Word()
	}
	return ret
}

func Lines2() (string, string) {
	return Line(), Line()
}

func Lines3() (string, string, string) {
	return Line(), Line(), Line()
}

func Lines4() (string, string, string, string) {
	return Line(), Line(), Line(), Line()
}

func Lines5() (string, string, string, string, string) {
	return Line(), Line(), Line(), Line(), Line()
}

func Lines6() (string, string, string, string, string, string) {
	return Line(), Line(), Line(), Line(), Line(), Line()
}

func Lines7() (string, string, string, string, string, string, string) {
	return Line(), Line(), Line(), Line(), Line(), Line(), Line()
}

func Lines8() (string, string, string, string, string, string, string, string) {
	return Line(), Line(), Line(), Line(), Line(), Line(), Line(), Line()
}

func Lines9() (string, string, string, string, string, string, string, string, string) {
	return Line(), Line(), Line(), Line(), Line(), Line(), Line(), Line(), Line()
}

func LinesN(n int) []string {
	ret := make([]string, n)
	for i := 0; i < n; i++ {
		ret[i] = Line()
	}
	return ret
}

func Bytes2() (byte, byte) {
	return Byte(), Byte()
}

func Bytes3() (byte, byte, byte) {
	return Byte(), Byte(), Byte()
}

func Bytes4() (byte, byte, byte, byte) {
	return Byte(), Byte(), Byte(), Byte()
}

func Bytes5() (byte, byte, byte, byte, byte) {
	return Byte(), Byte(), Byte(), Byte(), Byte()
}

func Bytes6() (byte, byte, byte, byte, byte, byte) {
	return Byte(), Byte(), Byte(), Byte(), Byte(), Byte()
}

func Bytes7() (byte, byte, byte, byte, byte, byte, byte) {
	return Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte()
}

func Bytes8() (byte, byte, byte, byte, byte, byte, byte, byte) {
	return Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte()
}

func Bytes9() (byte, byte, byte, byte, byte, byte, byte, byte, byte) {
	return Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte()
}

func BytesN(n int) []byte {
	ret := make([]byte, n)
	for i := 0; i < n; i++ {
		ret[i] = Byte()
	}
	return ret
}

package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	nrTests, _ := strconv.Atoi(scanner.Text())
	for i := 0; i < nrTests; i++ {
		scanner.Scan()
		line := strings.Split(scanner.Text(), " ")
		a, _ := strconv.Atoi(line[0])
		b, _ := strconv.Atoi(line[1])
		c, _ := strconv.Atoi(line[2])
		x := math.Abs(float64(a - 1))
		y := math.Abs(float64(b-c)) + math.Abs(float64(c-1))
		if x < y {
			fmt.Println("1")
		} else if x > y {
			fmt.Println("2")
		} else {
			fmt.Println("3")
		}
	}
}

package main

import "fmt"

func main() {
	var t, a, b, c int
	fmt.Scanln(&t)
	for t > 0 {
		t--
		fmt.Scanln(&a, &b, &c)
		u := a - 1
		v := b - 1
		if c > b {
			v = c - b + c - 1
		}
		if u < v {
			fmt.Println(1)
		} else if u > v {
			fmt.Println(2)
		} else {
			fmt.Println(3)
		}

	}
}

package main

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

var (
	reader     = bufio.NewReader(os.Stdin)
	t, a, b, c int
)

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

func solve(a, b, c int) int {
	var x, y = abs(a - 1), abs(b-c) + abs(c-1)
	if x < y {
		return 1
	}
	if x > y {
		return 2
	}
	return 3
}

func main() {
	fmt.Fscan(reader, &t)
	for ; t > 0; t-- {
		fmt.Fscan(reader, &a, &b, &c)

		fmt.Println(solve(a, b, c))
	}
}

package main

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

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

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

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

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

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

/**
Run solve the problem CF1729A
Date: 12/09/22
User: pepradere
URL: https://codeforces.com/problemset/problem/1729/A
Problem: CF1729A
**/
func (in *CF1729A) Run() {
	for t := in.NextInt(); t > 0; t-- {
		a, b, c := in.NextInt(), in.NextInt(), in.NextInt()
		diffA := a

		diffB := int(math.Abs(float64(b)-float64(c))) + c
		if diffA == diffB {
			fmt.Println(3)
		} else if diffA < diffB {
			fmt.Println(1)
		} else {
			fmt.Println(2)
		}
	}
}

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

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

package main

import (
	"fmt"
)

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

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

func main() {
	var n, a, b, c int
	fmt.Scanln(&n)
	for i := 0; i < n; i++ {
		fmt.Scanln(&a, &b, &c)
		fst, scnd := a-1, max(b, c)-min(b, c)+(c-1)
		if fst < scnd {
			fmt.Println(1)
		} else if fst > scnd {
			fmt.Println(2)
		} else {
			fmt.Println(3)
		}
	}
}

package main

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

func main() {
	var t int
	r := bufio.NewReader(os.Stdin)
	fmt.Fscanf(r, "%d\n", &t)
	for ; t > 0; t-- {
		a, b, c, time1, time2 := 0, 0, 0, 0, 0
		s, _ := r.ReadString('\n')
		p := strings.Fields(s)
		a, _ = strconv.Atoi(p[0])
		b, _ = strconv.Atoi(p[1])
		c, _ = strconv.Atoi(p[2])

		time1 = a - 1
		time2 = int(math.Abs(float64(c - b)))
		if c != 1 {
			time2 += c - 1
		}
		if time1 < time2 {
			fmt.Println("1")
		} else if time2 < time1 {
			fmt.Println("2")
		} else {
			fmt.Println("3")
		}
	}
}

package main

import (
    "fmt"
    "math"
)

func main () {
    var t int

    fmt.Scan(&t)

    for i := 0; i < t; i++ {
        var a, b, c float64
        fmt.Scan(&a)
        fmt.Scan(&b)
        fmt.Scan(&c)

        if math.Abs(a - 1) < math.Abs(b - c) + (c - 1) {
            fmt.Println(1)
        } else if math.Abs(a - 1) == math.Abs(b - c) + (c - 1) {
            fmt.Println(3)
        } else {
            fmt.Println(2)
        }
    }
}

/*
	A template for Go on codeforces.com
	Author: Yakov, frvr.ru
*/

package main

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

func main() {
	// START WRITING YOUR SOLUTION HERE:
	// writeLine(typeOf(readInt()))
	t := readInt()
	for j := 0; j < t; j++ {
		arr := readInts()
		cost_1 := math.Abs(float64(arr[0] - 1))
		cost_2 := math.Abs(float64(arr[1]-arr[2])) + math.Abs(float64(arr[2]-1))
		if cost_1 > cost_2 {
			writeLine(2)
		} else if cost_1 < cost_2 {
			writeLine(1)
		} else {
			writeLine(3)
		}
	}

}

/* ~~~~~~~~~~ */
/* ~~~~~~~~~~ */
/* ~~~~~~~~~~ */

var in = bufio.NewReader(os.Stdin)

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

func typeOf(arg interface{}) string {
	switch reflect.TypeOf(arg).Kind() {
	case reflect.Int:
		return "int"
	case reflect.Int8:
		return "int8"
	case reflect.Int16:
		return "int16"
	case reflect.Int32:
		return "int32"
	case reflect.Int64:
		return "int64"
	case reflect.Uint:
		return "uint"
	case reflect.Uint8:
		return "uint8"
	case reflect.Uint16:
		return "uint16"
	case reflect.Uint32:
		return "uint32"
	case reflect.Uint64:
		return "uint64"
	case reflect.Float32:
		return "float32"
	case reflect.Float64:
		return "float64"
	case reflect.Complex64:
		return "complex64"
	case reflect.Complex128:
		return "complex128"
	case reflect.Bool:
		return "bool"
	case reflect.String:
		return "string"
	case reflect.Chan:
		return "chan"
	case reflect.Ptr:
		return "ptr"
	case reflect.Uintptr:
		return "uintptr"
	case reflect.UnsafePointer:
		return "unsafeptr"
	case reflect.Interface:
		return "interface"
	case reflect.Array:
		return "array"
	case reflect.Slice:
		return "slice"
	case reflect.Map:
		return "map"
	case reflect.Struct:
		return "struct"
	case reflect.Func:
		return "func"
	case reflect.Invalid:
		return "invalid"
	default:
		return "nil"
	}
}

/* ~~~~~~~~~~ */

func _scln() string {
	ln, _ := in.ReadString('\n')
	return strings.Trim(ln, " \r\n")
}
func _sc(s []string) string {
	if len(s) == 0 {
		return _scln()
	}
	return s[0]
}

func readLine() string              { return _scln() }
func readString() string            { return _scln() }
func readStrings() []string         { return strings.Split(_scln(), " ") }
func readBool(s ...string) bool     { t, _ := strconv.ParseBool(_sc(s)); return t }
func readByte(s ...string) byte     { t, _ := strconv.ParseUint(_sc(s), 10, 8); return byte(t) }
func readDouble(s ...string) double { t, _ := strconv.ParseFloat(_sc(s), 64); return t }
func readFloat(s ...string) float   { t, _ := strconv.ParseFloat(_sc(s), 32); return float32(t) }
func readInt(s ...string) int       { t, _ := strconv.Atoi(_sc(s)); return t }
func readLong(s ...string) long     { t, _ := strconv.ParseInt(_sc(s), 10, 64); return t }
func readULong(s ...string) ulong   { t, _ := strconv.ParseUint(_sc(s), 10, 64); return t }

/* ~~~~~~~~~~ */

// Too much overhead with universal method using interface{}, wait for the generics,
// but for now — just don't look at the redundancy of the code after that commentary :)

func readBools() []bool {
	strs := readStrings()
	arr := make([]bool, len(strs))
	for i, s := range strs {
		arr[i] = readBool(s)
	}
	return arr
}
func readBytes() []byte {
	strs := readStrings()
	arr := make([]byte, len(strs))
	for i, s := range strs {
		arr[i] = readByte(s)
	}
	return arr
}
func readDoubles() []double {
	strs := readStrings()
	arr := make([]double, len(strs))
	for i, s := range strs {
		arr[i] = readDouble(s)
	}
	return arr
}
func readFloats() []float {
	strs := readStrings()
	arr := make([]float, len(strs))
	for i, s := range strs {
		arr[i] = readFloat(s)
	}
	return arr
}
func readInts() []int {
	strs := readStrings()
	arr := make([]int, len(strs))
	for i, s := range strs {
		arr[i] = readInt(s)
	}
	return arr
}
func readLongs() []long {
	strs := readStrings()
	arr := make([]long, len(strs))
	for i, s := range strs {
		arr[i] = readLong(s)
	}
	return arr
}
func readULongs() []ulong {
	strs := readStrings()
	arr := make([]ulong, len(strs))
	for i, s := range strs {
		arr[i] = readULong(s)
	}
	return arr
}

/* ~~~~~~~~~~ */

func write(arg ...interface{})                 { fmt.Print(arg...) }
func writeLine(arg ...interface{})             { fmt.Println(arg...) }
func writeFormat(f string, arg ...interface{}) { fmt.Printf(f, arg...) }

package main

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

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

func main() {

	defer out.Flush()

	t := 0
	if _, err := fmt.Fscan(in, &t); err != nil {
		return
	}

	for ; t > 0; t-- {
		a, b, c := 0, 0, 0
		if _, err := fmt.Fscan(in, &a, &b, &c); err != nil {
			return
		}
		first := a - 1
		second := 0
		if b > c {
			second = b - 1
		} else {
			second = c - b + c - 1
		}
		if first < second {
			fmt.Println(1)
		} else if first > second {
			fmt.Println(2)
		} else {
			fmt.Println(3)
		}
		//fmt.Fprintln(out, "...")
	}
}

package main

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

func main() {
	// f, err := os.OpenFile("data.txt", os.O_RDONLY, 0644)
	// if err != nil {
	// 	os.Exit(-2)
	// }

	// r := bufio.NewReader(f)
	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)
	Solve(r, w, w.Flush)
}

func Solve(reader io.Reader, writer io.Writer, Flush func() error) {
	var t int
	fmt.Fscanln(reader, &t)

	for ; t > 0; t-- {
		var a, b, c int
		fmt.Fscanln(reader, &a, &b, &c)

		ans := 3
		a = a - 1
		v := (c - 1) + Abs(b-c)
		if a < v {
			ans = 1
		} else if a > v {
			ans = 2
		}

		fmt.Fprintln(writer, ans)
		Flush()
	}
}

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

package main

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

func main() {
	in, out := bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var tests = 1
	Fscan(in, &tests)

	var run_case func()
	run_case = func() {
		var a, b, c int
		Fscan(in, &a, &b, &c)
		f := a - 1
		s := abs(c, b) + (c - 1)
		if f == s {
			Fprintln(out, 3)
		} else if f < s {
			Fprintln(out, 1)
		} else {
			Fprintln(out, 2)
		}

	}

	for i := 0; i < tests; i++ {
		run_case()
	}
}
func abs(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

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 < T; t++ {
		var a, b, c int
		fmt.Fscan(in, &a, &b, &c)

		if b < c {
			b = c - b + c
		}

		if a == b {
			fmt.Fprintln(out, 3)
		} else if a < b {
			fmt.Fprintln(out, 1)
		} else {
			fmt.Fprintln(out, 2)
		}
	}
}

package main

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

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

func solve() string {
	var a, b, c int
	fmt.Fscan(in, &a, &b, &c)

	s := abs(c-b) + c
	if a < s {
		return "1"
	}
	if a > s {
		return "2"
	}

	return "3"
}

func main() {
	defer out.Flush()
	var t int
	for fmt.Fscanln(in, &t); t > 0; t-- {
		fmt.Fprintln(out, solve())
	}
}

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

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

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

func makeMatrix(n, m int) [][]int {
	x := make([][]int, n)
	for i := range x {
		x[i] = make([]int, m)
	}
	return x
}

package main

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

func main() {
	t := readInt64()
	for i := int64(0); i < t; i++ {
		arr := readArrInt64()
		a, b, c := arr[0], arr[1], arr[2]
		t1 := a - 1
		t2 := abs(b-c) + c - 1
		switch {
		case t1 < t2:
			fmt.Println(1)
			continue
		case t1 > t2:
			fmt.Println(2)
			continue
		case t1 == t2:
			fmt.Println(a, b, c)
			continue
		}
	}
}

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

var in = bufio.NewReader(os.Stdin)

func readInt64() int64 {
	nStr, _ := in.ReadString('\n')
	nStr = strings.ReplaceAll(nStr, "\r", "")
	nStr = strings.ReplaceAll(nStr, "\n", "")
	n, _ := strconv.ParseInt(nStr, 10, 64)
	return n
}

func readArrString() []string {
	line, _ := in.ReadString('\n')
	line = strings.ReplaceAll(line, "\r", "")
	line = strings.ReplaceAll(line, "\n", "")
	numbs := strings.Split(line, " ")
	return numbs
}

func readArrInt64() []int64 {
	numbs := readArrString()
	arr := make([]int64, len(numbs))
	for i, n := range numbs {
		val, _ := strconv.ParseInt(n, 10, 64)
		arr[i] = val
	}
	return arr
}

package main

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

func main() {
	t := readInt64()
	for i := int64(0); i < t; i++ {
		var a, b, c int64
		_, _ = fmt.Fscanf(os.Stdin, "%d %d %d\n", &a, &b, &c)
		t1 := a - 1
		t2 := abs(b-c) + c - 1
		switch {
		case t1 < t2:
			fmt.Println(1)
			continue
		case t1 > t2:
			fmt.Println(2)
			continue
		case t1 == t2:
			fmt.Println(a, b, c)
			continue
		}
	}
}

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

var in = bufio.NewReader(os.Stdin)

func readInt64() int64 {
	nStr, _ := in.ReadString('\n')
	nStr = strings.ReplaceAll(nStr, "\r", "")
	nStr = strings.ReplaceAll(nStr, "\n", "")
	n, _ := strconv.ParseInt(nStr, 10, 64)
	return n
}

package main

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

func main() {
	t := readInt64()
	for i := int64(0); i < t; i++ {
		var a, b, c int32
		_, _ = fmt.Fscanf(os.Stdin, "%d %d %d\n", &a, &b, &c)
		t1 := a - 1
		t2 := abs(b-c) + c - 1
		switch {
		case t1 < t2:
			fmt.Println(1)
			continue
		case t1 > t2:
			fmt.Println(2)
			continue
		case t1 == t2:
			fmt.Println(a, b, c)
			continue
		}
	}
}

func abs(i int32) int32 {
	if i > 0 {
		return i
	} else {
		return -i
	}
}

var in = bufio.NewReader(os.Stdin)

func readInt64() int64 {
	nStr, _ := in.ReadString('\n')
	nStr = strings.ReplaceAll(nStr, "\r", "")
	nStr = strings.ReplaceAll(nStr, "\n", "")
	n, _ := strconv.ParseInt(nStr, 10, 64)
	return n
}

package main

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

func main() {
	t := readInt64()
	for i := int64(0); i < t; i++ {
		var a, b, c int32
		_, _ = fmt.Fscanf(os.Stdin, "%d %d %d\n", &a, &b, &c)
		t1 := a - 1
		t2 := abs(b-c) + c - 1
		switch {
		case t1 < t2:
			fmt.Println(1)
			continue
		case t1 > t2:
			fmt.Println(2)
			continue
		case t1 == t2:
			fmt.Println(t1, t2)
			continue
		}
	}
}

func abs(i int32) int32 {
	if i > 0 {
		return i
	} else {
		return -i
	}
}

var in = bufio.NewReader(os.Stdin)

func readInt64() int64 {
	nStr, _ := in.ReadString('\n')
	nStr = strings.ReplaceAll(nStr, "\r", "")
	nStr = strings.ReplaceAll(nStr, "\n", "")
	n, _ := strconv.ParseInt(nStr, 10, 64)
	return n
}

package main

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

func main() {
	t := readInt64()
	for i := int64(0); i < t; i++ {
		var a, b, c int32
		_, _ = fmt.Fscanf(os.Stdin, "%d %d %d\n", &a, &b, &c)
		t1 := a - 1
		t2 := abs(b-c) + c - 1
		switch {
		case t1 < t2:
			fmt.Println(1)
			continue
		case t1 > t2:
			fmt.Println(2)
			continue
		case t1 == t2:
			fmt.Println(33)
			continue
		}
	}
}

func abs(i int32) int32 {
	if i > 0 {
		return i
	} else {
		return -i
	}
}

var in = bufio.NewReader(os.Stdin)

func readInt64() int64 {
	nStr, _ := in.ReadString('\n')
	nStr = strings.ReplaceAll(nStr, "\r", "")
	nStr = strings.ReplaceAll(nStr, "\n", "")
	n, _ := strconv.ParseInt(nStr, 10, 64)
	return n
}

package main

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

func main() {
	t := readInt64()
	for i := int64(0); i < t; i++ {
		var a, b, c int32
		_, _ = fmt.Fscanf(os.Stdin, "%d %d %d\n", &a, &b, &c)
		t1 := a - 1
		t2 := abs(b-c) + c - 1
		switch {
		case t1 < t2:
			fmt.Println(1)
			continue
		case t1 > t2:
			fmt.Println(2)
			continue
		case t1 == t2:
			fmt.Println(3)
			continue
		}
	}
}

func abs(i int32) int32 {
	if i > 0 {
		return i
	} else {
		return -i
	}
}

var in = bufio.NewReader(os.Stdin)

func readLineNumbs() []string {
	line, _ := in.ReadString('\n')
	line = strings.ReplaceAll(line, "\r", "")
	line = strings.ReplaceAll(line, "\n", "")
	numbs := strings.Split(line, " ")
	return numbs
}

func readInt64() int64 {
	nStr, _ := in.ReadString('\n')
	nStr = strings.ReplaceAll(nStr, "\r", "")
	nStr = strings.ReplaceAll(nStr, "\n", "")
	n, _ := strconv.ParseInt(nStr, 10, 64)
	return n
}

func readArrInt64() []int64 {
	numbs := readLineNumbs()
	arr := make([]int64, len(numbs))
	for i, n := range numbs {
		val, _ := strconv.ParseInt(n, 10, 64)
		arr[i] = val
	}
	return arr
}

package main

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

func main() {
	t := readInt64()
	for i := int64(0); i < t; i++ {
		var a, b, c int32
		_, _ = fmt.Fscanf(os.Stdin, "%d %d %d\n", &a, &b, &c)
		t1 := a - 1
		t2 := abs(b-c) + c - 1
		switch {
		case t1 < t2:
			fmt.Println(1)
		case t1 > t2:
			fmt.Println(2)
		case t1 == t2:
			fmt.Println(3)
		}
	}
}

func abs(i int32) int32 {
	if i > 0 {
		return i
	} else {
		return -i
	}
}

var in = bufio.NewReader(os.Stdin)

func readLineNumbs() []string {
	line, _ := in.ReadString('\n')
	line = strings.ReplaceAll(line, "\r", "")
	line = strings.ReplaceAll(line, "\n", "")
	numbs := strings.Split(line, " ")
	return numbs
}

func readInt64() int64 {
	nStr, _ := in.ReadString('\n')
	nStr = strings.ReplaceAll(nStr, "\r", "")
	nStr = strings.ReplaceAll(nStr, "\n", "")
	n, _ := strconv.ParseInt(nStr, 10, 64)
	return n
}

func readArrInt64() []int64 {
	numbs := readLineNumbs()
	arr := make([]int64, len(numbs))
	for i, n := range numbs {
		val, _ := strconv.ParseInt(n, 10, 64)
		arr[i] = val
	}
	return arr
}

package main

import (
	"fmt"
	"math"
)

func main() {
	var t float64
	fmt.Scanf("%d\n", &t)
	var i float64
	for i = 0; i < t; i++ {
		var a, b, c float64
		fmt.Scanf("%d %d %d\n", &a, &b, &c)
		a--
		r := math.Abs(b-c) + c - 1
		if r == a {
			fmt.Println(3)
		} else if r > a {
			fmt.Println(1)
		} else {
			fmt.Println(2)
		}
	}
}

package main

import (
	"fmt"
	"math"
)

func main() {
	var t int64
	fmt.Scanf("%d", &t)
	for i := 0; int64(i) < t; i++ {
		var a, b, c int64
		fmt.Scanf("%d %d %d\n", &a, &b, &c)
		a--
		r := int64(math.Abs(float64(b-c))) + c - 1
		if r == a {
			fmt.Println(3)
		} else if r > a {
			fmt.Println(1)
		} else {
			fmt.Println(2)
		}
	}
}

package main

import (
	"fmt"
	"math"
)

func main() {
	var t int64
	fmt.Scanf("%d", &t)
	for i := 0; int64(i) < t; i++ {
		var a, b, c int64
		fmt.Scanf("%d %d %d", &a, &b, &c)
		a--
		r := int64(math.Abs(float64(b-c))) + c - 1
		if r == a {
			fmt.Println(3)
		} else if r > a {
			fmt.Println(1)
		} else {
			fmt.Println(2)
		}
	}
}

package main
import(
    "fmt"
)
func main(){
	var t int
	fmt.Scan(&t)
	for i:=0;i<t;i++{
		var a,b,c int
		fmt.Scan(&a,&b,&c)
		if b >= c {
			if a-1 > b-1 {
				fmt.Println(2)
			} else if a-1 == b-1 {
				fmt.Println(3)
			} else {
				fmt.Println(1)
			}
		} else {
			if a-1 > ((c-b)*2)-1 {
				fmt.Println(2)
			} else if a-1 == ((c-b)*2)-1 {
				fmt.Println(3)
			} else {
				fmt.Println(1)
			}
		}
	}
}

package main
import(
    "fmt"
)
func main(){
	var t int
	fmt.Scan(&t)
	for i:=0;i<t;i++{
		var a,b,c int
		fmt.Scan(&a,&b,&c)
		if b >= c {
			if a-1 > b-1 {
				fmt.Println(2)
			} else if a-1 == b-1 {
				fmt.Println(3)
			} else {
				fmt.Println(1)
			}
		} else {
			if a-1 > ((c-b)*2)+1 {
				fmt.Println(2)
			} else if a-1 == ((c-b)*2)+1 {
				fmt.Println(3)
			} else {
				fmt.Println(1)
			}
		}
	}
}

package main
import(
    "fmt"
)
func main(){
	var t int
	fmt.Scan(&t)
	for i:=0;i<t;i++{
		var a,b,c int
		fmt.Scan(&a,&b,&c)
		if a-1 == abs(c-b)*2 {
			fmt.Println(3)
		} else {
			if a-1 < (c-b)*2 {
				fmt.Println(1)
			} else {
				fmt.Println(2)
			}
		}
	}
}
func abs(x int) int {
	var result int
	if x > 0 {
		result = x
	} else {
		if x < 0 {
			result = x*-1
		}
	}
	return result
}

package main
import(
    "fmt"
)
func main(){
	var t int
	fmt.Scan(&t)
	for i:=0;i<t;i++{
		var a,b,c int
		fmt.Scan(&a,&b,&c)
		if a-1 == (c-b)*2 {
			fmt.Println(3)
		} else {
			if a-1 < (c-b)*2 {
				fmt.Println(1)
			} else {
				fmt.Println(2)
			}
		}
	}
}

package main
import(
    "fmt"
)
func main(){
	var t int
	fmt.Scan(&t)
	for i:=0;i<3;i++{
		var a,b,c int
		fmt.Scan(&a,&b,&c)
		if a-1 == (c-b)*2 {
			fmt.Println(3)
		} else {
			if a-1 < (c-b)*2 {
				fmt.Println(1)
			} else {
				fmt.Println(2)
			}
		}
	}
}

package main

import (
	"fmt"
	"math"
)

func main() {
	var t int
	fmt.Scan(&t)
	for t > 0 {
		var a, b, c int
		fmt.Scan(&a, &b, &c)
		// fmt.Println(a,b,c)
		if a-1 < int(math.Abs(float64(c-b))+math.Abs(float64(c)-1)) {
			fmt.Println(1)
		} else if a-1 > int(math.Abs(float64(a-b))+math.Abs(float64(c)-1)) {
			fmt.Println(2)
		} else {
			fmt.Println(3)
		}
		t--
	}
}

// 1 2 1

package main

import (
	"fmt"
	"math"
)

func main() {
	var t int
	fmt.Scan(&t)
	for t > 0 {
		var a, b, c int
		fmt.Scan(&a, &b, &c)
		// fmt.Println(a,b,c)
		if a-1 < int(math.Abs(float64(a-b))+math.Abs(float64(c)-1)) {
			fmt.Println(1)
		} else if a-1 > int(math.Abs(float64(a-b))+math.Abs(float64(c)-1)) {
			fmt.Println(2)
		} else {
			fmt.Println(3)
		}
		t--
	}
}

// 1 2 1

package main

import (
	"fmt"
)

func main() {
	var t int
	fmt.Scan(&t)
	for t > 0 {
		var a, b, c int
		fmt.Scan(&a, &b, &c)
		// fmt.Println(a,b,c)
		if a-1 < (c-b)+(c-1) {
			fmt.Println(1)
		} else if a-1 > (c-b)+(c-1) {
			fmt.Println(2)
		} else {
			fmt.Println(3)
		}
		t--
	}
}

package main

import (
	"fmt"
)

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

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

func main() {
	var t, a, b, c int
	_, _ = fmt.Scanln(&t)

	for i := 0; i < t; i++ {
		_, _ = fmt.Scanln(&a, &b, &c)
		fmt.Println(min(abs(a - 1), abs(b - c) + abs(c - 1)) + 1)
	}
}

package main

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

func ScanInt(scanner *bufio.Scanner) int {
	if !scanner.Scan() {
		panic("nothing to scan")
	}
	str := scanner.Text()
	n, err := strconv.Atoi(str)
	if err != nil {
		panic(err)
	}
	return n
}

const whitespaceSymbols = "\t\n\v\f\r "

func splitFunc(data []byte, atEOF bool) (advance int, token []byte, err error) {
	if atEOF && len(data) == 0 {
		return 0, nil, nil
	}

	i := bytes.IndexAny(data, whitespaceSymbols)
	if i > 0 {
		return i + 1, data[:i], nil
	}
	if i == -1 {
		if atEOF {
			return len(data), data, nil
		}
		return 0, nil, nil
	}

	trimmed := bytes.TrimLeft(data, whitespaceSymbols)
	advance = len(data) - len(trimmed)
	if atEOF && len(trimmed) != 0 {
		trimmed = trimmed[:bytes.IndexAny(trimmed, whitespaceSymbols)]
		return advance + len(trimmed), trimmed, nil
	}
	return advance, nil, nil
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Buffer(nil, 1<<30)
	scanner.Split(splitFunc)
	t := ScanInt(scanner)
	for i := 0; i < t; i++ {
		a := ScanInt(scanner)
		b := ScanInt(scanner)
		c := ScanInt(scanner)
		if b > c {
			switch {
			case a < c:
				fmt.Println(1)
			case a == c:
				fmt.Println(3)
			default:
				fmt.Println(2)
			}
			continue
		}
		switch {
		case a-1 < c-b+c-1:
			fmt.Println(1)
		case a-1 == c-b+c-1:
			fmt.Println(3)
		default:
			fmt.Println(2)
		}
	}
}

package main

import "fmt"

func main() {
	var t int
	fmt.Scanf("%d", &t)
	for i := 0; i < t; i++ {
		var a, b, c int
		fmt.Scanf("%d %d %d", &a, &b, &c)
		if b > c {
			switch {
			case a < c:
				fmt.Println(1)
			case a == c:
				fmt.Println(3)
			default:
				fmt.Println(2)
			}
			continue
		}
		switch {
		case a-1 < c-b+c-1:
			fmt.Println(1)
		case a-1 == c-b+c-1:
			fmt.Println(3)
		default:
			fmt.Println(2)
		}
	}
}

package main

import (
	"fmt"
	"io/ioutil"
	"os"
	"strconv"
	"strings"
	"sync"
	"time"
)

func main() {
	data, _ := ioutil.ReadAll(os.Stdin)
	ctroki := strings.Split(string(data), "\r\n")
	n, _ := strconv.Atoi(ctroki[0])
	pos := 1

	var wg sync.WaitGroup
	wg.Add(n)
	ch := make(chan struct{})

	go func() {
		wg.Wait()
		close(ch)
	}()
	timeout := 5 * time.Second

	output := make([]string, n)
	for i := 0; i < n; i++ {
		if ctroki[pos] == "" {
			continue
		}
		go atomicTotal(&output[i], ctroki[pos], &wg)

		pos = pos + 1
	}
	select {
	case <-time.After(timeout):
		fmt.Println(strings.Join(output, "\n"))
	case <-ch:
		fmt.Println(strings.Join(output, "\n"))
	}

}

func atomicTotal(output *string, nabor string, wg *sync.WaitGroup) {
	defer wg.Done()
	arr := strings.Split(nabor, " ")

	n1 := atoi(arr[0])
	n2 := atoi(arr[1])
	n3 := atoi(arr[2])

	if n1 == 1 || n3-n2+n3-1 > n1-1 {
		*output = fmt.Sprint(1)
	} else if n3-n2+n3-1 < n1-1 {
		*output = fmt.Sprint(2)
	} else {
		*output = fmt.Sprint(3)
	}

}

func atoi(str string) int64 {
	var n int64
	for i := 0; i < len(str); i++ {
		var char byte = '0'
		s := str[i]
		c := 0
		for s != char {
			char++
			c++
		}
		n = n*10 + int64(c)
	}
	return n
}

package main

import (
	"fmt"
	"io/ioutil"
	"os"
	"strconv"
	"strings"
	"sync"
	"time"
)

func main() {
	data, _ := ioutil.ReadAll(os.Stdin)
	ctroki := strings.Split(string(data), "\r\n")
	n, _ := strconv.Atoi(ctroki[0])
	pos := 1

	var wg sync.WaitGroup
	wg.Add(n)
	ch := make(chan struct{})

	go func() {
		wg.Wait()
		close(ch)
	}()
	timeout := 5 * time.Second

	output := make([]string, n)
	for i := 0; i < n; i++ {
		if ctroki[pos] == "" {
			continue
		}
		go atomicTotal(&output[i], ctroki[pos], &wg)

		pos = pos + 1
	}
	select {
	case <-time.After(timeout):
		fmt.Println(strings.Join(output, "\n"))
	case <-ch:
		fmt.Println(strings.Join(output, "\n"))
	}

}

func atomicTotal(output *string, nabor string, wg *sync.WaitGroup) {
	defer wg.Done()
	arr := strings.Split(nabor, " ")

	n1 := atoi(arr[0])
	n2 := atoi(arr[1])
	n3 := atoi(arr[2])

	if n3-n2+n3-1 > n1-1 {
		*output = fmt.Sprint(1)
	} else if n3-n2+n3-1 < n1-1 {
		*output = fmt.Sprint(2)
	} else {
		*output = fmt.Sprint(3)
	}

}

func atoi(str string) int64 {
	var n int64
	for i := 0; i < len(str); i++ {
		var char byte = '0'
		s := str[i]
		c := 0
		for s != char {
			char++
			c++
		}
		n = n*10 + int64(c)
	}
	return n
}

package main

import (
	"fmt"
)

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

func main() {
	var N int;
	fmt.Scan(&N);

	for T := 0; T < N; T++ {
		var a, b, c int;
		fmt.Scan(&a, &b, &c);
		x := a - 1;
		y := abs(b - c) + c - 1;
		if (x < y) {
			println(1);
		} else if (x > y) {
			println(2);
		} else {
			println(3);
		}
	}
}

// cf1729a project main.go
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.Fscanf(r, "%d", &t)
	for i := 0; i < t; i++ {
		var a, b, c int64
		fmt.Fscanf(r, "%d %d %d", &a, &b, &c)
		var x int64 = 0
		if b > c {
			x = b
		} else {
			x = c + c - b
		}
		var r int64 = 3
		if a < x {
			r = 1
		} else if a > x {
			r = 2
		}
		fmt.Fprintln(w, r)
	}
}

package main

import "fmt"

func main() {

	var tc int

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

	for t := 1; t <= tc; t++ {
		var a, b, c int
		fmt.Scanf("%d %d %d", &a, &b, &c)
		if b < c {
			b = (c - b) + c
		}
		ans := 0
		if a < b {
			ans = 1
		}
		if a > b {
			ans = 2
		}
		if a == b {
			ans = 3
		}
		fmt.Println(ans)
	}

}


package main
import (
	"fmt"
	"unicode/utf8"
)
func main() {
	var a,p,temp string
	p = "/"
	var n int
	fmt.Scan(&n)
	for i:=0;i<n;i++ {
		fmt.Scan(&a)
		if a=="cd" {
			fmt.Scan(&a)
			a+="/"
			lena:= utf8.RuneCountInString(a)
			for j:=0;j<lena;j++ {
				temp+=string(a[j])
				if string(a[j])==string("/") {
					if temp==string("/") {
						p=temp
					} else if temp==string("../") {
						  lenp:=utf8.RuneCountInString(p)-1
						for k:=lenp;;k-- {
							if k==0 {
								break
							}
							if string(p[k-1])==string("/") {
								break
							} else {lenp--}
						}
						p=p[0:lenp]
					} else {
						p+=temp
					}
					temp=string("")
				}
			}
		} else { fmt.Println(p)}
	}
}

package main

import (
	"fmt"
	"strings"
)

type FilePath []string

func (fp *FilePath) Process(path string) {
	if path[0] == '/' {
		fp.clear()
	}

	tokens := strings.Split(strings.TrimPrefix(strings.TrimSuffix(path, "/"), "/"), "/")
	for _, token := range tokens {
		switch token {
		case "..":
			*fp = (*fp)[:len(*fp)-1]
		case ".":
			continue
		default:
			*fp = append(*fp, token)
		}
	}
}

func (fp *FilePath) clear() {
	*fp = (*fp)[:0]
}

func (fp *FilePath) String() string {
	str := "/" + strings.Join(*fp, "/")
	if str != "/" {
		str += "/"
	}
	return str
}

var (
	n        int
	command  string
	path     string
	filePath *FilePath
)

func main() {
	filePath = new(FilePath)
	fmt.Scan(&n)
	for n > 0 {
		fmt.Scan(&command)
		switch command {
		case "pwd":
			fmt.Println(filePath)
		case "cd":
			fmt.Scan(&path)
			filePath.Process(path)
		}
		n--
	}
}

package main

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

const PWD, CD, PRE_MAKR, CUR_MAKR, SEP_MARK string = "pwd", "cd", "..", ".", "/"

var in = bufio.NewScanner(os.Stdin)

func main() {
  in.Scan()
  n, _ := strconv.Atoi(in.Text())

  curPath := make([]string, 1, 200)
  curPath[0] = ""

  for i := 0; i < n; i++ {
    in.Scan()
    cmd := in.Text()
    if cmd == PWD {
      printPath(curPath)
    } else {
      cdPath := cmd[3:len(cmd)]
      path := strings.Split(cdPath, SEP_MARK)
      for j := 0; j < len(path); j++ {
        if path[j] == "" {
          curPath = path[0:1]
        } else if path[j] == ".." {
          curPath = curPath[0 : len(curPath)-1]
        } else {
          curPath = append(curPath, path[j])
        }
      }
    }
  }
}

func printPath(path []string) {
  len := len(path)
  for i := 0; i < len; i++ {
    fmt.Printf("%s%s", path[i], SEP_MARK)
  }
  fmt.Printf("\n")
}

package main

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

const PWD, PRE_MAKR, SEP_MARK string = "pwd", "..", "/"

var in = bufio.NewScanner(os.Stdin)

func main() {
  in.Scan()
  n, _ := strconv.Atoi(in.Text())

  curPath := make([]string, 1, 200)
  curPath[0] = ""

  for i := 0; i < n; i++ {
    in.Scan()
    cmd := in.Text()
    if cmd == PWD {
      printPath(curPath)
    } else {
      cdPath := cmd[3:len(cmd)]
      path := strings.Split(cdPath, SEP_MARK)
      for j := 0; j < len(path); j++ {
        if path[j] == "" {
          curPath = path[0:1]
        } else if path[j] == PRE_MAKR {
          curPath = curPath[0 : len(curPath)-1]
        } else {
          curPath = append(curPath, path[j])
        }
      }
    }
  }
}

func printPath(path []string) {
  len := len(path)
  for i := 0; i < len; i++ {
    fmt.Printf("%s%s", path[i], SEP_MARK)
  }
  fmt.Printf("\n")
}

package main

import "fmt"

func main() {
    var n int
    var cmd, s string
    dir := []string{"/"}
    fmt.Scan(&n)
    for i := 0; i < n; i++ {
        fmt.Scan(&cmd)
        if cmd == "pwd" {
            for _, v := range dir {
                fmt.Print(v)
            }
            fmt.Println()
        } else {
            fmt.Scan(&s)
            in := 0
            if s[0] == '/' {
                dir = dir[0:1]
                in++
            }
            for ; in < len(s); in++ {
                temp_s := ""
                for ; s[in] != '/'; in++ {
                    temp_s += string(s[in])
                    if (in+1) == len(s) { break }
                }
                if temp_s == ".." {
                    dir = dir[0:len(dir)-1]
                } else {
                    dir = append(dir,temp_s+"/")
                }
            }
        }
    }
}

package main

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

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

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

	cur := []string{""}
	for i := 0; i < n; i++ {
		var cmd string
		fmt.Fscanf(r, "%s", &cmd)
		switch cmd {
		case "pwd":
			fmt.Fscanf(r, "\n")
			fmt.Println(strings.Join(cur, "/") + "/")
		case "cd":
			p, _ := r.ReadString('\n')
			p = p[1 : len(p)-2]
			if p[0] == '/' {
				cur = nil
			}
			for _, t := range strings.Split(p, "/") {
				if t == ".." {
					cur = cur[:len(cur)-1]
				} else {
					cur = append(cur, t)
				}
			}
		}
	}
}

package main

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

const PWD, CD, PRE_MAKR, CUR_MAKR, SEP_MARK string = "pwd", "cd", "..", ".", "/"

var in = bufio.NewScanner(os.Stdin)

func main() {
  in.Scan()
  n, _ := strconv.Atoi(in.Text())

  curPath := make([]string, 1, 200)
  curPath[0] = ""

  for i := 0; i < n; i++ {
    in.Scan()
    cmd := in.Text()
    if cmd == PWD {
      printPath(curPath)
    } else {
      cdPath := cmd[3:len(cmd)]
      path := strings.Split(cdPath, SEP_MARK)
      if path[0] == "" {
        curPath = path
      } else {
        for j := 0; j < len(path); j++ {
          if path[j] == ".." {
            curPath = curPath[0 : len(curPath)-1]
          } else {
            curPath = append(curPath, path[j])
          }
        }
      }
    }
  }
}

func printPath(path []string) {
  fmt.Printf("%s", SEP_MARK)
  len := len(path)
  for i := 1; i < len; i++ {
    if i == len-1 || path[i+1] == "" {
      fmt.Printf("%s", path[i])
      break
    }
    fmt.Printf("%s%s", path[i], SEP_MARK)
  }
  fmt.Printf("\n")
}

package main

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

const PWD, CD, PRE_MAKR, CUR_MAKR, SEP_MARK string = "pwd", "cd", "..", ".", "/"

var in = bufio.NewScanner(os.Stdin)

func main() {
  in.Scan()
  n, _ := strconv.Atoi(in.Text())

  curPath := make([]string, 1, 200)
  curPath[0] = ""

  for i := 0; i < n; i++ {
    in.Scan()
    cmd := in.Text()
    if cmd == PWD {
      printPath(curPath)
    } else {
      cdPath := cmd[3:len(cmd)]
      path := strings.Split(cdPath, SEP_MARK)
      for j := 0; j < len(path); j++ {
        if path[j] == "" {
        } else if path[j] == ".." {
          curPath = curPath[0 : len(curPath)-1]
        } else {
          curPath = append(curPath, path[j])
        }
      }
    }
  }
}

func printPath(path []string) {
  len := len(path)
  for i := 0; i < len; i++ {
    fmt.Printf("%s%s", path[i], SEP_MARK)
  }
  fmt.Printf("\n")
}

package main

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

const PWD, CD, PRE_MAKR, CUR_MAKR, SEP_MARK string = "pwd", "cd", "..", ".", "/"

var in = bufio.NewScanner(os.Stdin)

func main() {
  in.Scan()
  n, _ := strconv.Atoi(in.Text())

  curPath := make([]string, 1, 200)
  curPath[0] = ""

  for i := 0; i < n; i++ {
    in.Scan()
    cmd := in.Text()
    if cmd == PWD {
      printPath(curPath)
    } else {
      cdPath := cmd[3:len(cmd)]
      path := strings.Split(cdPath, SEP_MARK)
      if path[0] == "" {
        curPath = path
      } else {
        for j := 0; j < len(path); j++ {
          if path[j] == ".." {
            curPath = curPath[0 : len(curPath)-1]
          } else {
            curPath = append(curPath, path[j])
          }
        }
      }
    }
  }
}

func printPath(path []string) {
  fmt.Printf("%s", SEP_MARK)
  len := len(path)
  for i := 1; i < len; i++ {
    fmt.Printf("%s%s", path[i], SEP_MARK)
  }
  fmt.Printf("\n")
}

package main

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

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

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

	cur := []string{""}
	for i := 0; i < n; i++ {
		var cmd string
		fmt.Fscanf(r, "%s", &cmd)
		switch cmd {
		case "pwd":
			fmt.Fscanf(r, "\n")
			fmt.Println(strings.Join(cur, "/") + "/")
		case "cd":
			p, _ := r.ReadString('\n')
			p = p[1 : len(p)-1]
			if p[0] == '/' {
				cur = nil
			}
			for _, t := range strings.Split(p, "/") {
				if t == ".." {
					cur = cur[:len(cur)-1]
				} else {
					cur = append(cur, t)
				}
			}
		}
	}
}


package main
import(
    "fmt"
    "bufio"
    "os"
    "strings"
)
type coords struct{
	row int
	column int
}
func main() {
	in:= bufio.NewReader(os.Stdin)
	out:= bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	fmt.Fscan(in,&t)
	for i:=0;i<t;i++{
		var n int
		fmt.Fscan(in,&n)
		var word string
		fmt.Fscan(in,&word)
		a:=strings.Count(word,"a")
		b:= strings.Count(word,"b")
		if a == 0 || b == 0 {
			fmt.Fprintln(out, -1,-1)
		} else {
			for j:=1;j<n;j++{
				if (string(word[j]) == "a" && string(word[j-1]) == "b") || (string(word[j]) == "b" && string(word[j-1]) == "a"){
					fmt.Fprintln(out,j,j+1)
					break
				}
			}
		}
	}
}

package main

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

type Scanner struct {
	*bufio.Scanner
}

func NewWordScanner(reader io.Reader) *Scanner {
	scanner := bufio.NewScanner(reader)
	scanner.Split(bufio.ScanWords)
	return &Scanner{scanner}
}

func (s *Scanner) Word() string {
	s.Scan()
	return s.Text()
}

func (s *Scanner) Int() int {
	s.Scan()
	n, _ := strconv.Atoi(s.Text())
	return n
}

func (s *Scanner) Int64() int64 {
	s.Scan()
	n, _ := strconv.ParseInt(s.Text(), 10, 64)
	return n
}

func (s *Scanner) Words(count int) []string {
	words := make([]string, count)
	for i := range words {
		words[i] = s.Word()
	}
	return words
}

func (s *Scanner) Ints(count int) []int {
	ints := make([]int, count)
	for i := range ints {
		ints[i] = s.Int()
	}
	return ints
}

func (s *Scanner) Int64s(count int) []int64 {
	int64s := make([]int64, count)
	for i := range int64s {
		int64s[i] = s.Int64()
	}
	return int64s
}

func solve(n int, s string) {

	for i := 1; i < n; i++ {
		if s[i] != s[i-1] {
			fmt.Println(i, i+1)
			return
		}
	}

	fmt.Println("-1 -1")

}

func main() {
	stdin := NewWordScanner(os.Stdin)
	tests := stdin.Int()

	for i := 0; i < tests; i++ {
		n, s := stdin.Int(), stdin.Word()
		solve(n, s)
	}
}

package main

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

type Scanner struct {
	*bufio.Scanner
}

func NewWordScanner(reader io.Reader) *Scanner {
	scanner := bufio.NewScanner(reader)
	scanner.Split(bufio.ScanWords)
	return &Scanner{scanner}
}

func (s *Scanner) Word() string {
	s.Scan()
	return s.Text()
}

func (s *Scanner) Int() int {
	s.Scan()
	n, _ := strconv.Atoi(s.Text())
	return n
}

func (s *Scanner) Int64() int64 {
	s.Scan()
	n, _ := strconv.ParseInt(s.Text(), 10, 64)
	return n
}

func (s *Scanner) Words(count int) []string {
	words := make([]string, count)
	for i := range words {
		words[i] = s.Word()
	}
	return words
}

func (s *Scanner) Ints(count int) []int {
	ints := make([]int, count)
	for i := range ints {
		ints[i] = s.Int()
	}
	return ints
}

func (s *Scanner) Int64s(count int) []int64 {
	int64s := make([]int64, count)
	for i := range int64s {
		int64s[i] = s.Int64()
	}
	return int64s
}

func solve(n int, s string) {
	suma := make([]int, n+1)
	sumb := make([]int, n+1)

	for i, c := range s {
		suma[i+1] = suma[i]
		sumb[i+1] = sumb[i]
		if c == 'a' {
			suma[i+1] = suma[i+1] + 1
		} else {
			sumb[i+1] = sumb[i+1] + 1
		}
	}
	ans := 0
	for i := 1; i <= n; i++ {
		for j := i + 1; j <= n; j++ {
			if suma[j]-suma[i-1] == sumb[j]-sumb[i-1] {
				fmt.Println(i, j)
				return

			}
		}
	}

	if ans == 0 {
		fmt.Println("-1 -1")
	}

}

func main() {
	stdin := NewWordScanner(os.Stdin)
	tests := stdin.Int()

	for i := 0; i < tests; i++ {
		n, s := stdin.Int(), stdin.Word()
		solve(n, s)
	}
}

package main

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

func Problem1569A(r io.Reader, w io.Writer) {
	in := bufio.NewReader(r)
	out := bufio.NewWriter(w)
	defer out.Flush()

	t := 0
	fmt.Fscanln(in, &t)

	for tcNo := 0; tcNo < t; tcNo++ {
		n := 0
		s := ""
		fmt.Fscanln(in, &n)
		fmt.Fscanln(in, &s)

		countA := 0
		countB := 0
		l := -1
		r := -1
		for i, c := range s {
			switch c {
			case 'a':
				countA++
			case 'b':
				countB++
			}
			if countA == 0 || countB == 0 {
				continue
			}
			if countA > 0 && countB > 0 {
				l = i
				r = i + 1
				break
			}
		}
		fmt.Fprintf(out, "%d %d\n", l, r)
	}
}

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

package main

import (
	"fmt"
)

const N = 100

func getB(x int , n int) int {
	return n - x
}

func foo() {
	var n int
	var s string
	fmt.Scan(&n,&s)
	var a, b [N]int
	cnta := 0
	cntb := 0
	for i := 1; i <= n; i++ {
		if s[i-1] == 'a' {
			cnta++
		} else {
			cntb++
		}
		a[i] = cnta
		b[i] = cntb
	}
	for i := 1; i <= n - 1; i++ {
		for j := n; j > i; j-- {
			cntal := a[i-1]
			cntbl := b[i-1]
			cntar := a[j]
			cntbr := b[j]
			if cntbr - cntbl == cntar - cntal{
				fmt.Println(i, j)
				return
			}
		}
	}
	fmt.Println(-1,-1)
}

func main() {
	var t int
	fmt.Scan(&t)
	for t > 0 {
		t--
		foo()
	}
}

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 _int() int {
	s := _string()
	i := 0
	if s[0] == '-' {
		for _, r := range s[1:] {
			i *= 10
			i -= int(r - '0')
		}
		return i
	}
	for _, r := range s {
		i *= 10
		i += int(r - '0')
	}
	return i
}

func _int64() int64 {
	s := _string()
	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 _string() string {
	if !scanner.Scan() {
		panic(scanner.Err())
	}
	return scanner.Text()
}

func main() {
	defer writer.Flush()
	for t := _int(); t > 0; t-- {
		n := _int()
		s := _string()
		l, r := sol(n, s)
		printf("%d %d\n", l, r)
	}
}

func sol(n int, s string) (int, int) {
	for i := range s {
		if i > 0 && s[i] != s[i-1] {
			return i, i + 1
		}
	}
	return -1, -1
}

package main

import "fmt"

var t, n int
var s string
var frekA, frekB []int

func main() {
	fmt.Scanln(&t)
	for {
		if t == 0 {
			break
		}
		frekA := make([]int, 55)
		frekB := make([]int, 55)
		fmt.Scanln(&n)
		fmt.Scanln(&s)

		for i, c := range s {
			if i == 0 {
				if s[0] == 97 {
					frekA[0] = 1
				} else {
					frekB[0] = 1
				}
				continue
			}

			frekA[i] = frekA[i-1]
			frekB[i] = frekB[i-1]

			if c == 97 {
				frekA[i]++
			} else {
				frekB[i]++
			}
		}

		ansL := -1
		ansR := -1
		for i := 0; i < n; i++ {
			for j := i + 1; j < n; j++ {
				cntA := getCount(frekA, i, j)
				cntB := getCount(frekB, i, j)

				if cntA == cntB {
					ansL = i + 1
					ansR = j + 1
					break
				}
			}
		}
		fmt.Println(ansL, ansR)
		t--
	}
}

func getCount(arr []int, l int, r int) int {
	if l == 0 {
		return arr[r]
	}
	return arr[r] - arr[l-1]
}

package main

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

func solve() {
	f := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)
	N, n, s := 0, 0, ""
	fmt.Fscan(f, &N)
	for i := 0; i < N; i++ {
		fmt.Fscan(f, &n, &s)
		l := strings.Index(s, "ab")
		if l > -1 {
			fmt.Fprintln(w, l+1, l+2)
			continue
		}
		l = strings.Index(s, "ba")
		if l > -1 {
			fmt.Fprintln(w, l+1, l+2)
		} else {
			fmt.Fprintln(w, -1, -1)
		}
	}
	w.Flush()
}

func main() {
	solve()
}

package main

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

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

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

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

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

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

/**
Run solve the problem CF1569A
Date: 18/11/21
User: pepradere
URL: https://codeforces.com/problemset/problem/1569/A
Problem: CF1569A
**/
func (in *CF1569A) Run() {

	t := in.NextInt()
	for ;t > 0; t-- {
		in.NextInt()
		str := in.NextString()

		index := strings.Index(str, "ab")
		if index == -1 {
			index = strings.Index(str, "ba")
		}

		if index == -1 {
			fmt.Println(-1,-1)
		}else {
			fmt.Println(index+1, index+2)
		}
	}
}

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

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

package main

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

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

func main() {
	fmt.Fscan(reader, &t)
	for ; t > 0; t-- {
		fmt.Fscan(reader, &n)
		fmt.Fscan(reader, &s)
		var ca, cb int
		for _, k := range s {
			if k == 'a' {
				ca++
			} else {
				cb++
			}
		}
		if ca == 0 || cb == 0 {
			fmt.Println("-1 -1")
			continue
		}
		for i := range s {
			if s[i] != s[i+1] {
				fmt.Printf("%d %d\n", i+1, i+2)
				break
			}
		}
	}
}

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

func main() {
	var t int
	scanf("%d\n", &t)
	s := make([]byte, 53)
	for ; t > 0; t-- {
		var n int
		scanf("%d\n", &n)
		scanf("%s\n", &s)
		var l = -1
		var r = -1
		for i := 1; i < n; i++ {
			if l == -1 && s[i-1] != s[i] {
				l = i - 1 + 1
				r = i + 1
			}
		}
		printf("%d %d\n", l, r)
	}
	writer.Flush()
}

package main

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

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

func readInt() int{
	var n int
	fmt.Fscan(in, &n)
	return n
}

func readToken() string{
	var s string
	fmt.Fscan(in, &s)
	return s
}

func Solve(){
	var n int = readInt()
	var s string  = readToken()
	for i := 1; i <= n-1; i++{
		if s[i-1] != s[i]{
			fmt.Println(i, i+1)
			return
		}
	}
	fmt.Println(-1, -1)
}

func main(){
	var t int = readInt()
	for ;t>0;t--{
		Solve()
	}
}

package main

import "fmt"

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

	for ; testcases > 0; testcases-- {
		var (
			n    int
			str  string
			flag bool = true
		)

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

		for iterator, _ := range str {
			if iterator != 0 {
				if str[iterator] != str[iterator-1] {
					flag = false
                    fmt.Println(iterator , iterator + 1)
                    break
				}
			}
		}
        if flag {
            fmt.Println("-1 -1")
        }
	}

}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	tc := readInt(in)

	for i := 0; i < tc; i++ {
        n := readInt(in)
        line := readLine(in)
        l, r := -1, -1
        for i := 0; i < n-1; i++ {
            for j := i+1; j < n; j++ {
                if isBalanced(line[i:j+1]) {
                    l, r = i+1, j+1
                    break
                }
            }
            if l != -1 || r != -1 {
                break
            }
        }
        fmt.Println(l, r)
	}
}

func isBalanced(line string) bool {
    countA, countB := 0, 0
    if len(line) % 2 == 1 {
        return false
    }
    for _, l := range line {
        if l == 'a' {
            countA++
        } else {
            countB++
        }
    }
    return countA == countB
}

func readInt(in *bufio.Reader) int {
	nStr, _ := in.ReadString('\n')
	nStr = strings.ReplaceAll(nStr, "\r", "")
	nStr = strings.ReplaceAll(nStr, "\n", "")
	n, _ := strconv.Atoi(nStr)
	return n
}

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

func readLineNumbs(in *bufio.Reader) []string {
	line, _ := in.ReadString('\n')
	line = strings.ReplaceAll(line, "\r", "")
	line = strings.ReplaceAll(line, "\n", "")
	numbs := strings.Split(line, " ")
	return numbs
}

func readArrInt(in *bufio.Reader) []int {
	numbs := readLineNumbs(in)
	arr := make([]int, len(numbs))
	for i, n := range numbs {
		val, _ := strconv.Atoi(n)
		arr[i] = val
	}
	return arr
}

func readArrInt64(in *bufio.Reader) []int64 {
	numbs := readLineNumbs(in)
	arr := make([]int64, len(numbs))
	for i, n := range numbs {
		val, _ := strconv.ParseInt(n, 10, 64)
		arr[i] = val
	}
	return arr
}

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

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 MINN(x, y int) int {
	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 MAXX(x, y int) int {
	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 {
	if x*y == 0 {
		return MAX(x, y)
	} else {
		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
}

func MODULE(x, y int) int {
	if x > y {
		return x - y
	} else {
		return y - x
	}
}

func BITAND(x, y int64) int64 {
	var ans int64
	begin := x
	sec := y
	var count int64 = 1
	for 1 == 1 {
		if (begin%2)*(sec%2) == 1 {
			ans = ans + count
			count = count * 2
			begin = int64(begin / 2)
			sec = int64(sec / 2)
			if begin*sec == 0 {
				break
			}

		} else {
			count = count * 2
			begin = int64(begin / 2)
			sec = int64(sec / 2)
			if begin*sec == 0 {
				break
			}
		}
	}
	return ans
}

func Sum(n, m int) int {
	var ans int

	if n == 1 {
		return 0
	} else {
		for i := 2; i < n; i++ {
			ans = (ans + Sum(i, m)) % m
		}
		for j := 2; j < n+1; j++ {
			ans = (ans + Sum(n/j, m)) % m
		}
		return ans
	}
}

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 int
		fmt.Fscan(input, &n)

		STRING := make([]byte, 0)
		fmt.Fscan(input, &STRING)

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

		var ans int
		for i := 0; i < n-1; i++ {
			if string(STRING[i]) == "a" {
				if string(STRING[i+1]) == "b" {
					ans = i + 1
					break
				}

			} else {
				if string(STRING[i+1]) == "a" {
					ans = i + 1
					break
				}

			}

		}

		if ans > 0 {
			fmt.Println(ans)
			fmt.Println(ans + 1)
		} else {
			fmt.Println(-1)
			fmt.Println(-1)

		}

	}
}

package main

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

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

func main() {
	var test = 1
	fmt.Fscan(in, &test)
	for i := 0; i < test; i++ {
		solve()
	}

}

func solve() {
	var n int
	fmt.Fscan(in, &n)
	var givenString string
	fmt.Fscan(in, &givenString)
	var hasfound = false
	right := 0
	left := 0
	for i := 1; i < len(givenString); i++ {
		if givenString[i-1] != givenString[i] {
			hasfound = true
			right = i + 1
			left = i
			break
		}
	}
	if hasfound {
		fmt.Println(left, right)
	} else {
		fmt.Println(-1, -1)
	}
}

//x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-TEMPLATE_STARTING-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-

type pair struct {
	a int64
	b int64
}

func sortPair(pairs []pair) {
	sort.Slice(pairs, func(i, j int) bool {
		return pairs[i].a < pairs[j].a
	})
}
func min(a int64, b int64) int64 {
	if a < b {
		return a
	}
	return b
}
func max(a int64, b int64) int64 {
	if a > b {
		return a
	}
	return b
}

func printArray(arr []int) {
	for i := 1; i < len(arr); i++ {
		fmt.Print(arr[i], " ")
	}
	fmt.Println()
}

type runeSort []rune

func (r runeSort) Len() int           { return len(r) }
func (r runeSort) Swap(i, j int)      { r[i], r[j] = r[j], r[i] }
func (r runeSort) Less(i, j int) bool { return r[i] < r[j] }

package main

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

func main() {
	r := bufio.NewReaderSize(os.Stdin, 1024*1024)

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

	for t := 0; t < T; t++ {
		var n int
		var s string

		fmt.Fscanf(r, "%d\n%s\n", &n, &s)

		found := false
		for i := 0; i < n; i++ {
			a := 0
			b := 0
			for j := i; j < n; j++ {
				if s[j] == 'a' {
					a++
				}
				if s[j] == 'b' {
					b++
				}
				if a == b {
					fmt.Println(i+1, j+1)
					found = true
					break
				}
			}
			if found {
				break
			}
		}

		if !found {
			fmt.Println(-1, -1)
		}
	}
}

package main

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

type Scanner struct {
	*bufio.Scanner
}

func NewWordScanner(reader io.Reader) *Scanner {
	scanner := bufio.NewScanner(reader)
	scanner.Split(bufio.ScanWords)
	return &Scanner{scanner}
}

func (s *Scanner) Word() string {
	s.Scan()
	return s.Text()
}

func (s *Scanner) Int() int {
	s.Scan()
	n, _ := strconv.Atoi(s.Text())
	return n
}

func (s *Scanner) Int64() int64 {
	s.Scan()
	n, _ := strconv.ParseInt(s.Text(), 10, 64)
	return n
}

func (s *Scanner) Words(count int) []string {
	words := make([]string, count)
	for i := range words {
		words[i] = s.Word()
	}
	return words
}

func (s *Scanner) Ints(count int) []int {
	ints := make([]int, count)
	for i := range ints {
		ints[i] = s.Int()
	}
	return ints
}

func (s *Scanner) Int64s(count int) []int64 {
	int64s := make([]int64, count)
	for i := range int64s {
		int64s[i] = s.Int64()
	}
	return int64s
}

func solve(n int, s string) {

	for i := 1; i < n; i++ {
		if s[i] != s[i-1] {
			fmt.Println(i-1, i)
			return
		}
	}

	fmt.Println("-1 -1")

}

func main() {
	stdin := NewWordScanner(os.Stdin)
	tests := stdin.Int()

	for i := 0; i < tests; i++ {
		n, s := stdin.Int(), stdin.Word()
		solve(n, s)
	}
}

package main

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

type Scanner struct {
	*bufio.Scanner
}

func NewWordScanner(reader io.Reader) *Scanner {
	scanner := bufio.NewScanner(reader)
	scanner.Split(bufio.ScanWords)
	return &Scanner{scanner}
}

func (s *Scanner) Word() string {
	s.Scan()
	return s.Text()
}

func (s *Scanner) Int() int {
	s.Scan()
	n, _ := strconv.Atoi(s.Text())
	return n
}

func (s *Scanner) Int64() int64 {
	s.Scan()
	n, _ := strconv.ParseInt(s.Text(), 10, 64)
	return n
}

func (s *Scanner) Words(count int) []string {
	words := make([]string, count)
	for i := range words {
		words[i] = s.Word()
	}
	return words
}

func (s *Scanner) Ints(count int) []int {
	ints := make([]int, count)
	for i := range ints {
		ints[i] = s.Int()
	}
	return ints
}

func (s *Scanner) Int64s(count int) []int64 {
	int64s := make([]int64, count)
	for i := range int64s {
		int64s[i] = s.Int64()
	}
	return int64s
}

func solve(n int, s string) {

	for i := 1; i < n; i++ {
		if s[i] != s[i-1] {
			fmt.Println(i-1, i)
		}
	}

	fmt.Println("-1 -1")

}

func main() {
	stdin := NewWordScanner(os.Stdin)
	tests := stdin.Int()

	for i := 0; i < tests; i++ {
		n, s := stdin.Int(), stdin.Word()
		solve(n, s)
	}
}

package main
import(
    "fmt"
    "bufio"
    "os"
    "strings"
)
type coords struct{
	row int
	column int
}
func main() {
	in:= bufio.NewReader(os.Stdin)
	out:= bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	fmt.Fscan(in,&t)
	for i:=0;i<t;i++{
		var n int
		fmt.Fscan(in,&n)
		var word string
		fmt.Fscan(in,&word)
		a:=strings.Count(word,"a")
		b:= strings.Count(word,"b")
		if a == 1 || b == 1 {
			fmt.Fprintln(out, -1,-1)
		} else {
			for j:=1;j<n;j++{
				if (string(word[j]) == "a" && string(word[j-1]) == "b") || (string(word[j]) == "a" && string(word[j-1]) == "b"){
					fmt.Fprintln(out,j,j+1)
					break
				}
			}
		}
	}
}

package main

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

func Problem1569A(r io.Reader, w io.Writer) {
	in := bufio.NewReader(r)
	out := bufio.NewWriter(w)
	defer out.Flush()

	t := 0
	fmt.Fscanln(in, &t)

	for tcNo := 0; tcNo < t; tcNo++ {
		n := 0
		s := ""
		fmt.Fscanln(in, &n)
		fmt.Fscanln(in, &s)

		countA := 0
		countB := 0
		l := -1
		r := -1
		for i, c := range s {
			switch c {
			case 'a':
				countA++
			case 'b':
				countB++
			}
			if countA == 0 || countB == 0 {
				continue
			}
			if countA > 0 && countB > 0 {
				l = i - 1
				r = i + 1
				break
			}
		}
		fmt.Fprintf(out, "%d %d\n", l, r)
	}
}

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

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 _int() int {
	s := _string()
	i := 0
	if s[0] == '-' {
		for _, r := range s[1:] {
			i *= 10
			i -= int(r - '0')
		}
		return i
	}
	for _, r := range s {
		i *= 10
		i += int(r - '0')
	}
	return i
}

func _int64() int64 {
	s := _string()
	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 _string() string {
	if !scanner.Scan() {
		panic(scanner.Err())
	}
	return scanner.Text()
}

func main() {
	defer writer.Flush()
	for t := _int(); t > 0; t-- {
		n := _int()
		s := _string()
		l, r := sol(n, s)
		printf("%d %d\n", l, r)
	}
}

func sol(n int, s string) (int, int) {
	countA := 0
	countB := 0
	for i := range s {
		if s[i] == 'a' {
			countA++
		}
		if s[i] == 'b' {
			countB++
		}
		if countA != countB && i >= 1 {
			return 1, i + 1
		}
	}
	return -1, -1
}