package main

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

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

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

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

var err error

func next() (n string) {
	for {
		_, err = scanf("%v", &n)
		if err == nil {
			return n
		}
		if err.Error() == "EOF" {
			return ""
		}
	}
}

func nextInt() (n int) {
	for {
		_, err = scanf("%v", &n)
		if err == nil {
			return n
		}
		if err.Error() == "EOF" {
			return 0
		}
	}
}

func nextLong() (n int64) {
	for {
		_, err = scanf("%v", &n)
		if err == nil {
			return n
		}
		if err.Error() == "EOF" {
			return 0
		}
	}
}

func nextDouble() (n float64) {
	for {
		_, err = scanf("%v", &n)
		if err == nil {
			return n
		}
		if err.Error() == "EOF" {
			return 0
		}
	}
}

func Fill(a []int, v int) {
	for i := range a {
		a[i] = v
	}
}

func FillB(a []bool, v bool) {
	for i := range a {
		a[i] = v
	}
}

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 Abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func Gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return Gcd(b, a%b)
}

const mod = 998244353

func Add(a, b int64) int64 {
	return (a + b) % mod
}

func Mult(a, b int64) int64 {
	return (a * b) % mod
}

func Sub(a, b int64) int64 {
	return (a - b + mod) % mod
}

func pow(a, b int64) int64 {
	if b == 0 {
		return 1
	}
	res := pow(a, b>>1)
	res = Mult(res, res)
	if b&1 == 1 {
		res = Mult(res, a)
	}
	return res
}

var (
	fact, inv []int64
)

func choose(a, b int) int64 {
	if b < 0 || b > a {
		return 0
	}
	return Mult(fact[a], Mult(inv[b], inv[a-b]))
}

func solve() {
	n := nextInt()
	arr := []byte(next())
	if n%2 == 0 {
		for i := 1; i < n; i += 2 {
			if (arr[i]-'0')%2 == 0 {
				printf("2\n")
				return
			}
		}
		printf("1\n")
		return
	} else {
		for i := 0; i < n; i += 2 {
			if (arr[i]-'0')%2 == 1 {
				printf("1\n")
				return
			}
		}
		printf("2\n")
		return
	}
}

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

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

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

package main

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

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

	tc := readNum(reader)

	var buf bytes.Buffer

	for tc > 0 {
		tc--
		n := readNum(reader)
		s, _ := reader.ReadString('\n')
		res := solve(n, s)
		buf.WriteString(fmt.Sprintf("%d\n", res))
	}
	fmt.Print(buf.String())
}

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

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

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

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

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

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

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

	return i
}

const RAZE = 1
const BREACH = 2

func solve(n int, s string) int {
	var cnt1, cnt2 int

	for i := 0; i < n; i++ {
		x := int(s[i] - '0')
		if i&1 == 0 {
			// (i+1)odd position
			cnt1 += x & 1
		} else {
			// even position
			if x&1 == 0 {
				cnt2++
			}
		}
	}

	if n&1 == 1 {
		if cnt1 > 0 {
			return RAZE
		}
		return BREACH
	}
	// n & 2 == 0
	if cnt2 > 0 {
		return BREACH
	}
	return RAZE
}

package main

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

var reader = bufio.NewReader(os.Stdin)  //use fmt.Fscan
var writer = bufio.NewWriter(os.Stdout) //use fmt.Fprintln

func solve() {
	//solution here
	var n int
	var s string
	fmt.Fscan(reader, &n, &s)
	var hasFirstOdd, hasSecondEven bool
	for k, v := range s {
		if k%2 == 0 {
			if v%2 == 1 {
				hasFirstOdd = true
			}
		} else {
			if v%2 == 0 {
				hasSecondEven = true
			}
		}
	}
	if n%2 == 0 {
		//last goes second
		if hasSecondEven {
			fmt.Fprintln(writer, 2)
		} else {
			fmt.Fprintln(writer, 1)
		}
	} else {
		//last goes first
		if hasFirstOdd {
			fmt.Fprintln(writer, 1)
		} else {
			fmt.Fprintln(writer, 2)
		}
	}
}

func main() {
	var t int
	fmt.Fscan(reader, &t)
	defer writer.Flush()
	for t > 0 {
		solve()
		t--
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
)
var r = bufio.NewReader(os.Stdin)
var w = bufio.NewWriter(os.Stdout)

func print( a ...interface{}) { fmt.Fprint(w, a...) }
func scan( a ...interface{})  { fmt.Fscan(r, a...) }

func main() {
defer w.Flush()
	var q int
	scan(&q)
	for ; q > 0; q-- {
		var n int
		scan(&n)
		var num string
		scan(&num)
//		if n== 1 {
//			if num % 10 == 1 {
//				print(1, "\n")
//			}else{
//				print(2, "\n")
//			}
//		}else
		if n % 2 == 0 {
			var b = false
			for i := 0; i < n; i += 2  {
				if int(num[n-i-1] - '0') % 2 == 0 {
					b = true
					break
				}
			}
			if b {
				print(2, "\n")
			}else{
				print(1, "\n")
			}
		}else{
			var b = false
			for i := 0; i < n; i += 2  {
				if int(num[n-i-1] - '0') % 2 == 1 {
					b = true
					break
				}
			}
			if b {
				print(1, "\n")
			}else{
				print(2, "\n")
			}
		}
	}
}

package main

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

var rw = NewFastIO(os.Stdin, os.Stdout)

func main() {
	defer rw.Flush()
	for tt := rw.NextInt(); tt > 0; tt-- {
		n := rw.NextInt()
		a := rw.Next()
		var win int
		if n%2 == 0 {
			win = 1
			for i := 1; i < n; i += 2 {
				if a[i]%2 == 0 {
					win = 2
				}
			}
		} else {
			win = 2
			for i := 0; i < n; i += 2 {
				if a[i]%2 == 1 {
					win = 1
				}
			}
		}
		rw.Println(win)
	}
}

// @meooow template uwu
type FastIO struct {
	*bufio.Writer
	r    io.Reader
	buf  [8192]byte
	i, n int
}

func NewFastIO(r io.Reader, w io.Writer) *FastIO {
	return &FastIO{r: r, Writer: bufio.NewWriter(w)}
}

func (f *FastIO) readC() byte {
	if f.i == f.n {
		f.n, _ = f.r.Read(f.buf[:])
		if f.n == 0 {
			panic("EOF")
		}
		f.i = 0
	}
	f.i++
	return f.buf[f.i-1]
}

func (f *FastIO) Next() string {
	c := f.readC()
	for ; c <= ' '; c = f.readC() {
	}
	var s []byte
	for ; c > ' '; c = f.readC() {
		s = append(s, c)
	}
	return string(s)
}

func (f *FastIO) NextInt() int {
	c := f.readC()
	for ; c <= ' '; c = f.readC() {
	}
	neg := false
	if c == '-' {
		neg = true
		c = f.readC()
	}
	n := 0
	for ; '0' <= c && c <= '9'; c = f.readC() {
		n = n*10 + int(c) - '0'
	}
	if neg {
		return -n
	}
	return n
}
func (f *FastIO) NextInt64() int64 {
	c := f.readC()
	for ; c <= ' '; c = f.readC() {
	}
	neg := false
	if c == '-' {
		neg = true
		c = f.readC()
	}
	n := int64(0)
	for ; '0' <= c && c <= '9'; c = f.readC() {
		n = n*10 + int64(c) - '0'
	}
	if neg {
		return -n
	}
	return n
}

func (f *FastIO) NextInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = f.NextInt()
	}
	return a
}
func (f *FastIO) NextInt64s(n int) []int64 {
	a := make([]int64, n)
	for i := 0; i < n; i++ {
		a[i] = f.NextInt64()
	}
	return a
}

func (f *FastIO) Println(a ...interface{}) {
	fmt.Fprintln(f, a...)
}

func (f *FastIO) Print(a ...interface{}) {
	fmt.Fprint(f, a...)
}
func (f *FastIO) PrintInts(a ...int) {
	if len(a) > 0 {
		f.Print(a[0])
		for _, x := range a[1:] {
			f.Print(" ", x)
		}
	}
}
func (f *FastIO) PrintlnInts(a ...int) {
	f.PrintInts(a...)
	f.Println()
}
func (f *FastIO) PrintInt64s(a ...int64) {
	if len(a) > 0 {
		f.Print(a[0])
		for _, x := range a[1:] {
			f.Print(" ", x)
		}
	}
}
func (f *FastIO) PrintlnInt64s(a ...int64) {
	f.PrintInt64s(a...)
	f.Println()
}

package main

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

type game struct {
	oddCount, evenCount int
}

func solve(r *bufio.Reader, w *bufio.Writer) {
	var n int
	fmt.Fscanln(r, &n)
	var dinput string
	fmt.Fscanln(r, &dinput)
	digits := make([]int, n)
	var rg, bg game
	for i := 0; i < n; i++ {
		digits[i] = int(dinput[i]) - 48
		if (i+1)%2 == 0 {
			if digits[i]%2 == 0 {
				bg.evenCount += 1
			} else {
				bg.oddCount += 1
			}
		} else {
			if digits[i]%2 == 0 {
				rg.evenCount += 1
			} else {
				rg.oddCount += 1
			}
		}
	}
	for i := 0; i < n-1; i++ {
		if (i+1)%2 == 1 {
			if rg.evenCount > 0 {
				rg.evenCount -= 1
			} else {
				rg.oddCount -= 1
			}
		} else {
			if bg.oddCount > 0 {
				bg.oddCount -= 1
			} else {
				bg.evenCount -= 1
			}
		}
	}
	var ans int
	if n%2 == 1 {
		if rg.evenCount > 0 {
			ans = 2
		} else {
			ans = 1
		}
	} else {
		if bg.oddCount > 0 {
			ans = 1
		} else {
			ans = 2
		}
	}
	fmt.Fprintln(w, ans)
}

func main() {
	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()
	var t int
	fmt.Fscanln(reader, &t)
	for ; t > 0; t-- {
		solve(reader, writer)
	}
}

package main

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

const (
	SCANNER_BUF_SIZE = 2 << 20

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

var (
	writer  *bufio.Writer
	scanner *bufio.Scanner
)

func init() {
	writer = bufio.NewWriter(os.Stdout)
	scanner = bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, SCANNER_BUF_SIZE), SCANNER_BUF_SIZE)
}

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

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

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

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

func gcd(a, b int64) int64 {
	for b != 0 {
		a, b = b, a%b
	}
	return a
}

func lcm(a, b int64) int64 {
	return a * b / gcd(a, b)
}

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

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

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

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

func sol(n int64, s string) int64 {
	if n & 1 == 1 {
		// raze makes last move
		for i := range s {
			if i & 1 == 0 {
				d := s[i] - '0'
				// if digit is odd, raze wins
				if d & 1 == 1 {
					return 1
				}
			}
		}
		return 2
	}
	// breach makes last move
	for i := range s {
		if i & 1 == 1 {
			d := s[i] - '0'
			// if digit is even, breach wins
			if d & 1 == 0 {
				return 2
			}
		}
	}
	return 1
}

package main

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

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

	tc := readNum(reader)

	var buf bytes.Buffer

	for tc > 0 {
		tc--
		n := readNum(reader)
		s, _ := reader.ReadString('\n')
		res := solve(n, s)
		buf.WriteString(fmt.Sprintf("%d\n", res))
	}
	fmt.Print(buf.String())
}

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

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

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

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

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

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

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

	return i
}

const RAZE = 1
const BREACH = 2

func solve(n int, s string) int {
	var cnt1, cnt2 int

	for i := 0; i < n; i++ {
		x := int(s[i] - '0')
		if i&1 == 0 {
			// (i+1)odd position
			cnt1 += x & 1
		} else {
			// even position
			if x&1 == 0 {
				cnt2++
			}
		}
	}

	if n&1 == 1 {
		if cnt1 > 0 {
			return RAZE
		}
		return BREACH
	}
	// n & 2 == 0
	if cnt1 > cnt2 {
		return RAZE
	}
	return BREACH
}

package main

import (
	"bufio"
	"fmt"
	"os"
)
var r = bufio.NewReader(os.Stdin)
var w = bufio.NewWriter(os.Stdout)

func print( a ...interface{}) { fmt.Fprint(w, a...) }
func scan( a ...interface{})  { fmt.Fscan(r, a...) }

func main() {
defer w.Flush()
	var q int
	scan(&q)
	for ; q > 0; q-- {
		var n int
		scan(&n)
		var num string
		scan(&num)
//		if n== 1 {
//			if num % 10 == 1 {
//				print(1, "\n")
//			}else{
//				print(2, "\n")
//			}
//		}else
		if n % 2 == 0 {
			var b = false
			for i := 0; i < n; i += 2  {
				if int(num[i] - '0') % 2 == 0 {
					b = true
					break
				}
			}
			if b {
				print(2, "\n")
			}else{
				print(1, "\n")
			}
		}else{
			var b = false
			for i := 0; i < n; i += 2  {
				if int(num[i] - '0') % 2 == 1 {
					b = true
					break
				}
			}
			if b {
				print(1, "\n")
			}else{
				print(2, "\n")
			}
		}
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
)
var r = bufio.NewReader(os.Stdin)
var w = bufio.NewWriter(os.Stdout)

func print( a ...interface{}) { fmt.Fprint(w, a...) }
func scan( a ...interface{})  { fmt.Fscan(r, a...) }

func main() {
defer w.Flush()
	var q int
	scan(&q)
	for ; q > 0; q-- {
		var n int
		scan(&n)
		var num int
		scan(&num)
//		if n== 1 {
//			if num % 10 == 1 {
//				print(1, "\n")
//			}else{
//				print(2, "\n")
//			}
//		}else
		if n % 2 == 0 {
			var b = false
			for ; num > 0; num = num / 100  {
				if num % 2 == 0 {
					b = true
					break
				}
			}
			if b {
				print(2, "\n")
			}else{
				print(1, "\n")
			}
		}else{
			var b = false
			for ; num > 0; num = num / 100 {
				if num % 2 == 1 {
					b = true
					break
				}
			}
			if b {
				print(1, "\n")
			}else{
				print(2, "\n")
			}
		}
	}
}


package main

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

var rr = bufio.NewReader(os.Stdin)
var ww = bufio.NewWriter(os.Stdout)

type trieNode struct {
	children	[26]*trieNode
	isEnd		bool
}

func (o *trieNode) empty() bool {
	for _, child := range o.children {
		if child != nil {
			return false
		}
	}
	return true
}

type trie struct {
	root *trieNode
}

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

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

func chr(v byte) byte {
	return v + 'a'
}

func (t *trie) put(s []byte) *trieNode {
	o := t.root
	for _, b := range s {
		b = ord(b)
		if o.children[b] == nil {
			o.children[b] = &trieNode{}
		}
		o = o.children[b]
	}
	o.isEnd = true
	return o
}

func (t *trie) find(s []byte) *trieNode {
	o := t.root
	for _, b := range s {
		o = o.children[ord(b)]
		// 未找到 s，且 s 不是任何字符串的前缀
		if o == nil {
			return nil
		}
	}
	// 未找到 s，但是 s 是某个字符串的前缀
	if !o.isEnd {
		return nil
	}
	return o
}

func (t *trie) find1(s []byte) bool {
	o := t.root
	for i, b := range s {
		o = o.children[ord(b)]
		if o.isEnd && t.find(s[i+1:]) != nil {
			return true
		}
	}
	// 未找到 s，但是 s 是某个字符串的前缀
	return false
}

func (t *trie) delete(s []byte) *trieNode {
	fa := make([]*trieNode, len(s))
	o := t.root
	for i, b := range s {
		fa[i] = o
		o = o.children[ord(b)]
		if o == nil {
			return nil
		}
	}
	if !o.isEnd {
		return nil
	}
	o.isEnd = false
	ret := o
	for i := len(s) - 1; i >= 0; i-- {
		if !o.empty() {
			break
		}
		o = fa[i]
		o.children[ord(s[i])] = nil
	}
	return ret
}

func slove() {
	var n int
	t := newTrie()
	fmt.Fscan(rr, &n)
	ss := make([]string, n)

	for i:=0;i<n;i++ {
		var a string
		fmt.Fscan(rr, &a)
		t.put([]byte(a))
		ss[i] = a
	}
	ans := make([]byte, n)
	for i := range ss {
		if t.find1([]byte(ss[i])) {
			ans[i] = '1'
		} else {
			ans[i] = '0'
		}
	}
	fmt.Fprintln(ww, string(ans))
}

func main() {
	defer ww.Flush()
	var n int
	fmt.Fscan(rr, &n)
	for i:=1;i<=n;i++ {
		slove()
	}
}

// 1703D. Double Strings
package main

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

func main() {
	var T int
	reader := bufio.NewReader(os.Stdin)
	fmt.Fscan(reader, &T)
	for t := 1; t <= T; t++ {
		var n int
		fmt.Fscan(reader, &n)
		a := make([]string, n)
		m := make(map[string]bool)
		for i := 0; i < n; i++ {
			fmt.Fscan(reader, &a[i])
			m[a[i]] = true
		}
		ans := make([]string, n)
		for i := 0; i < n; i++ {
			exists := false
			for j := 1; j < len(a[i]); j++ {
				if m[a[i][:j]] && m[a[i][j:]] {
					exists = true
					break
				}
			}
			if exists {
				ans[i] = "1"
			} else {
				ans[i] = "0"
			}
		}
		fmt.Println(strings.Join(ans, ""))
	}
}

package main

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

var _, _, _ = main, rw, do

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

func rw(r io.Reader, w io.Writer) {
	var t int
	fmt.Fscan(r, &t)
	for ti := 0; ti < t; ti++ {
		var n int
		fmt.Fscan(r, &n)
		b := make([]string, n)
		for i := range b {
			fmt.Fscan(r, &b[i])
		}
		w1 := do(b)
		fmt.Fprintln(w, w1)
	}
}

func do(b []string) string {
	m := make(map[string]bool)
	for _, s := range b {
		m[s] = true
	}
	ans := make([]byte, len(b))
	for j, s := range b {
		ans[j] = '0'
		for i := 1; i < len(s); i++ {
			if m[s[:i]] && m[s[i:]] {
				ans[j] = '1'
				break
			}
		}
	}
	return string(ans)
}

package main

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

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

func Read[T any]() T{
	var i T
	fmt.Fscan(in, &i)
	return i
}

func ReadArray[T any](N int) []T{
	ans := make([]T, N)
	for i := 0; i < N; i++{
		ans[i] = Read[T]()
	}
	return ans
}

func Output[T any](val T) {
	fmt.Fprint(out, val)
}

func OutputN[T any](val T) {
	fmt.Fprintln(out, val)
}
func solve() {
	n := Read[int]()
	mp := map[string]bool{}

	arr := ReadArray[string](n)
	for i := 0; i < n; i++ {
		mp[arr[i]] = true
	}

	for i := 0; i < n; i++ {
		ln := len(arr[i])
		done := false
		for j := 0; j < ln; j++ {
			if _, ok := mp[arr[i][0:j]]; ok {
				if _, ok := mp[arr[i][j:ln]]; ok {
					done = true
					break
				}
			}
		}
		if done {
			Output[int32](1)
		} else {
			Output[int32](0)
		}
	}
	fmt.Fprintln(out)

}
func main(){
	defer out.Flush()
	tt := 1
	tt = Read[int]()
	for tt > 0 {
		solve()
		tt--
	}
}

package main

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

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

func Read[T any]() T{
	var i T
	fmt.Fscan(in, &i)
	return i
}

func ReadArray[T any](N int) []T{
	ans := make([]T, N)
	for i := 0; i < N; i++{
		ans[i] = Read[T]()
	}
	return ans
}

func solve() {
	n := Read[int]()
	mp := map[string]bool{}

	arr := ReadArray[string](n)
	for i := 0; i < n; i++ {
		mp[arr[i]] = true
	}

	for i := 0; i < n; i++ {
		ln := len(arr[i])
		done := false
		for j := 0; j < ln; j++ {
			if _, ok := mp[arr[i][0:j]]; ok {
				if _, ok := mp[arr[i][j:ln]]; ok {
					done = true
					break
				}
			}
		}
		if done {
			fmt.Fprint(out, 1)
		} else {
			fmt.Fprint(out, 0)
		}
	}
	fmt.Fprintln(out)

}
func main(){
	defer out.Flush()
	tt := 1
	tt = Read[int]()
	for tt > 0 {
		solve()
		tt--
	}
}

package main

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

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

func Read[T any]() T{
	var i T
	fmt.Fscan(in, &i)
	return i
}

func ReadArray[T any](N int) []T{
	ans := make([]T, N)
	for i := 0; i < N; i++{
		ans[i] = Read[T]()
	}
	return ans
}

func solve() {
	n := Read[int]()
	mp := map[string]bool{}

	arr := ReadArray[string](n)
	ans := []bool{}
	for i := 0; i < n; i++ {
		mp[arr[i]] = true
	}

	for i := 0; i < n; i++ {
		ln := len(arr[i])
		done := false
		for j := 0; j < ln; j++ {
			if _, ok := mp[arr[i][0:j]]; ok {
				if _, ok := mp[arr[i][j:ln]]; ok {
					ans = append(ans, true)
					done = true
					break
				}
			}
		}
		if !done {
			ans = append(ans, false)
		}
	}
	for i := 0; i < n; i++ {
		if ans[i] {
			fmt.Fprint(out, 1)
		} else {
			fmt.Fprint(out, 0)
		}
	}
	fmt.Fprintln(out)

}
func main(){
	defer out.Flush()
	tt := 1
	tt = Read[int]()
	for tt > 0 {
		solve()
		tt--
	}
}

package main

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

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

func Read[T any]() T{
	var i T
	fmt.Fscan(in, &i)
	return i
}

func ReadArray[T any](N int) []T{
	ans := make([]T, N)
	for i := 0; i < N; i++{
		ans[i] = Read[T]()
	}
	return ans
}

func solve() {
	n := Read[int]()
	mp := map[string]bool{}

	arr := ReadArray[string](n)
	ans := []bool{}
	for i := 0; i < n; i++ {
		mp[arr[i]] = true
	}

	for i := 0; i < n; i++ {
		ln := len(arr[i])
		done := false
		for j := 0; j < ln; j++ {
			if _, ok := mp[arr[i][0:j]]; ok {
				if _, ok := mp[arr[i][j:ln]]; ok {
					ans = append(ans, true)
					done = true
					break
				}
			}
		}
		if !done {
			ans = append(ans, false)
		}
	}
	for i := 0; i < n; i++ {
		if ans[i] {
			fmt.Print(1)
		} else {
			fmt.Print(0)
		}
	}
	fmt.Println()

}
func main(){
	defer out.Flush()
	tt := 1
	tt = Read[int]()
	for tt > 0 {
		solve()
		tt--
	}
}

package main

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

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

func Read[T any]() T{
	var i T
	fmt.Fscan(in, &i)
	return i
}

func ReadArray[T any](N int) []T{
	ans := make([]T, N)
	for i := 0; i < N; i++{
		ans[i] = Read[T]()
	}
	return ans
}

const N int = 1e5
var arr = [N]string{}
var ans = [N]bool{}

func solve() {
	n := Read[int]()

	mp := map[string]bool{}

	for i := 0; i < n; i++ {
		arr[i] = Read[string]()
		mp[arr[i]] = true
		ans[i] = false
	}

	for i := 0; i < n; i++ {
		ln := len(arr[i])
		for j := 0; j < ln; j++ {
			if _, ok := mp[arr[i][0:j]]; ok {
				if _, ok := mp[arr[i][j:ln]]; ok {
					ans[i] = true
				}
			}
		}
	}
	for i := 0; i < n; i++ {
		if ans[i] {
			fmt.Print(1)
		} else {
			fmt.Print(0)
		}
	}
	fmt.Println()

}
func main(){
	defer out.Flush()
	tt := 1
	tt = Read[int]()
	for tt > 0 {
		solve()
		tt--
	}
}

package main

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

func doubleStrings(strs []string) []int {
	stringsMap := make(map[string]bool)
	for _, str := range strs {
		stringsMap[str] = true
	}
	results := make([]int, len(strs))
	for i, str := range strs {
		for j := 0; j < len(str); j++ {
			str1 := str[0 : j+1]
			str2 := str[j+1 : len(str)]
			if stringsMap[str1] && stringsMap[str2] {
				results[i] = 1
			}
		}
	}
	return results
}

func main() {
	reader := bufio.NewReaderSize(os.Stdin, 16*1024*1024)
	T, err := strconv.Atoi(strings.TrimSpace(readLine(reader)))
	checkError(err)
	var results = make([][]int, T)
	for i := 0; i < T; i++ {
		N, err := strconv.Atoi(strings.TrimSpace(readLine(reader)))
		checkError(err)
		strs := make([]string, N)
		for i := 0; i < N; i++ {
			strs[i] = strings.TrimSpace(readLine(reader))
		}
		results[i] = doubleStrings(strs)
	}
	for _, result := range results {
		for _, r := range result {
			fmt.Print(r)
		}
		fmt.Println()
	}
}

func readLine(reader *bufio.Reader) string {
	str, _, err := reader.ReadLine()
	if err != nil {
		return ""
	}
	return strings.TrimRight(string(str), "\r\n")
}

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

package main

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

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

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

func ReadIntArray(N int) []int{
	ans := make([]int, N)
	for i := 0; i < N; i++{
		fmt.Fscan(in, &ans[i])
	}
	return ans
}

func ReadString() string{
	var s string
	fmt.Scanf("%s", &s)
	return s
}

func ReadStringArray(N int) []string{
	ans := make([]string, N)
	for i := 0; i < N; i++{
		fmt.Fscan(in, &ans[i])
	}
	return ans
}

func main(){
	defer out.Flush()
	testCases := ReadInt()
	for ; testCases > 0; testCases--{
		N := ReadInt()
		SS := ReadStringArray(N)
		cache := make(map[string]bool)
		for i := 0; i < N; i++{
			cache[SS[i]] = true
		}
		for i := 0; i < N; i++{
			found := false
			for j := 0; j < len(SS[i]) - 1; j++{
				_, left := cache[SS[i][:j+1]]
				_, right := cache[SS[i][j+1:len(SS[i])]]
				if left && right {
					found = true
					break
				}
			}
			if found{
				fmt.Fprint(out, 1)
			} else{
				fmt.Fprint(out, 0)
			}
		}
		fmt.Fprintln(out)
	}
}

package main

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

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

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

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

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

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

/**
Run solve the problem CF1703D
Date: 25/07/22
User: pepradere
URL: https://codeforces.com/problemset/problem/1703/D
Problem: CF1703D
**/
func (in *CF1703D) Run() {
	var sol strings.Builder
	for t := in.NextInt(); t > 0; t-- {
		n := in.NextInt()
		mapa := make(map[string][]int)

		for i := 0; i < n; i++ {
			str := in.NextString()
			if _, e := mapa[str]; !e {
				a := make([]int, 0)
				mapa[str] = a
			}
			arr := mapa[str]
			arr = append(arr, i)
			mapa[str] = arr
		}

		ans := make([]int, n)
		for s, val := range mapa {
			ws := false
			for j := 1; j < len(s); j++ {
				if _, e := mapa[s[0:j]]; e {
					if _, e := mapa[s[j:]]; e {
						ws = true
						break
					}
				}
			}
			for p := 0; p < len(val); p++ {
				if ws {
					ans[val[p]] = 1
				} else {
					ans[val[p]] = 0
				}

			}
		}

		for i := 0; i < n; i++ {
			sol.WriteString(fmt.Sprintf("%d", ans[i]))
		}
		sol.WriteString("\n")
	}
	fmt.Print(sol.String())
}

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

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

package main

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

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

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

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

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

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

/**
Run solve the problem CF1703D
Date: 25/07/22
User: pepradere
URL: https://codeforces.com/problemset/problem/1703/D
Problem: CF1703D
**/
func (in *CF1703D) Run() {
	var sol strings.Builder
	for t := in.NextInt(); t > 0; t-- {
		n := in.NextInt()
		mapa := make(map[string][]int)

		for i := 0; i < n; i++ {
			str := in.NextString()
			if _, e := mapa[str]; !e {
				a := make([]int, 0)
				mapa[str] = a
			}
			arr := mapa[str]
			arr = append(arr, i)
			mapa[str] = arr
		}

		ans := make([]int, n)
		for i := 0; i < n; i++ {
			ans[i] = -1
		}
		for s, val := range mapa {
			if ans[val[0]] == 1 || ans[val[0]] == 0 {
				continue
			}
			ws := false
			for j := 1; j < len(s); j++ {
				if _, e := mapa[s[0:j]]; e {
					if _, e := mapa[s[j:]]; e {
						ws = true
						break
					}
				}
			}
			for p := 0; p < len(val); p++ {
				if ws {
					ans[val[p]] = 1
				} else {
					ans[val[p]] = 0
				}

			}
		}

		for i := 0; i < n; i++ {
			sol.WriteString(fmt.Sprintf("%d", ans[i]))
		}
		sol.WriteString("\n")
	}
	fmt.Print(sol.String())
}

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

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

package main

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

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

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

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

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

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

/**
Run solve the problem CF1703D
Date: 25/07/22
User: pepradere
URL: https://codeforces.com/problemset/problem/1703/D
Problem: CF1703D
**/
func (in *CF1703D) Run() {
	var sol strings.Builder
	for t := in.NextInt(); t > 0; t-- {
		n := in.NextInt()
		mapa := make(map[string][]int)

		s := make([]string, n)
		for i := 0; i < n; i++ {
			str := in.NextString()
			s[i] = str
			if _, e := mapa[str]; !e {
				a := make([]int, 0)
				mapa[str] = a
			}
			arr := mapa[str]
			arr = append(arr, i)
			mapa[str] = arr
		}

		sort.Slice(s, func(i, j int) bool {
			if len(s[i]) < len(s[j]) {
				return true
			} else if len(s[i]) > len(s[j]) {
				return false
			} else {
				return s[i] < s[j]
			}
		})

		ans := make([]int, n)
		for i := 0; i < n; i++ {
			ans[i] = -1
		}
		for i := n - 1; i >= 0; i-- {
			val := mapa[s[i]]
			if ans[val[0]] == 1 || ans[val[0]] == 0 {
				continue
			}
			ws := false
			for j := 1; j < len(s[i]); j++ {
				if _, e := mapa[s[i][0:j]]; e {
					if _, e := mapa[s[i][j:]]; e {
						ws = true
						break
					}
				}
			}

			for p := 0; p < len(val); p++ {
				if ws {
					ans[val[p]] = 1
				} else {
					ans[val[p]] = 0
				}

			}
		}

		for i := 0; i < n; i++ {
			sol.WriteString(fmt.Sprintf("%d", ans[i]))
		}
		sol.WriteString("\n")
	}
	fmt.Print(sol.String())
}

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

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

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

		aa := make([]string, n)
		m := make(map[string]bool, n)
		for i := 0; i < n; i++ {
			fmt.Fscan(in, &aa[i])
			m[aa[i]] = true
		}

		buf := make([]rune, n)
		for i, s := range aa {
			var f bool
			for i := 1; i < len(s); i++ {
				if m[s[:i]] && m[s[i:]] {
					f = true
					break
				}
			}
			if f {
				buf[i] = '1'
			} else {
				buf[i] = '0'
			}
		}
		fmt.Fprintln(out, string(buf))
	}
}

package main

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

const mod = 998244353
const mx = int64(1e9 + 7)

func solve(in *bufio.Reader, out *bufio.Writer) {
	defer out.Flush()
	var n int
	fmt.Fscan(in, &n)
	arr := make([]string, n)
	mp := map[string]bool{}
	for i := 0; i < n; i++ {
		fmt.Fscan(in, &arr[i])
		mp[arr[i]] = true
	}
	ans := make([]byte, n)
	for i := 0; i < n; i++ {
		valid := false
		for j := 0; j < len(arr[i])-1; j++ {
			if mp[arr[i][:j+1]] && mp[arr[i][j+1:]] {
				valid = true
				break
			}
		}
		if valid {
			ans[i] = '1'
		} else {
			ans[i] = '0'
		}
	}
	fmt.Fprintln(out, string(ans))
}

func abs(a int64) int64 {
	if a > 0 {
		return a
	}
	return -a
}
func sum(a, b int64) int64 {
	return (b + a) * (b - a + 1) / 2
}

func max(a, b int64) int64 {
	if a > b {
		return a
	}
	return b
}
func min(a, b int64) int64 {
	if a > b {
		return b
	}
	return a
}
func gcd(a, b int) int {
	if a%b == 0 {
		return b
	}
	return gcd(b, a%b)
}

func main() {
	stdin := os.Stdin
	stdout := os.Stdout
	in := bufio.NewReader(stdin)
	out := bufio.NewWriter(stdout)
	n := 1
	fmt.Fscan(in, &n)
	for i := 0; i < n; i++ {
		solve(in, out)
	}
}

package main

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

func main() {
	r, w := bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)
	defer w.Flush()
	var t, n int
	Fscan(r, &t)
	for t > 0{
		t--
		Fscan(r, &n)
		b := make([]byte, n)
		m := make(map[string]int)
		a := make([]string, n)
		for i := range a{
			Fscan(r, &a[i])
			m[a[i]] = 1
		}
		for i := range a{
			b[i] = '0'
			for j := 1; j < len(a[i]); j++{
				if m[a[i][0:j]] == 1 && m[a[i][j:]] == 1{
					b[i] = '1'
					break
				}
			}
		}
		Fprintln(w, string(b))
	}
}

package main

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

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

	var buf bytes.Buffer

	tc := readNum(reader)

	for tc > 0 {
		tc--
		n := readNum(reader)
		S := make([]string, n)
		for i := 0; i < n; i++ {
			S[i] = readString(reader)
		}
		res := solve(S)
		buf.WriteString(res)
		buf.WriteByte('\n')
	}

	fmt.Print(buf.String())
}

func readString(reader *bufio.Reader) string {
	s, _ := reader.ReadString('\n')
	for i := 0; i < len(s); i++ {
		if s[i] == '\n' || s[i] == '\r' {
			return s[:i]
		}
	}
	return s
}

func normalize(s string) string {

	for i := len(s); i > 0; i-- {
		if s[i-1] >= 'a' && s[i-1] <= 'z' {
			return s[:i]
		}
	}
	return ""
}

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

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

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

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

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

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

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

	return i
}

func solve(s []string) string {
	n := len(s)
	ii := make([]int, n)
	for i := 0; i < n; i++ {
		ii[i] = i
	}

	sort.Slice(ii, func(i, j int) bool {
		return len(s[ii[i]]) < len(s[ii[j]])
	})

	mem := make(map[string]bool)

	res := make([]byte, n)

	for i := 0; i < n; i++ {
		j := ii[i]
		res[j] = '0'
		for k := 1; k+1 <= len(s[j]); k++ {
			x := s[j][:k]
			y := s[j][k:]
			if mem[x] && mem[y] {
				res[j] = '1'
				break
			}
		}
		mem[s[j]] = true
	}

	return string(res)
}

package main

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

var (
	reader  = bufio.NewReader(os.Stdin)
	t, n, x int
	a       []string
)

func solve(n int, a []string) string {
	var strMapper = make(map[string]bool)
	for _, x := range a {
		strMapper[x] = true
	}
	var result = make([]int, n)
	for i := 0; i < n; i++ {
		for j := 0; j < len(a[i]); j++ {
			if strMapper[a[i][:j]] && strMapper[a[i][j:]] {
				result[i] = 1
				break
			}
		}
	}
	return strings.Trim(strings.Replace(fmt.Sprint(result), " ", "", -1), "[]")
}

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

package main

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

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

	var T, n int
	for Fscan(in, &T); T > 0; T-- {
		Fscan(in, &n)
		type pair struct{ s string; i int }
		a := make([]pair, n)
		for i := range a {
			Fscan(in, &a[i].s)
			a[i].i = i
		}
		sort.Slice(a, func(i, j int) bool { return len(a[i].s) < len(a[j].s) })
		cnt := map[string]int{}
		ans := bytes.Repeat([]byte{'0'}, n)
		for _, p := range a {
			for i := 1; i < len(p.s); i++ {
				if c1,c2 := cnt[p.s[:i]],cnt[p.s[i:]];c1>0 && c2 > 0 {
					ans[p.i] = '1'
				}
			}
			cnt[p.s]++
		}
		Fprintf(out, "%s\n", ans)
	}
}

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

package main

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

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

func Read[T any]() T{
	var i T
	fmt.Fscan(in, &i)
	return i
}

func ReadArray[T any](N int) []T{
	ans := make([]T, N)
	for i := 0; i < N; i++{
		ans[i] = Read[T]()
	}
	return ans
}

func solve() {
	n := Read[int]()
	mp := map[string]bool{}

	arr := ReadArray[string](n)
	ans := []bool{}
	for i := 0; i < n; i++ {
		mp[arr[i]] = true
	}

	for i := 0; i < n; i++ {
		ln := len(arr[i])
		done := false
		for j := 0; j < ln; j++ {
			if _, ok := mp[arr[i][0:j]]; ok {
				if _, ok := mp[arr[i][j:ln]]; ok {
					ans = append(ans, true)
					done = true
					break
				}
			}
		}
		if !done {
			ans = append(ans, false)
		}
	}
	for i := 0; i < n; i++ {
		if ans[i] {
			fmt.Fprint(out, 1)
		} else {
			fmt.Fprint(out, 0)
		}
	}
	fmt.Fprint(out)

}
func main(){
	defer out.Flush()
	tt := 1
	tt = Read[int]()
	for tt > 0 {
		solve()
		tt--
	}
}

package main

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

func doubleStrings(strs []string) []int {
	stringsMap := make(map[string][]int)
	results := make([]int, len(strs))
	for i, str := range strs {
		if _, ok := stringsMap[str]; ok {
			stringsMap[str] = append(stringsMap[str], i)
		} else {
			stringsMap[str] = []int{i}
		}
	}
	for i := 0; i < len(strs); i++ {
		for j := 0; j < len(strs); j++ {
			if len(strs[i])+len(strs[j]) > 8 {
				continue
			}
			str := strs[i] + strs[j]
			if _, ok := stringsMap[str]; ok {
				for _, k := range stringsMap[str] {
					results[k] = 1
				}
				break
			}
		}
	}
	return results
}

func main() {
	reader := bufio.NewReaderSize(os.Stdin, 16*1024*1024)
	T, err := strconv.Atoi(strings.TrimSpace(readLine(reader)))
	checkError(err)
	var results = make([][]int, T)
	for i := 0; i < T; i++ {
		N, err := strconv.Atoi(strings.TrimSpace(readLine(reader)))
		checkError(err)
		strs := make([]string, N)
		for i := 0; i < N; i++ {
			strs[i] = strings.TrimSpace(readLine(reader))
		}
		results[i] = doubleStrings(strs)
	}
	for _, result := range results {
		for _, r := range result {
			fmt.Print(r)
		}
		fmt.Println()
	}
}

func readLine(reader *bufio.Reader) string {
	str, _, err := reader.ReadLine()
	if err != nil {
		return ""
	}
	return strings.TrimRight(string(str), "\r\n")
}

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

package main

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

func doubleStrings(strs []string) []int {
	stringsMap := make(map[string]int)
	results := make([]int, len(strs))
	for i, str := range strs {
		stringsMap[str] = i
	}
	for i := 0; i < len(strs); i++ {
		for j := 0; j < len(strs); j++ {
			if len(strs[i])+len(strs[j]) > 8 {
				continue
			}
			str := strs[i] + strs[j]
			if k, ok := stringsMap[str]; ok {
				results[k] = 1
			}
		}
	}
	return results
}

func main() {
	reader := bufio.NewReaderSize(os.Stdin, 16*1024*1024)
	T, err := strconv.Atoi(strings.TrimSpace(readLine(reader)))
	checkError(err)
	var results = make([][]int, T)
	for i := 0; i < T; i++ {
		N, err := strconv.Atoi(strings.TrimSpace(readLine(reader)))
		checkError(err)
		strs := make([]string, N)
		for i := 0; i < N; i++ {
			strs[i] = strings.TrimSpace(readLine(reader))
		}
		results[i] = doubleStrings(strs)
	}
	for _, result := range results {
		for _, r := range result {
			fmt.Print(r)
		}
		fmt.Println()
	}
}

func readLine(reader *bufio.Reader) string {
	str, _, err := reader.ReadLine()
	if err != nil {
		return ""
	}
	return strings.TrimRight(string(str), "\r\n")
}

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

package main

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

func doubleStrings(strs []string) []int {
	stringsMap := make(map[string]int)
	results := make([]int, len(strs))
	for i, str := range strs {
		stringsMap[str] = i
	}
	// for i := 0; i < len(strs); i++ {
	for j := 0; j < len(strs); j++ {
		for k := 0; k < len(strs); k++ {
			str := strs[j] + strs[k]
			// str2 := strs[k] + strs[j]
			if i, ok := stringsMap[str]; ok {
				results[i] = 1
			}
		}
	}
	// }
	return results
}

func main() {
	reader := bufio.NewReaderSize(os.Stdin, 16*1024*1024)
	T, err := strconv.Atoi(strings.TrimSpace(readLine(reader)))
	checkError(err)
	var results = make([][]int, T)
	for i := 0; i < T; i++ {
		N, err := strconv.Atoi(strings.TrimSpace(readLine(reader)))
		checkError(err)
		strs := make([]string, N)
		for i := 0; i < N; i++ {
			strs[i] = strings.TrimSpace(readLine(reader))
		}
		results[i] = doubleStrings(strs)
	}
	for _, result := range results {
		for _, r := range result {
			fmt.Print(r)
		}
		fmt.Println()
	}
}

func readLine(reader *bufio.Reader) string {
	str, _, err := reader.ReadLine()
	if err != nil {
		return ""
	}
	return strings.TrimRight(string(str), "\r\n")
}

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

package main

import (
	"fmt"
)

func ReadInt() int{
	var i int
	fmt.Scanf("%d", &i)
	return i
}

func ReadIntArray(N int) []int{
	ans := make([]int, N)
	for i := 0; i < N; i++{
		ans[i] = ReadInt()
	}
	return ans
}

func ReadString() string{
	var s string
	fmt.Scanf("%s", &s)
	return s
}

func ReadStringArray(N int) []string{
	ans := make([]string, N)
	for i := 0; i < N; i++{
		if i < N-1{
			fmt.Scanf("%s ", &ans[i])
		} else{
			fmt.Scanf("%s\n", &ans[i])
		}
	}
	return ans
}

func main(){
	testCases := ReadInt()
	for ; testCases > 0; testCases--{
		N := ReadInt()
		SS := ReadStringArray(N)
		cache := make(map[string]bool)
		for i := 0; i < N; i++{
			cache[SS[i]] = true
		}
		for i := 0; i < N; i++{
			found := false
			for j := 0; j < len(SS[i]) - 1; j++{
				_, left := cache[SS[i][:j+1]]
				_, right := cache[SS[i][j+1:len(SS[i])]]
				if left && right {
					found = true
					break
				}
			}
			if found{
				fmt.Print(1)
			} else{
				fmt.Print(0)
			}
		}
		fmt.Println()
	}
}

package main

import (
	"fmt"
)

func ReadInt() int{
	var i int
	fmt.Scanf("%d", &i)
	return i
}

func ReadIntArray(N int) []int{
	ans := make([]int, N)
	for i := 0; i < N; i++{
		ans[i] = ReadInt()
	}
	return ans
}

func ReadString() string{
	var s string
	fmt.Scanf("%s", &s)
	return s
}

func ReadStringArray(N int) []string{
	ans := make([]string, N)
	for i := 0; i < N; i++{
		ans[i] = ReadString()
	}
	return ans
}

func main(){
	testCases := ReadInt()
	for ; testCases > 0; testCases--{
		N := ReadInt()
		SS := ReadStringArray(N)
		cache := make(map[string]bool)
		for i := 0; i < N; i++{
			cache[SS[i]] = true
		}
		for i := 0; i < N; i++{
			found := false
			for j := 0; j < len(SS[i]) - 1; j++{
				_, left := cache[SS[i][:j+1]]
				_, right := cache[SS[i][j+1:len(SS[i])]]
				if left && right {
					found = true
					break
				}
			}
			if found{
				fmt.Print(1)
			} else{
				fmt.Print(0)
			}
		}
		fmt.Println()
	}
}

package main

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

const mod = 998244353
const mx = int64(1e9 + 7)

func solve(in *bufio.Reader, out *bufio.Writer) {
	defer out.Flush()
	var n int
	fmt.Fscan(in, &n)
	arr := make([]string, n)
	mp := map[string]bool{}
	for i := 0; i < n; i++ {
		fmt.Fscan(in, &arr[i])
		mp[arr[i]] = true
	}
	ans := make([]byte, n)
	for i := 0; i < n; i++ {
		valid := false
		for j := 0; j < len(arr[i])-1; j++ {
			if mp[arr[i][:j+1]] && mp[arr[i][j+1:]] {
				valid = true
				break
			}
		}
		if valid {
			ans[i] = '1'
		} else {
			ans[i] = '0'
		}
	}
	fmt.Fprintln(out, string(ans))
}

func abs(a int64) int64 {
	if a > 0 {
		return a
	}
	return -a
}
func sum(a, b int64) int64 {
	return (b + a) * (b - a + 1) / 2
}

func max(a, b int64) int64 {
	if a > b {
		return a
	}
	return b
}
func min(a, b int64) int64 {
	if a > b {
		return b
	}
	return a
}
func gcd(a, b int) int {
	if a%b == 0 {
		return b
	}
	return gcd(b, a%b)
}

func main() {
	fmt.Println("01234"[3:])
	stdin := os.Stdin
	stdout := os.Stdout
	in := bufio.NewReader(stdin)
	out := bufio.NewWriter(stdout)
	n := 1
	fmt.Fscan(in, &n)
	for i := 0; i < n; i++ {
		solve(in, out)
	}
}


package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	if n == 1 {
		fmt.Println("a")
		return
	}
	if n >= 3 && n % 2 == 1 {
		fmt.Print("b")
		n--
	}
	for i:=0;i<n/2;i++ {
		if i % 2 == 0 {
			fmt.Print("aa")
		} else {
			fmt.Print("bb")
		}
	}

}

package main

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

func I(i ...interface{}) error {
	_, err := fmt.Fscan(r, i...)
	return err
}

func O(o ...interface{}) {
	fmt.Fprint(w, o...)
}

var (
	r *bufio.Reader
	w *bufio.Writer
)

func init() {
	if f, err := os.Open("in.goC"); err == nil {
		r = bufio.NewReader(f)
	} else {
		r = bufio.NewReader(os.Stdin)
	}
	w = bufio.NewWriter(os.Stdout)
}

func main() {
	var n int
	for I(&n) == nil {
		solve(n)
	}
	w.Flush()
}

func solve(n int) {
	ans := strings.Repeat("aabb", (n/4)+10)
	O(ans[:n], "\n")
}

package main

import (
	"fmt"
)

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

	if n%2 != 0 {
		fmt.Printf("a")
	}

	for i := 1; i <= n/2; i++ {
		if i%2 == 0 {
			fmt.Printf("aa")
		} else {
			fmt.Printf("bb")
		}
	}
	fmt.Println()
}

package main

import "fmt"

func main() {
	var n int

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

	name := make([]rune, n)

	for i := 0; i < n; i++ {
		switch i % 4 {
		case 0, 1:
			name[i] = 'a'
		case 2, 3:
			name[i] = 'b'
		}
	}

	fmt.Println(string(name))
}

package main

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

func solve() {
	n := readInt()
	a := make([]byte, n)
	for i := 0; i < n; i++ {
		a[i] = byte('a' + ((i / 2) % 2))
	}
	fmt.Println(string(a))
}

var scanner *bufio.Scanner

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

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

// IO

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

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

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

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

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

package main

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

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

	str := "aabb"
	for len(str) < ln {
		str += str
	}

	fmt.Println(str[:ln])
}

package main

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

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

	str := ""
	for i := 1; i <= ln/2+1; i++ {
		if i%2 == 1 {
			str += "aa"
		} else {
			str += "bb"
		}
	}

	fmt.Println(str[:ln])
}

package main

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

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

	rt := ln / 2
	str := ""

	for i := 1; i <= rt; i++ {
		if i%2 == 1 {
			str += "aa"
		} else {
			str += "bb"
		}
	}

	if ln%2 == 0 {
		fmt.Println(str)
		return
	}

	if (ln/2)%2 == 1 {
		str += "b"
	} else {
		str += "a"
	}
	fmt.Println(str)
}

package main

import "fmt"
import "bytes"

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

    var buf bytes.Buffer
    for i:=0; i < n; i++ {
        if i%4 < 2 {
            buf.WriteString("a")
        } else {
            buf.WriteString("b")
        }
    }
    fmt.Print(buf.String())
}

package main

import (
	"fmt"
)

func main() {
	var n int
	var s string
	s = "aabb"
	fmt.Scanf("%d", &n)
	for len(s) < n {
		s = s + s
	}
	fmt.Println(s[:n])
}

package main

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

const pattern string = "abba"

func Solve(io *FastIO) {
	N := io.NextInt()

	sb := new(bytes.Buffer)
	for i := 0; i < N; i++ {
		sb.WriteByte(pattern[i % 4]);
	}
	io.Println(sb.String())
}

type FastIO struct {
	reader *bufio.Reader
	writer *bufio.Writer
}

func (io *FastIO) NextChar() byte {
	c, _ := io.reader.ReadByte()
	return c
}

func (io *FastIO) NextInt() int {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := 1
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := 0
	for !IsSpaceChar(c) {
		res = (res * 10) + int(c - '0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextLong() int64 {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := int64(1)
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := int64(0)
	for !IsSpaceChar(c) {
		res = (res * 10) + int64(c - '0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextIntArray(size int) []int {
	return io.NextIntArrayOffset(size, 0)
}

func (io *FastIO) NextIntArrayOffset(size, offset int) []int {
	arr := make([]int, size + offset)
	for i := 0; i < size; i++ {
		arr[i + offset] = io.NextInt()
	}
	return arr
}

func (io *FastIO) NextLongArray(size int) []int64 {
	return io.NextLongArrayOffset(size, 0)
}

func (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {
	arr := make([]int64, size + offset)
	for i := 0; i < size; i++ {
		arr[i + offset] = io.NextLong()
	}
	return arr
}

func (io *FastIO) NextString() string {
	c := io.NextChar()
	for (IsSpaceChar(c)) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsSpaceChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) NextLine() string {
	c := io.NextChar()
	for (IsSpaceChar(c)) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsLineBreakChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) Println(args ...interface{}) {
	io.writer.WriteString(fmt.Sprintln(args...))
}

func (io *FastIO) Printf(format string, args ...interface{}) {
	io.writer.WriteString(fmt.Sprintf(format, args...))
}

func (io *FastIO) FlushOutput() {
	io.writer.Flush()
}

func IsSpaceChar(c byte) bool {
	switch c {
	case 0, '\t', '\n', '\r', ' ':
		return true
	default:
		return false
	}
}

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

func main() {
	io := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}
	Solve(&io)
	io.FlushOutput()
}

package main

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

func main() {
	sc := NewScanner()
	N := sc.NextInt()

	s := make([]byte, N)
	for i := 0; i < N; i++ {
		s[i] = byte((i/2)%2 + 'a')
	}
	fmt.Println(string(s))

}

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

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

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

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

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

	return mp
}

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

package main

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

func solve() {
	n := readInt()
	a := make([]byte, n)
	for i := 0; i < n; i++ {
		a[i] = byte('d' + (i % 3))
	}
	fmt.Println(string(a))
}

var scanner *bufio.Scanner

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

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

// IO

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

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

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

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

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

package main

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

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

	rt := ln / 3

	for rt > 0 {
		fmt.Print("abc")
		rt--
	}

	if ln%3 == 1 {
		fmt.Println("a")
	} else if ln%3 == 2 {
		fmt.Println("ab")
	}
}

package main

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

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

	rt := ln / 3
	str := ""

	for rt > 0 {
		str += "aab"

		rt--
		if len(str) < ln {
			str += "c"
		}
	}

	if (ln-len(str))%3 == 1 {
		str += "a"
	} else if (ln-len(str))%3 == 2 {
		str += "ab"
	}
	fmt.Println(str)
}

package main

import (
	"fmt"
)

func main() {
	var n int
	var s string
	//var b = [3]byte{'a', 'b', 'c'}
	fmt.Scanf("%d", &n)
	for len(s) < n {
		s = s + "aabbaacbbacbbaabb"
	}
	fmt.Println(s[:n])
}

package main

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

func main() {
	sc := NewScanner()
	N := sc.NextInt()

	s := make([]byte, N)
	for i := 0; i < N; i++ {
		s[i] = byte((i % 3) + 'a')
	}
	fmt.Println(string(s))

}

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

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

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

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

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

	return mp
}

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

package main

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

func main() {
	sc := NewScanner()
	N := sc.NextInt()

	s := make([]byte, N)
	s[0] = 'c'
	for i := 1; i < N; i++ {
		s[i] = byte(((i + 1) % 3) + 'a')
	}
	fmt.Println(string(s))

}

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

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

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

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

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

	return mp
}

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

package main

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

func main() {
	sc := NewScanner()
	N := sc.NextInt()

	s := make([]byte, N)
	s[0] = 'a'
	for i := 1; i < N; i++ {
		s[i] = byte(((i + 2) % 3) + 'a')
	}
	fmt.Println(string(s))

}

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

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

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

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

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

	return mp
}

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