package main
import "fmt"

const size int = 4;
func solve(T []string,x int,y int) bool{
    //fmt.Println(x,y);
    T[x]=T[x][:y]+string('x')+T[x][y+1:];
    possible:=false;
    for i:=0;i<size;i++{
        for j:=0;j<size;j++{
            if T[i][j]=='x'{
                for dx:=-1;dx<=1;dx++{
                    for dy:=-1;dy<=1;dy++{
                        if dx==0&&dy==0{
                            continue;
                        }
                        cnt:=0;
                        for k:=0;k<3;k++{
                            nx:=i+dx*k;
                            ny:=j+dy*k;
                            if nx>=0&&nx<size&&ny>=0&&ny<size&&T[nx][ny]=='x'{
                                cnt++;
                            }else{
                                break;
                            }
                        }
                        if cnt==3{
                            possible=true;
                        }
                    }
                }
            }
        }
    }
    T[x]=T[x][:y]+string('.')+T[x][y+1:];
    return possible;
}
func main(){
    for true{
        var T []string;
        var v string;
        if items,_:=fmt.Scanln(&v);items==0{
            break;
        }
        T=append(T,v);
        for i:=0;i<size-1;i++{
            fmt.Scanln(&v);
            T=append(T,v);
        }
        //fmt.Println(T);
        ok:=false;
        for i:=0;i<size;i++{
            for j:=0;j<size;j++{
                if T[i][j]=='.'{
                    ok=ok||solve(T,i,j);
                    //fmt.Println(T);
                }
            }
        }
        if ok{
            fmt.Println("YES");
        }else{
            fmt.Println("NO");
        }
    }
}

package main

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

func I(i interface{}, delim string) {
	fmt.Fscanf(r, "%v"+delim, i)
}

func O(o interface{}, delim string) {
	fmt.Fprintf(w, "%v"+delim, o)
}

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

var in [4]string

func check() bool {
	for i := 0; i < 4; i++ {
		for j := 0; j < 4; j++ {
			if in[i][j] == 'x' {
				if strings.Contains(in[i], "xxx") ||
					(i+2 < 4 && ((in[i+1][j] == 'x' && in[i+2][j] == 'x') ||
						(j+2 < 4 && in[i+1][j+1] == 'x' && in[i+2][j+2] == 'x') ||
						(j-2 >= 0 && in[i+1][j-1] == 'x' && in[i+2][j-2] == 'x'))) {
					O("YES", "\n")
					return true
				}
			}
		}
	}
	return false
}

func main() {
	r = bufio.NewReader(os.Stdin)
	w = bufio.NewWriter(os.Stdout)
	defer w.Flush()
	for i := 0; i < 4; i++ {
		I(&in[i], "\n")
	}
	if check() {
		return
	}
	for i := 0; i < 4; i++ {
		for j := 0; j < 4; j++ {
			if in[i][j] == '.' {
				a := []rune(in[i])
				a[j] = 'x'
				in[i] = string(a)
				if check() {
					return
				}
				a[j] = '.'
				in[i] = string(a)
			}
		}
	}
	O("NO", "\n")
}

package main

import "fmt"

func getField() [4][4]rune {
	var field [4][4]rune
	var c rune
	for i := range field {
		for j := range field[i] {
			for {
				_, err := fmt.Scanf("%c", &c)
				if err != nil {
					panic(err)
				}
				if c == 'x' || c == 'o' || c == '.' {
					field[i][j] = c
					break
				}
			}
		}
	}
	return field
}

var patterns [][]rune = [][]rune{
	{'.', 'x', 'x'},
	{'x', '.', 'x'},
	{'x', 'x', '.'},
}

func inPatterns3(x1, x2, x3 rune) bool {
	for i := range patterns {
		pattern := patterns[i]
		if x1 == pattern[0] && x2 == pattern[1] && x3 == pattern[2] {
			return true
		}
	}
	return false
}

func inPatterns4(x1, x2, x3, x4 rune) bool {
	return inPatterns3(x1, x2, x3) || inPatterns3(x2, x3, x4)
}

func canWin(field [4][4]rune) bool {
	for _, f := range field {
		if inPatterns4(f[0], f[1], f[2], f[3]) {
			return true
		}
	}

	for i := range field {
		if inPatterns4(field[0][i], field[1][i], field[2][i], field[3][i]) {
			return true
		}
	}

	if inPatterns4(field[0][0], field[1][1], field[2][2], field[3][3]) ||
		inPatterns4(field[0][3], field[1][2], field[2][1], field[3][0]) {
		return true
	}
	if inPatterns3(field[1][0], field[2][1], field[3][2]) ||
		inPatterns3(field[0][1], field[1][2], field[2][3]) ||
		inPatterns3(field[2][0], field[1][1], field[0][2]) ||
		inPatterns3(field[3][1], field[2][2], field[1][3]) {
		return true
	}

	return false
}

func main() {
	if canWin(getField()) {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

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

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

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

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

    // your code here
    rows := make([]string, 4)
    for i := 0; i < 4; i++ {
        fmt.Fscanf(in, "%s\n", &rows[i])
    }
    lines := []string{}
    for r := 0; r < 4; r++ {
        lines = append(lines, rows[r])
    }
    for c := 0; c < 4; c++ {
        line := ""
        for r := 0; r < 4; r++ {
            line += rows[r][c:c+1]
        }
        lines = append(lines, line)
    }
    for r := 0; r < 2; r++ {
        for c := 0; c < 2; c++ {
            if r == 1 && c == 1 {
                break
            }
            line := ""
            for i := 0; r + i < 4 && c + i < 4; i++ {
                line += string(rows[r+i][c + i])
            }
            lines = append(lines, line)
            line = ""
            cc := 3 - c
            for i := 0; r + i < 4 && cc - i >= 0; i++ {
                line += string(rows[r+i][cc-i])
            }
            lines = append(lines, line)
        }
    }
    for _, line := range lines {
        for i := range line {
            if line[i:i+1] == "." && strings.Contains(line[0:i]+"x"+line[i+1:], "xxx") {
                fmt.Println("YES")
                return
            }
        }
    }
    fmt.Println("NO")
}

package main

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

func main() {
	const b_size int = 4

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

	board := [b_size]string{}

	for i := 0; i < b_size; i++ {
		if s, err := reader.ReadString('\n'); err != nil {
			if err == io.EOF {
				break
			} else {
				return
			}
		} else {
			s = re.ReplaceAllString(s, "")
			board[i] = s
		}
	}

	ok := false
	candidate := make([]rune, b_size)
	n := 0

	for i := 0; i < b_size; i++ {
		// Horizontally
		for j := 0; j < b_size; j++ {
			candidate[j] = rune(board[i][j])
		}
		if is_ok(candidate, b_size) {
			ok = true
			break
		}

		// Vertically
		for j := 0; j < b_size; j++ {
			candidate[j] = rune(board[j][i])
		}
		if is_ok(candidate, b_size) {
			ok = true
			break
		}
	}

	if ok {
		fmt.Println("YES")
		return
	}

	dia_array := make([][b_size]rune, (b_size*2-1)*2)
	for j := 0; j < b_size; j++ {
		off0 := j
		off1 := (b_size*2 - 1) + (b_size - j - 1)
		for i := 0; i < b_size; i++ {
			dia_array[i+off0][j] = rune(board[i][j])
			dia_array[i+off1][j] = rune(board[i][j])
		}
	}

	for i := 0; i < (b_size*2-1)*2; i++ {
		n = 0
		for j := 0; j < b_size; j++ {
			if dia_array[i][j] != dia_array[0][b_size-1] {
				candidate[n] = dia_array[i][j]
				n++
			}
		}
		if is_ok(candidate, n) {
			ok = true
			break
		}
	}

	if ok {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

func is_ok(candidate []rune, n int) bool {
	if n < 3 {
		return false
	} else {
		for e := 3; e <= n; e++ {
			xs := 0
			dots := 0
			for i := e - 3; i < e; i++ {
				if candidate[i] == 'x' {
					xs++
				} else if candidate[i] == '.' {
					dots++
				} else { // 'o'
					continue
				}
			}
			if xs == 2 && dots == 1 {
				return true
			}
		}
	}
	return false
}

package main

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

func solve() {
	field := make([][]int, 4)
	for i := 0; i < 4; i++ {
		field[i] = make([]int, 4)
		for j, ch := range readString() {
			switch ch {
			case 'x':
				field[i][j] = 1
			case 'o':
				field[i][j] = 2
			}
		}
	}
	for i := 0; i < 4; i++ {
		for j := 0; j < 4; j++ {
			if field[i][j] == 0 {
				field[i][j] = 1
				if win(field) {
					fmt.Println("YES")
					return
				}
				field[i][j] = 0
			}
		}
	}
	fmt.Println("NO")
}

func win(field [][]int) bool {
	for j := 0; j < 4; j++ {
		for i := 0; i < 2; i++ {
			if field[j][i] == 1 && field[j][i+1] == 1 && field[j][i+2] == 1 {
				return true
			}
		}
	}
	for j := 0; j < 4; j++ {
		for i := 0; i < 2; i++ {
			if field[i][j] == 1 && field[i+1][j] == 1 && field[i+2][j] == 1 {
				return true
			}
		}
	}
	for i := 0; i < 2; i++ {
		for j := 0; j < 2; j++ {
			if field[i][j] == 1 && field[i+1][j+1] == 1 && field[i+2][j+2] == 1 {
				return true
			}
		}
	}
	for i := 0; i < 2; i++ {
		for j := 0; j < 2; j++ {
			if field[i][3-j] == 1 && field[i+1][3-j-1] == 1 && field[i+2][3-j-2] == 1 {
				return true
			}
		}
	}
	return false
}

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()
}

// 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
}

// Codeforces 754 B  IlyaTicTacToe,
package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
	"strconv"
)
var in *bufio.Reader

func readFive() (int,int,int,int,int) {
	var a [5]int
	s, err := in.ReadString('\n')
	if err != nil {
		fmt.Println("first read failure", err)
		panic(err)
	}
	ss := strings.Split(strings.Trim(s, " \n\r"), " ")
	for i:=0; i<len(ss); i++ {
		a[i], err = strconv.Atoi(ss[i])
		if err != nil {
			fmt.Println("n atoi failure", err)
			panic(err)
		}
	}
	return a[0],a[1],a[2],a[3],a[4]
}

func readLineNumbs(n int) []int {
	a := make([]int, n)
	s, err := in.ReadString('\n')
	if err != nil {
		fmt.Println("read failure", err)
		panic(err)
	}
	ss := strings.Split(strings.Trim(s, " \n\r"), " ")
	for j:=0; j<n; j++ {
		aa,err := strconv.Atoi(ss[j])
		if err != nil {
			fmt.Println("aa conv failed", err)
			panic(err)
		}
		a[j] = aa
	}
	return a
}

var field [4][4]byte
var canWin string
var dx []int = []int {1,1,0,-1}
var dy []int = []int {0, 1,1,1}

func readData() {
	in = bufio.NewReader(os.Stdin)
	// reading field
	for i:=0; i<4; i++ {
		s, err := in.ReadString('\n')
		if err != nil {
			fmt.Println("read failure", err)
			panic(err)
		}
		for j:=0; j<4; j++ {
			field[i][j] = s[j]
		}
	}
}

func solve() {
	canWin = "NO"
	for dir:=0; dir<4; dir++ {
		for y0:=0; y0<4; y0++ {
			y1 := y0 + 2*dy[dir]
			if y1<0 || y1>=4 {
				continue
			}
			for x0:=0; x0<4; x0++ {
				x1 := x0+2*dx[dir]
				if x1<0 || x1>=4 {
					continue
				}
				cntX := 0
				cntO := 0
				for k:=0; k<3; k++ {
					xx := x0 + k*dx[dir]
					yy := y0 + k*dy[dir]
					if field[yy][xx]=='x' {
						cntX++
					} else if field[yy][xx]=='o' {
						cntO++
					}
				}
				if cntX>=2 && cntO==0 {
					canWin = "YES"
				}
			}
		}
	}
}

func printRes() {
	fmt.Println(canWin)
}

func main() {
	readData()
	solve()
	printRes()
}

package main

import "fmt"

const size = 4
const x = 'x'
const dot = '.'

func checkVertical(table [][]rune) bool {
	for i := 0; i < size; i++ {
		if table[i][0] == x && table[i][1] == x && table[i][2] == x {
			return true
		}

		if table[i][1] == x && table[i][2] == x && table[i][3] == x {
			return true
		}
	}

	return false
}

func checkHorizontal(table [][]rune) bool {
	for j := 0; j < size; j++ {
		if table[0][j] == x && table[1][j] == x && table[2][j] == x {
			return true
		}

		if table[1][j] == x && table[2][j] == x && table[3][j] == x {
			return true
		}
	}

	return false
}

func checkDiagonal(table [][]rune) bool {
	for i := 0; i < size; i++ {
		for j := 0; j < size; j++ {
			var ii, jj int

			ii = i + 2
			jj = j + 2

			if ii < size && jj < size && table[i][j] == x && table[i+1][j+1] == x && table[i+2][j+2] == x {
				return true
			}

			ii = i + 2
			jj = j - 2

			if ii < size && jj >= 0 && table[i][j] == x && table[i+1][j-1] == x && table[i+2][j-2] == x {
				return true
			}
		}
	}

	return false
}

func main() {
	table := make([][]rune, size)

	for i := 0; i < size; i++ {
		table[i] = make([]rune, size)

		var row string
		fmt.Scanf("%s\n", &row)

		for p, s := range row {
			table[i][p] = s
		}
	}

	for i := 0; i < size; i++ {
		for j := 0; j < size; j++ {
			if table[i][j] == dot {
				table[i][j] = x
				if checkHorizontal(table) || checkVertical(table) || checkDiagonal(table) {
					fmt.Println("YES")
					return
				}
				table[i][j] = dot
			}
		}
	}

	fmt.Println("NO")
}

package main

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

func I(i interface{}, delim string) {
	fmt.Fscanf(r, "%v"+delim, i)
}

func O(o interface{}, delim string) {
	fmt.Fprintf(w, "%v"+delim, o)
}

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

var in [4]string

func check() bool {
	for i := 0; i < 4; i++ {
		for j := 0; j < 4; j++ {
			if in[i][j] == 'x' {
				if strings.Contains(in[i], "xxx") ||
					(i+2 < 4 && ((in[i+1][j] == 'x' && in[i+2][j] == 'x') ||
						(j+2 < 4 && in[i+1][j+1] == 'x' && in[i+2][j+2] == 'x') ||
						(i-2 >= 0 && in[i+1][j-1] == 'x' && in[i+2][j-2] == 'x'))) {
					O("YES", "\n")
					return true
				}
			}
		}
	}
	return false
}

func main() {
	r = bufio.NewReader(os.Stdin)
	w = bufio.NewWriter(os.Stdout)
	defer w.Flush()
	for i := 0; i < 4; i++ {
		I(&in[i], "\n")
	}
	if check() {
		return
	}
	for i := 0; i < 4; i++ {
		for j := 0; j < 4; j++ {
			if in[i][j] == '.' {
				a := []rune(in[i])
				a[j] = 'x'
				in[i] = string(a)
				if check() {
					return
				}
				a[j] = '.'
				in[i] = string(a)
			}
		}
	}
	O("NO", "\n")
}

package main

import "fmt"

const size = 4
const x = 'x'
const dot = '.'

func checkVertical(table [][]rune) bool {
	for i := 0; i < size; i++ {
		if table[i][0] == x && table[i][1] == x && table[i][2] == x {
			return true
		}

		if table[i][1] == x && table[i][2] == x && table[i][3] == x {
			return true
		}
	}

	return false
}

func checkHorizontal(table [][]rune) bool {
	for j := 0; j < size; j++ {
		if table[j][0] == x && table[j][1] == x && table[j][2] == x {
			return true
		}

		if table[j][1] == x && table[j][2] == x && table[j][3] == x {
			return true
		}
	}

	return false
}

func checkDiagonal(table [][]rune) bool {
	for i := 0; i < size; i++ {
		for j := 0; j < size; j++ {
			var ii, jj int

			ii = i + 2
			jj = j + 2

			if ii < size && jj < size && table[i][j] == x && table[i+1][j+1] == x && table[i+2][j+2] == x {
				return true
			}

			ii = i + 2
			jj = j - 2

			if ii < size && jj >= 0 && table[i][j] == x && table[i+1][j-1] == x && table[i+2][j-2] == x {
				return true
			}
		}
	}

	return false
}

func main() {
	table := make([][]rune, size)

	for i := 0; i < size; i++ {
		table[i] = make([]rune, size)

		var row string
		fmt.Scanf("%s\n", &row)

		for p, s := range row {
			table[i][p] = s
		}
	}

	for i := 0; i < size; i++ {
		for j := 0; j < size; j++ {
			if table[i][j] == dot {
				table[i][j] = x
				if checkHorizontal(table) || checkVertical(table) || checkDiagonal(table) {
					fmt.Println("YES")
					return
				}
				table[i][j] = dot
			}
		}
	}

	fmt.Println("NO")
}

package main

import "fmt"

const size = 4
const x = 'x'
const dot = '.'

func checkVertical(table [][]rune) bool {
	for i := 0; i < size; i++ {
		if table[i][0] == x && table[i][1] == x && table[i][2] == x {
			return true
		}

		if table[i][1] == x && table[i][2] == x && table[i][3] == x {
			return true
		}
	}

	return false
}

func checkHorizontal(table [][]rune) bool {
	for j := 0; j < size; j++ {
		if table[j][0] == x && table[j][1] == x && table[j][2] == x {
			return true
		}

		if table[j][1] == x && table[j][2] == x && table[j][3] == x {
			return true
		}
	}

	return false
}

func checkDiagonal(table [][]rune) bool {
	if table[0][0] == x && table[1][1] == x && table[2][2] == x {
		return true
	}

	if table[1][1] == x && table[2][2] == x && table[3][3] == x {
		return true
	}

	if table[0][3] == x && table[1][2] == x && table[2][1] == x {
		return true
	}

	if table[3][0] == x && table[2][1] == x && table[1][2] == x {
		return true
	}

	return false
}

func main() {
	table := make([][]rune, size)

	for i := 0; i < size; i++ {
		table[i] = make([]rune, size)

		var row string
		fmt.Scanf("%s\n", &row)

		for p, s := range row {
			table[i][p] = s
		}
	}

	for i := 0; i < size; i++ {
		for j := 0; j < size; j++ {
			if table[i][j] == dot {
				table[i][j] = x
				if checkHorizontal(table) || checkVertical(table) || checkDiagonal(table) {
					fmt.Println("YES")
					return
				}
				table[i][j] = dot
			}
		}
	}

	fmt.Println("NO")
}

package main

import "fmt"

const size = 4

func checkVertical(table [][]rune) bool {
	for i := 0; i < size; i++ {
		if table[i][0] == 'X' && table[i][1] == 'X' && table[i][2] == 'X' {
			return true
		}

		if table[i][1] == 'X' && table[i][2] == 'X' && table[i][3] == 'X' {
			return true
		}
	}

	return false
}

func checkHorizontal(table [][]rune) bool {
	for j := 0; j < size; j++ {
		if table[j][0] == 'X' && table[j][1] == 'X' && table[j][2] == 'X' {
			return true
		}

		if table[j][1] == 'X' && table[j][2] == 'X' && table[j][3] == 'X' {
			return true
		}
	}

	return false
}

func checkDiagonal(table [][]rune) bool {
	if table[0][0] == 'X' && table[1][1] == 'X' && table[2][2] == 'X' {
		return true
	}

	if table[1][1] == 'X' && table[2][2] == 'X' && table[3][3] == 'X' {
		return true
	}

	if table[0][3] == 'X' && table[1][2] == 'X' && table[2][1] == 'X' {
		return true
	}

	if table[3][0] == 'X' && table[2][1] == 'X' && table[1][2] == 'X' {
		return true
	}

	return false
}

func main() {
	table := make([][]rune, size)

	for i := 0; i < size; i++ {
		table[i] = make([]rune, size)

		var row string
		fmt.Scanf("%s\n", &row)

		for p, s := range row {
			table[i][p] = s
		}
	}

	for i := 0; i < size; i++ {
		for j := 0; j < size; j++ {
			if table[i][j] == '.' {
				table[i][j] = 'X'
				if checkHorizontal(table) || checkVertical(table) || checkDiagonal(table) {
					fmt.Println("YES")
					return
				}
				table[i][j] = '.'
			}
		}
	}

	fmt.Println("NO")
}


package main

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

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

	sum := 0
	has_non_zero := false

	array := make([]int, n)
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	for i := 0; i < n && scanner.Scan(); i++ {
		a, err := strconv.Atoi(scanner.Text())
		if err != nil {
			return
		}
		array[i] = a
		sum += a
		if a != 0 {
			has_non_zero = true
		}
	}

	if !has_non_zero {
		fmt.Println("NO")
	} else if sum != 0 {
		fmt.Println("YES")
		fmt.Println("1\n1", n)
	} else {
		s := 0
		bound := -1
		for i := 0; i < n; i++ {
			s += array[i]
			if s != 0 {
				bound = i
				break
			}
		}
		fmt.Println("YES")
		fmt.Println(2)
		fmt.Println(1, bound+1)
		fmt.Println(bound+2, n)
	}
}

package main

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

func I(i interface{}, delim string) {
	fmt.Fscanf(r, "%v"+delim, i)
}

func O(o interface{}, delim string) {
	fmt.Fprintf(w, "%v"+delim, o)
}

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

func main() {
	r = bufio.NewReader(os.Stdin)
	w = bufio.NewWriter(os.Stdout)
	defer w.Flush()
	var n int
	I(&n, "\n")
	in := make([]int, n)
	sum := 0
	start := 1
	end := 1
	var out [][2]int
	for i, _ := range in {
		I(&in[i], " ")
		sum += in[i]
		if sum != 0 {
			end = i + 1
			out = append(out, [2]int{start, end})
			start = i + 2
			if i != n-1 {
				sum = 0
			}
		}
	}
	if sum == 0 && len(out) == 0 {
		O("NO", "\n")
		return
	}
	if sum == 0 {
		out[len(out)-1][1] = n
	}
	O("YES", "\n")
	O(len(out), "\n")
	for _, o := range out {
		O(o[0], " ")
		O(o[1], "\n")
	}
}

package main

import "fmt"

func getArr() []int {
	var (
		n   int
		arr []int
	)
	if _, err := fmt.Scan(&n); err != nil {
		panic(err)
	}
	arr = make([]int, n)
	for i := range arr {
		if _, err := fmt.Scan(&arr[i]); err != nil {
			panic(err)
		}
	}
	return arr
}

type Split struct {
	Start, End int
	Next, Prev *Split
}

func (split *Split) CalcSum() int {
	var sum int
	for i := split.Start; i < split.End; i++ {
		sum += arr[i]
	}
	return sum
}

func (split *Split) Process() bool {
	fullSum := split.CalcSum()
	saveEnd := split.End
	if fullSum == 0 {
		curSum := 0
		for i := split.Start; i < saveEnd; i++ {
			curSum += arr[i]
			if curSum != 0 && (fullSum-curSum) != 0 {
				split.End = i + 1
				rs := &Split{Start: i + 1, End: saveEnd}
				rs.Next = split.Next
				rs.Prev = split
				split.Next = rs
				if split.Process() && rs.Process() {
					return true
				} else {
					split.Next = rs.Next
				}
			}
		}
		return false
	} else {
		return true
	}
}

func (split *Split) FirstSplit() *Split {
	for split.Prev != nil {
		split = split.Prev
	}
	return split
}

func (split *Split) Len() int {
	var n int
	for split != nil {
		split = split.Next
		n += 1
	}
	return n
}

var arr []int

func main() {
	arr = getArr()

	spl := &Split{Start: 0, End: len(arr)}

	if spl.Process() {
		fmt.Println("YES")
		fspl := spl.FirstSplit()
		fmt.Println(fspl.Len())
		for fspl != nil {
			fmt.Println(fspl.Start+1, fspl.End)
			fspl = fspl.Next
		}
	} else {
		fmt.Println("NO")
	}
}

//http://codeforces.com/contest/754/problem/A
package main

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

func main() {

	var (
		n int
	)

	//f, _ := os.Open("input.txt")
	//input := bufio.NewReader(f)
	input := bufio.NewReader(os.Stdin)

	fmt.Fscanln(input, &n)
	a := make([]int, n)

	zeroes := true
	sum := 0
	for i := 0; i < n; i++ {
		fmt.Fscan(input, &a[i])

		zeroes = zeroes && (a[i] == 0)
		sum += a[i]
	}

	if zeroes {
		fmt.Println("NO")
		return
	}

	fmt.Println("YES")

	if sum != 0 {
		fmt.Println(1)
		fmt.Println(1, n)
		return
	}

	fmt.Println("2")
	sum = 0
	i := 0
	for sum == 0 {
		sum += a[i]
		i++
	}

	fmt.Println(1, i)
	fmt.Println(i + 1, n)
}

package main

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

func solve() {
	n := readInt()
	a := make([]int, n)
	total := 0
	for i := 0; i < n; i++ {
		a[i] = readInt()
		if a[i] == 0 {
			total++
		}
	}
	if total == n {
		fmt.Println("NO")
		return
	}
	res := make([][]int, 0)
	for i := 0; i < n; i++ {
		start := i
		sum := a[i]
		for sum == 0 && i+1 < n {
			i++
			sum += a[i]
		}
		for i+1 < n && a[i+1] == 0 {
			i++
			sum += a[i]
		}
		if sum == 0 {
			fmt.Println("NO")
			return
		}
		res = append(res, []int{start + 1, i + 1})
	}
	fmt.Println("YES")
	fmt.Println(len(res))
	for _, v := range res {
		fmt.Println(v[0], v[1])
	}
}

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()
}

// IO

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

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

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

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

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

package main
import "fmt"
func main(){
    for true{
        var n int;
        if items,_:=fmt.Scan(&n);items==0{
            break;
        }
        var myVec []int;
        for i:=0;i<n;i++{
            var x int;
            fmt.Scan(&x);
            myVec=append(myVec,x);
        }
        //fmt.Println(myVec);
        ok:=true;
        var L,R []int;
        for i:=0;i<n;i++{
            ind:=-1;
            sum:=0;
            for j:=i;j<n;j++{
                sum+=myVec[j];
                if sum != 0{
                    ind=j;
                }
            }
            if ind==-1{
                ok=false;
                break;
            }
            L=append(L,i);
            R=append(R,ind);
            i=ind;
        }
        if !ok{
            fmt.Println("NO");
            continue;
        }
        fmt.Println("YES");
        fmt.Println(len(L));
        for i:=0;i<len(L);i++{
            fmt.Println(L[i]+1,R[i]+1);
        }
    }
}

package main

import "fmt"

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

	arr := make([]int, n)
	sum := 0
	hasNonZero := false

	for i := 0; i < n; i++ {
		fmt.Scanf("%d", &arr[i])
		sum += arr[i]
		if arr[i] != 0 {
			hasNonZero = true
		}
	}

	if !hasNonZero {
		fmt.Println("NO")
	} else {
		fmt.Println("YES")

		if sum != 0 {
			fmt.Printf("1\n%d %d", 1, n)
		} else {
			fmt.Println("2")

			subSum := 0

			for i, val := range arr {
				subSum += val

				if subSum != 0 {
					fmt.Printf("%d %d\n%d %d", 1, i+1, i+2, n)
					break
				}
			}
		}
	}
}

package main

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

func I(i interface{}, delim string) {
	fmt.Fscanf(r, "%v"+delim, i)
}

func O(o interface{}, delim string) {
	fmt.Fprintf(w, "%v"+delim, o)
}

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

func main() {
	r = bufio.NewReader(os.Stdin)
	w = bufio.NewWriter(os.Stdout)
	defer w.Flush()
	var n int
	I(&n, "\n")
	in := make([]int, n)
	sum := 0
	start := 1
	end := 1
	var out [][2]int
	for i, _ := range in {
		I(&in[i], " ")
		sum += in[i]
		if sum != 0 {
			end = i + 1
			out = append(out, [2]int{start, end})
			start = i + 2
			if i != n-1 {
				sum = 0
			}
		}
	}
	if sum == 0 {
		O("NO", "\n")
		return
	}
	O("YES", "\n")
	O(len(out), "\n")
	for _, o := range out {
		O(o[0], " ")
		O(o[1], "\n")
	}
}

package main

import "fmt"

func getArr() []int {
	var (
		n   int
		arr []int
	)
	if _, err := fmt.Scan(&n); err != nil {
		panic(err)
	}
	arr = make([]int, n)
	for i := range arr {
		if _, err := fmt.Scan(&arr[i]); err != nil {
			panic(err)
		}
	}
	return arr
}

type Split struct {
	Start, End int
	Next, Prev *Split
}

func (split *Split) CalcSum() int {
	var sum int
	for i := split.Start; i < split.End; i++ {
		sum += arr[i]
	}
	return sum
}

func (split *Split) Process() bool {
	fullSum := split.CalcSum()
	saveEnd := split.End
	if fullSum == 0 {
		curSum := 0
		for i := split.Start; i < saveEnd; i++ {
			curSum += arr[i]
			if curSum != 0 && (fullSum-curSum) != 0 {
				split.End = i + 1
				rs := &Split{Start: i + 1, End: saveEnd}
				rs.Next = split.Next
				rs.Prev = split
				split.Next = rs
				if split.Process() && rs.Process() {
					return true
				} else {
					split.Next = rs.Next
				}
			}
		}
		return false
	} else {
		return true
	}
}

func (split *Split) FirstSplit() *Split {
	for split.Prev != nil {
		split = split.Prev
	}
	return split
}

func (split *Split) Len() int {
	var n int
	for split.Next != nil {
		split = split.Next
		n += 1
	}
	return n
}

var arr []int

func main() {
	arr = getArr()

	spl := &Split{Start: 0, End: len(arr)}

	if spl.Process() {
		fmt.Println("YES")
		fspl := spl.FirstSplit()
		fmt.Println(fspl.Len())
		for {
			fmt.Println(fspl.Start+1, fspl.End)
			fspl = fspl.Next
			if fspl == nil {
				break
			}
		}
	} else {
		fmt.Println("NO")
	}
}

//http://codeforces.com/contest/754/problem/A
package main

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

func main() {

	var (
		n int
	)

	//f, _ := os.Open("input.txt")
	//input := bufio.NewReader(f)
	input := bufio.NewReader(os.Stdin)

	fmt.Fscanln(input, &n)
	a := make([]int, n)

	zeroes := true
	sum := 0
	for i := 0; i < n; i++ {
		fmt.Fscan(input, &a[i])

		zeroes = zeroes && (a[i] == 0)
		sum += a[i]
	}

	if zeroes {
		fmt.Println("NO")
		return
	}

	fmt.Println("YES")

	if sum != 0 {
		fmt.Println(1)
		fmt.Println(1, n)
		return
	}

	fmt.Println("2")
	sum = 0
	i := 0
	for sum == 0 {
		sum += a[i]
		i++
	}

	fmt.Println(1, i + 1)
	fmt.Println(i + 2, n)
}

package main

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

func solve() {
	n := readInt()
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = readInt()
	}
	res := make([][]int, 0)
	for i := 0; i < n; i++ {
		start := i
		sum := a[i]
		for sum == 0 && i+1 < n {
			i++
			sum += a[i]
		}
		for i+1 < n && a[i+1] == 0 {
			i++
			sum += a[i]
		}
		if sum == 0 {
			fmt.Println("NO")
			return
		}
		res = append(res, []int{start + 1, i + 1})
	}
	if len(res) > 1 {
		fmt.Println("YES")
		fmt.Println(len(res))
		for _, v := range res {
			fmt.Println(v[0], v[1])
		}
	} else {
		fmt.Println("NO")
	}
}

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()
}

// 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 (
	"strconv"
	"bufio"
	"os"
	"fmt"
)

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, 0)
			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
		}
	}
}
func min(a int, b int) int {
	if a < b {
		return a
	}
	return b
}

func main() {
	sc := NewScanner()
	k, r := sc.NextInt(), sc.NextInt()
	for l := 1; l <= 10; l++ {
		g := k * l
		if g % 10 == 0 || g % 10 == r {
			fmt.Println(l)
			return
		}
	}

}

package main

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

func main() {
	var k, r int
	var scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)

	scanner.Scan()
	fmt.Sscanf(scanner.Text(), "%d %d", &k, &r)

	n := 1
	for m := k % 10; m != 0 && m != r; m = (m + k) % 10 {
		n++
	}

	fmt.Print(n)
}

package main

import "fmt"

func main() {
	var k,r int;
	fmt.Scan(&k, &r)
	for i:=1; i<=10; i++ {
		sum := k * i
		if sum % 10 == 0 || sum % 10 == r {
			fmt.Println(i)
			break
		}
	}
}

package main

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

func I(i interface{}, delim string) error {
	_, err := fmt.Fscanf(r, "%v"+delim, i)
	return err
}

func O(o interface{}, delim string) {
	fmt.Fprintf(w, "%v"+delim, o)
}

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

func main() {
	if f, err := os.Open("in.txt"); err == nil {
		r = bufio.NewReader(f)
	} else {
		r = bufio.NewReader(os.Stdin)
	}
	w = bufio.NewWriter(os.Stdout)
	defer w.Flush()
	var k int
	for I(&k, " ") == nil {
		solve(k)
	}
}
func solve(k int) {
	var r int
	I(&r, "\n")
	i := 1
	for k*i%10 != r && k*i%10 != 0 {
		i++
	}
	O(i, "\n")
}

package main

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

func solve() {
    k, r := readInt(), readInt()
    for i := 1; i < 11; i++ {
        res := i*k % 10
        if res == r || res == 0 {
            fmt.Println(i)
            break
        }
    }
}

// Helpers

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

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

// Math

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

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

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

// IO

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

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

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

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

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

// Sort

type Ints64 []int64

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

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

package main

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

func main() {
	var k, r int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &k, &r)
	for i := 1; i <= 10; i++ {
		if k*i%10 == 0 || (k*i-r)%10 == 0 {
			fmt.Println(i)
			break
		}
	}
}

package main

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

var bufin *bufio.Reader
var bufout *bufio.Writer

func solution(k int, r int) int {
	for x := 1; x <= 20; x++ {
		p := x * k
		if (p%10 == 0) || (p%10 == r) {
			return x
		}
	}
	return 10
}

func main() {
	bufin = bufio.NewReader(os.Stdin)
	bufout = bufio.NewWriter(os.Stdout)
	defer bufout.Flush()

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

	fmt.Fprintf(bufout, "%d\n", solution(k, r))
}

package main

import "fmt"

func main() {
    var k, r int
    fmt.Scanf("%d %d", &k, &r)
    for n := 1; ; n++ {
        a := n * k
        b := a - r
        if a % 10 == 0 || b % 10 == 0 {
            fmt.Printf("%d\n", n)
            return
        }
    }
}

// codeforces project main.go
package main

import (
	"fmt"
)

var (
	k, r int
)

func main() {
	fmt.Scan(&k, &r)
	var i int = 1
	tmp := k
	for ; (k-r)%10 != 0; i++ {
		if k%10 == 0 {
			break
		}
		k += tmp
	}
	fmt.Println(i)
}

package main

import "fmt"

func main() {
	var k, r int16
	fmt.Scan(&k, &r)
	var i int16
	for i = 1; i <= 10; i++ {
		if i * k % 10 == r || i * k % 10 == 0 {
			break
		}
	}
	fmt.Println(i)
}

package main

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

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

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

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

    // your code here
    var k, r int
    fmt.Fscanf(in, "%d %d\n", &k, &r)
    amount := k
    for amount % 10 != 0 && amount % 10 != r {
        amount += k
    }
    fmt.Println(amount / k)
}

package main

import (
	"fmt"
)

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

func main() {
	var k, r int
	fmt.Scanf("%d %d \n", &k, &r)
	sol := 1
	for (sol*k)%10 != 0 && (sol*k)%10 != r {
		sol++
	}
	fmt.Print(sol)
}

package main

import (
	"fmt"
	"strconv"
)

func main() {
	var k string
	var r int
	fmt.Scanf("%s %d\n", &k, &r)
	unitDigit, _ := strconv.Atoi(string(k[len(k)-1]))
	for i := 1; i <= 9; i++ {
		x := strconv.Itoa(unitDigit * i)
		newUnitDigit, _ := strconv.Atoi(string(x[len(x)-1]))
		// fmt.Println(unitDigit, i, x, newUnitDigit, r)
		if newUnitDigit == r || newUnitDigit == 0 {
			fmt.Println(i)
			break
		}
	}

}

package main

import (
	"bufio"
	"os"

	"strings"
	"strconv"
	"fmt"
)

func getString() string {
	sc := bufio.NewScanner(os.Stdin)
	for sc.Scan() {
		return sc.Text()
	}
	return sc.Text()
}

func main() {
	str := getString()
	ar := strings.Split(str, " ")
	k, _ := strconv.Atoi(ar[0])
	r, _ := strconv.Atoi(ar[1])
	i := 1
	if dec :=  k%10; dec != 0 {
		tmp := dec
		for {
			if tmp%10 == 0 {
				fmt.Println(i)
				return
			}
			if tmp-r == 0 {
				fmt.Println(i)
				return
			} else {
				i++
				tmp = dec * i
				if tmp > 10 {
					tmp = tmp % 10
				}
				continue
			}
		}
	} else {
		fmt.Println(i)
	}

}

package main

import "fmt"

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

	for i := 1; i < 10; i++ {
		if (k*i)%10 == r || (k*i)%10 == 0 {
			fmt.Printf("%d\n", i)
			return
		}
	}

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

package main

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

func main() {
	var k, r int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &k, &r)
	sum := 0
	i := 0
	for ; ; i++ {
		sum += k
		if sum%10 == 0 || sum%10 == r {
			break
		}
	}
	fmt.Println(i + 1)
}

package main

import "fmt"

func main() {
	var k, r int
	fmt.Scan(&k, &r)
	var cnt = 1
	var remain = k % 10
	for remain != r && remain != 0 {
		remain = (k + remain) % 10
		cnt++
	}
	fmt.Print(cnt)
}

package main

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

func main() {
	var k, r int
	reader := bufio.NewReader(os.Stdin)
	fmt.Fscan(reader, &k)
	fmt.Fscan(reader, &r)
	buyNumber := 1
	for {
		if (buyNumber*k)%10 == 0 {
			break
		} else if (((buyNumber * k) % 10) - r) == 0 {
			break
		}
		buyNumber++
	}
	fmt.Println(buyNumber)
}

package main

import "fmt"

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

	i := 1
	for {
		tmp := i * k
		if tmp%10 == 0 || tmp%10 == r {
			fmt.Println(i)
			return
		}
		i++
	}
}

package main

import "fmt"

func main() {
	var k, r, mod uint
	fmt.Scan(&k, &r)
	mod = k % 10
	for i := uint(1); i <= 9; i++ {
		if (i*mod%10) == r || (i*mod%10) == 0 {
			fmt.Println(i)
			return
		}
	}
}

package main

import "fmt"

// https://codeforces.com/problemset/problem/732/A
// A. Buy a Shovel
// time limit per test
// 1 second
// memory limit per test
// 256 megabytes
// input
// standard input
// output
// standard output

// Polycarp urgently needs a shovel! He comes to the shop and chooses an appropriate one. The shovel that Policarp chooses is sold for k burles. Assume that there is an unlimited number of such shovels in the shop.

// In his pocket Polycarp has an unlimited number of "10-burle coins" and exactly one coin of r burles (1 ≤ r ≤ 9).

// What is the minimum number of shovels Polycarp has to buy so that he can pay for the purchase without any change? It is obvious that he can pay for 10 shovels without any change (by paying the requied amount of 10-burle coins and not using the coin of r burles). But perhaps he can buy fewer shovels and pay without any change. Note that Polycarp should buy at least one shovel.
// Input

// The single line of input contains two integers k and r (1 ≤ k ≤ 1000, 1 ≤ r ≤ 9) — the price of one shovel and the denomination of the coin in Polycarp's pocket that is different from "10-burle coins".

// Remember that he has an unlimited number of coins in the denomination of 10, that is, Polycarp has enough money to buy any number of shovels.
// Output

// Print the required minimum number of shovels Polycarp has to buy so that he can pay for them without any change.

func main() {
	var k, r int
	_, _ = fmt.Scan(&k, &r)

	nShovles := 1
	for {
		price := nShovles * k

		mod := price % 10
		if mod == 0 || mod == r {
			break
		}
		nShovles++
	}

	fmt.Print(nShovles)
}

package main

import "fmt"

// https://codeforces.com/problemset/problem/732/A
// комментарии к решению
// Десятичных монет неограниченное количество, поэтому нас интересует
// строго десятичный остаток стоимости, что приводит к конечному кол-ву
// решений. Перебираем все на листочке и выписываем двумерный массив решений
func taskSolution(k int, r int) int {
	counts := [][]int{
		{1, 1, 1, 1, 1, 1, 1, 1, 1},  // k%10 = 0
		{1, 2, 3, 4, 5, 6, 7, 8, 9},  // k%10 = 1
		{5, 1, 5, 2, 5, 3, 5, 4, 5},  // k%10 = 2
		{7, 4, 1, 8, 5, 2, 9, 6, 3},  // k%10 = 3
		{5, 3, 5, 1, 5, 4, 5, 2, 5},  // k%10 = 4
		{2, 2, 2, 2, 1, 2, 2, 2, 2},  // k%10 = 5
		{10, 2, 5, 4, 5, 1, 5, 3, 5}, // k%10 = 6
		{3, 6, 9, 2, 5, 8, 1, 4, 7},  // k%10 = 7
		{5, 4, 5, 3, 5, 2, 5, 1, 5},  // k%10 = 8
		{9, 8, 7, 6, 5, 4, 3, 2, 1},  // k%10 = 9
	}

	return counts[k%10][r-1]
}

func main() {
	var k, r int
	if _, err := fmt.Scan(&k, &r); err != nil {
		panic(err)
	}

	fmt.Println(taskSolution(k, r))
}

package main

import "fmt"

func main()  {
	var priceOfShovel int
	fmt.Scan(&priceOfShovel)
	var change int
	fmt.Scan(&change)
	sumOfShovels := 1
	shovelPrice := 0
	actualPrice := 0
	count := 1
	for index := 0; index < count; index++ {
		shovelPrice = priceOfShovel * count
		actualPrice = shovelPrice % 10

		if actualPrice == change || actualPrice == 0  {
			break
		}

		sumOfShovels = sumOfShovels + 1
		count++
	}
	fmt.Print(count)
}

package main

import (
	"fmt"
)

func main() {
	var k, r int
	fmt.Scanf("%d %d", &k, &r)
	for i := 1; i <= 9; i++ {
		if k*i%10 == 0 || k*i%10 == r {
			fmt.Println(i)
			break
		}
	}
}

package main

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

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

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

func PrintInts(ints ...int) {
	for _, value := range ints {
		writer.WriteString(strconv.Itoa(value))
		writer.WriteByte(' ')
	}
}

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

	var k, r int = ReadInt32(), ReadInt32()

	for i := 1; i <= 10; i++ {
		if k*i%10 == r || k*i%10 == 0 {
			PrintInts(i)
			break
		}
	}
}

package main

import (
	"fmt"
)

var (
	k, r int
)

func main() {
	fmt.Scan(&k, &r)

	if (k-r)%10 == 0 {
		println(1)
	} else {
		var i int
		tmp := k
		m := (k - r) % 10
		for i = 1; m != 0; i++ {
			k += tmp
			m = (k - r) % 10
		}
		println(i)
	}
}

// codeforces project main.go
package main

import (
	"fmt"
)

var (
	k, r int
)

func main() {
	fmt.Scan(&k, &r)
	var i int = 1
	tmp := k
	for ; (k-r)%10 != 0; i++ {
		if k%10 == 0 {
			break
		}
		k += tmp
	}
	println(i)
}

package main

import (
	"fmt"
	"strconv"
)

func main() {
	var k string
	var r int
	fmt.Scanf("%s %d\n", &k, &r)
	unitDigit, _ := strconv.Atoi(string(k[len(k)-1]))
	flag := false
	for i := 0; i <= 9; i++ {
		x := strconv.Itoa(unitDigit * i)
		newUnitDigit, _ := strconv.Atoi(string(x[len(x)-1]))
		// fmt.Println(unitDigit, i, x, newUnitDigit, r)
		if newUnitDigit == r {
			fmt.Println(i)
			flag = true
			break
		}
	}
	if !flag {
		fmt.Println(r)
	}

}

package main

import (
	"bufio"
	"os"

	"strings"
	"strconv"
	"fmt"
)

func getString() string {
	sc := bufio.NewScanner(os.Stdin)
	for sc.Scan() {
		return sc.Text()
	}
	return sc.Text()
}

func main() {
	str := getString()
	ar := strings.Split(str, " ")
	k, _ := strconv.Atoi(ar[0])
	r, _ := strconv.Atoi(ar[1])
	if dec :=  k%10; dec != 0 {
		i := 1
		for {
			if dec%r == 0 {
				fmt.Println(i)
				return
			} else {
				i++
				dec = dec * i
				continue
			}
		}
	} else {
		fmt.Println(1)
	}

}

package main

import "fmt"

func main() {
	var k, r int
	fmt.Scan(&k, &r)
	var cnt = 1
	var remain = k % 10
	for remain != r && remain == 0 {
		remain = (k + remain) % 10
		cnt++
	}
	fmt.Print(cnt)
}

package main

import "fmt"

// https://codeforces.com/problemset/problem/732/A
// комментарии к решению
// Десятичных монет неограниченное количество, поэтому нас интересует
// строго десятичный остаток стоимости, что приводит к конечному кол-ву
// решений. Перебираем все на листочке и выписываем двумерный массив решений
func taskSolution(k int, r int) int {
	counts := [][]int{
		// r =   1   2   3   4   5   6   7   8   9
		{1, 1, 1, 1, 1, 1, 1, 1, 1},  // k%10 = 0
		{1, 2, 3, 4, 5, 6, 7, 8, 9},  // k%10 = 1
		{5, 1, 5, 2, 5, 3, 5, 4, 5},  // k%10 = 2
		{7, 4, 1, 8, 5, 2, 9, 6, 3},  // k%10 = 3
		{5, 3, 5, 1, 5, 4, 5, 2, 5},  // k%10 = 4
		{2, 2, 2, 2, 2, 2, 2, 2, 2},  // k%10 = 5
		{10, 2, 5, 4, 5, 1, 5, 3, 5}, // k%10 = 6
		{3, 6, 9, 2, 5, 8, 1, 4, 7},  // k%10 = 7
		{5, 4, 5, 3, 5, 2, 5, 1, 5},  // k%10 = 8
		{9, 8, 7, 6, 5, 4, 3, 2, 1},  // k%10 = 9
	}

	return counts[k%10][r-1]
}

func main() {
	var k, r int
	if _, err := fmt.Scan(&k, &r); err != nil {
		panic(err)
	}

	fmt.Println(taskSolution(k, r))
}


package main

import "fmt"

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

func available(a, b int) int {
    if a > b {
        dif := a - b
        if dif%2 == 0 {
            return dif/2
        } else {
            return (dif - 1)/2
        }
    }
    return 0
}

func main() {
    var a, b, c, x, y, z int
    fmt.Scan(&a, &b, &c, &x, &y, &z)

    needed := max(0, x-a) + max(0, y-b) + max(0, z-c)
    ava := available(a, x) + available(b, y) + available(c, z)

    if needed > ava {
        fmt.Println("No")
    } else {
        fmt.Println("Yes")
    }
}

package main

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

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

	var a, b, c int
	var tA, tB, tC int

	fmt.Fscanf(stdin, "%d%d%d\n", &a, &b, &c)
	fmt.Fscanf(stdin, "%d%d%d\n", &tA, &tB, &tC)

	a = a - tA
	b = b - tB
	c = c - tC

	// fmt.Println(a, b, c)

	if a < 0 {
		a = a * 2
	} else {
		a = a / 2 * 2
	}
	if b < 0 {
		b = b * 2
	} else {
		b = b / 2 * 2
	}
	if c < 0 {
		c = c * 2
	} else {
		c = c / 2 * 2
	}

	if a + b + c >= 0 {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

package main

import "fmt"

func main(){
	var (
		a int
		b int
		c int
		x int
		y int
		z int
	)
	fmt.Scanf("%d %d %d ",&a,&b,&c)
	fmt.Scanf("%d %d %d ",&x,&y,&z)
	if (x > a){
		x -= a
		a = 0
	}else {
		a -= x
		x = 0
	}
	if (y > b){
		y -= b
		b = 0
	}else {
		b -= y
		y = 0
	}
	if (z > c){
		z -= c
		c = 0
	}else {
		c -= z
		z = 0
	}
	if (x + y + z) <= (a/2 + b/2 + c/2){
		fmt.Print("Yes")
	}else {
		fmt.Print("No")
	}
}

package main

import "fmt"

func main() {
        var a, b [3]int
        //      fmt.Println(i)
        fmt.Scanf("%d %d %d\n", &a[0], &a[1], &a[2])
        fmt.Scanf("%d %d %d\n", &b[0], &b[1], &b[2])
        acnt, bcnt := 0, 0
        for i := 0; i < 3; i++ {
                if a[i]-b[i] > 0 {
                        acnt += (((a[i] - b[i]) / 2) * 2)
                } else {
                        bcnt += (b[i] - a[i])
                }
        }
        //fmt.Println(acnt)
        //fmt.Println(bcnt)
        if acnt/2 >= bcnt {
                fmt.Println("Yes")
        } else {
                fmt.Println("No")
        }
}

package main

import (
	"fmt"
)

func main() {
	var a [3]int
	if _, err := fmt.Scanf("%d %d %d\n", &a[0], &a[1], &a[2]); err != nil {
		return
	}
	var x [3]int
	if _, err := fmt.Scanf("%d %d %d\n", &x[0], &x[1], &x[2]); err != nil {
		return
	}

	var d [3]int
	neg := 0
	for i := 0; i < 3; i++ {
		d[i] = a[i] - x[i]
		if d[i] < 0 {
			neg += d[i]
		}
	}

	for neg < 0 {
		ok := false
		for i := 0; i < 3; i++ {
			if d[i] >= 2 {
				neg++
				d[i] -= 2
				ok = true
				break
			}
		}
		if !ok {
			fmt.Println("No")
			return
		}
	}

	fmt.Println("Yes")
}

package main

import "fmt"

func main() {
    var a, b, c, x, y, z int
    fmt.Scanf("%d%d%d\n",&a,&b,&c);
    fmt.Scanf("%d%d%d\n",&x,&y,&z);
    aa := a - x
    if (aa > 0) {
        aa /= 2
    }
    bb := b - y
    if (bb > 0) {
        bb /= 2
    }
    cc := c - z
    if (cc > 0) {
        cc /= 2
    }

    ans := aa + bb + cc

    if ans >= 0 {
        fmt.Println("Yes")
    } else {
        fmt.Println("No")
    }
}

package main

import (
	"fmt"
)

func main() {
	var a, b, c int
	fmt.Scan(&a, &b, &c)
	var x, y, z int
	fmt.Scan(&x, &y, &z)
	var addA = a - x
	var addB = b - y
	var addC = c - z
	var add int
	var minus int
	if addA > 0 {
		add += addA / 2
	} else {
		minus += addA
	}
	if addB > 0 {
		add += addB / 2
	} else {
		minus += addB
	}
	if addC > 0 {
		add += addC / 2
	} else {
		minus += addC
	}
	if add+minus >= 0 {
		fmt.Print("Yes")
	} else {
		fmt.Print("No")
	}
}

package main

import "fmt"

func main(){
	var (
		a int
		b int
		c int
		x int
		y int
		z int
	)
	fmt.Scanf("%d%d%d",&a,&b,&c)
	fmt.Scanf("%d%d%d",&x,&y,&z)
	if (x > a){
		x -= a
		a = 0
	}else {
		a -= x
		x = 0
	}
	if (y > b){
		y -= b
		b = 0
	}else {
		b -= y
		y = 0
	}
	if (z > c){
		z -= c
		c = 0
	}else {
		c -= z
		z = 0
	}
	if (x + y + z) <= (a/2 + b/2 + c/2){
		fmt.Println("Yes")
	}else {
		fmt.Println("No")
	}
}

package main

import "fmt"

func main(){
	var (
		a int
		b int
		c int
		x int
		y int
		z int
	)
	fmt.Scanf("%d%d%d",&a,&b,&c)
	fmt.Scanf("%d%d%d",&x,&y,&z)
	if (x > a){
		x -= a
		a = 0
	}else {
		a -= x
		x = 0
	}
	if (y > b){
		y -= b
		b = 0
	}else {
		b -= y
		y = 0
	}
	if (z > c){
		z -= c
		c = 0
	}else {
		c -= z
		z = 0
	}
	if (x + y + z) <= (a/2 + b/2 + c/2){
		fmt.Print("Yes")
	}else {
		fmt.Print("No")
	}
}

package main

import "fmt"

func main() {
        var a, b [3]int
        for i := 0; i < 3; i++ {
                //      fmt.Println(i)
                fmt.Scanf("%d", &a[i])
        }
        for i := 0; i < 3; i++ {
                fmt.Scanf("%d", &b[i])
        }
        acnt, bcnt := 0, 0
        for i := 0; i < 3; i++ {
                if a[i]-b[i] > 0 {
                        acnt += (((a[i] - b[i]) / 2) * 2)
                } else {
                        bcnt += (b[i] - a[i])
                }
        }
        //fmt.Println(acnt)
        //fmt.Println(bcnt)
        if acnt/2 >= bcnt {
                fmt.Println("Yes")
        } else {
                fmt.Println("No")
        }
}

package main

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

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

	var a, b, c int
	var tA, tB, tC int

	fmt.Fscanf(stdin, "%d%d%d\n", &a, &b, &c)
	fmt.Fscanf(stdin, "%d%d%d\n", &tA, &tB, &tC)

	a = a - tA
	b = b - tB
	c = c - tC

	// fmt.Println(a, b, c)

	if a < 0 {
		a = a * 2
	}
	if b < 0 {
		b = b * 2
	}
	if c < 0 {
		c = c * 2
	}

	if a + b + c >= 0 {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


package main

import (
	"fmt"
)

type Vertex struct {
	neighbors []*Vertex
}

func main() {
	var n, m int
	fmt.Scanf("%d %d\n", &n, &m)
	g1 := make([][]*Vertex, n)
	g2 := make([][]*Vertex, n)
	for i := range g1 {
		g1[i] = make([]*Vertex, m)
		g2[i] = make([]*Vertex, m)
		for j := range g1[i] {
			g1[i][j] = &Vertex{neighbors: make([]*Vertex, 2)}
			g2[i][j] = &Vertex{neighbors: make([]*Vertex, 2)}
		}
	}
	var horizon, vertical string
	fmt.Scanf("%s\n", &horizon)
	fmt.Scanf("%s\n", &vertical)
	for i, c := range horizon {
		if c == '>' {
			for j := 0; j < m-1; j++ {
				g1[i][j].neighbors[0] = g1[i][j+1]
			}
			for j := 1; j < m; j++ {
				g2[i][j].neighbors[0] = g2[i][j-1]
			}
		} else {
			for j := 1; j < m; j++ {
				g1[i][j].neighbors[0] = g1[i][j-1]
			}
			for j := 0; j < m-1; j++ {
				g2[i][j].neighbors[0] = g2[i][j+1]
			}
		}
	}
	for j, c := range vertical {
		if c == 'v' {
			for i := 0; i < n-1; i++ {
				g1[i][j].neighbors[1] = g1[i+1][j]
			}
			for i := 1; i < n; i++ {
				g2[i][j].neighbors[1] = g2[i-1][j]
			}
		} else {
			for i := 1; i < n; i++ {
				g1[i][j].neighbors[1] = g1[i-1][j]
			}
			for i := 0; i < n-1; i++ {
				g2[i][j].neighbors[1] = g2[i+1][j]
			}

		}
	}
	if dfs(g1) && dfs(g2) {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

func dfs(g [][]*Vertex) bool {
	visited := make(map[*Vertex]struct{})
	v := g[0][0]
	dfsRecurse(v, visited)
	return len(visited) == len(g) * len(g[0])

}

func dfsRecurse(v *Vertex, visited map[*Vertex]struct{}) {
	visited[v] = struct{}{}
	for _, n := range v.neighbors {
		if n == nil {
			continue
		}
		if _, ok := visited[n]; !ok {
			dfsRecurse(n, visited)
		}
	}
}

package main

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

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

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

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

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

    n := ReadInt32()
    m := ReadInt32()
    s1 := ReadString()
    s2 := ReadString()
    count := n * m
    a := make([][]int, count)
    for i := 0; i < count; i++ {
        a[i] = make([]int, count)
        a[i][i] = 1
    }

    for i := 0; i < m; i++ {
        if s2[i] == 'v' {
            for j := 0; j < n-1; j++ {
                for k := j + 1; k < n; k++ {
                    a[j*m+i][k*m+i] = 1
                }
            }
        } else {
            for j := n - 1; j > 0; j-- {
                for k := j - 1; k >= 0; k-- {
                    a[j*m+i][k*m+i] = 1
                }
            }
        }
    }

    for i := 0; i < n; i++ {
        if s1[i] == '>' {
            for j := 0; j < m-1; j++ {
                for k := j + 1; k < m; k++ {
                    a[i*m+j][i*m+k] = 1
                }
            }
        } else {
            for j := m - 1; j > 0; j-- {
                for k := j - 1; k >= 0; k-- {
                    a[i*m+j][i*m+k] = 1
                }
            }
        }
    }

    for k := 0; k < count; k++ {
        for i := 0; i < count; i++ {
            for j := 0; j < count; j++ {
                if a[i][k] == 1 && a[k][j] == 1 {
                    a[i][j] = 1
                }
            }
        }
    }

    f := true

    for i := 0; (i < count) && (f); i++ {
        for j := 0; (j < count) && (f); j++ {
            f = a[i][j] != 0
        }
    }

    if f {
        writer.WriteString("YES\n")
    } else {
        writer.WriteString("NO\n")
    }
}

package main

import (
	"fmt"
)

func main() {
	var n, m int
	fmt.Scan(&n)
	fmt.Scan(&m)
	var rows, cols string
	fmt.Scan(&rows)
	fmt.Scan(&cols)
	var tl, tr, bl, br bool

	for i := 0; i < n; i++ {
		var direction = rows[i]
		if i == 0 {
			switch direction {
			case '>':
				tr = true
			case '<':
				tl = true
			}
		}
		if i == n-1 {
			switch direction {
			case '>':
				br = true
			case '<':
				bl = true
			}
		}
	}

	for i := 0; i < m; i++ {
		var direction = cols[i]
		if i == 0 {
			switch direction {
			case 'v':
				bl = true
			case '^':
				tl = true
			}
		}
		if i == m-1 {
			switch direction {
			case 'v':
				br = true
			case '^':
				tr = true
			}
		}
	}
	if tl && tr && bl && br {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

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

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

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

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

var (
    n, m, count int
    row, col    string
    visited     []bool
)

func dfs(i, j int) {
    index := i*m + j
    if i < 0 || j < 0 || i >= n || j >= m || visited[index] {
        return
    }

    visited[index] = true

    if row[i] == '>' {
        dfs(i, j+1)
    } else {
        dfs(i, j-1)
    }

    if col[j] == 'v' {
        dfs(i+1, j)
    } else {
        dfs(i-1, j)
    }
}

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

    n = ReadInt32()
    m = ReadInt32()
    row = ReadString()
    col = ReadString()
    count = n * m
    f := true

    for i := 0; (i < n) && (f); i++ {
        for j := 0; (j < m) && (f); j++ {
            visited = make([]bool, count)
            dfs(i, j)
            for k := 0; (k < count) && (f); k++ {
                f = visited[k]
            }
        }
    }

    if f {
        writer.WriteString("YES\n")
    } else {
        writer.WriteString("NO\n")
    }
}

package main

import (
	"fmt"
)

type Vertex struct {
	neighbors []*Vertex
}

func main() {
	var n, m int
	fmt.Scanf("%d %d", &n, &m)
	g1 := make([][]*Vertex, n)
	g2 := make([][]*Vertex, n)
	for i := range g1 {
		g1[i] = make([]*Vertex, m)
		g2[i] = make([]*Vertex, m)
		for j := range g1[i] {
			g1[i][j] = &Vertex{neighbors: make([]*Vertex, 2)}
			g2[i][j] = &Vertex{neighbors: make([]*Vertex, 2)}
		}
	}

	var horizon, vertical string
	fmt.Scanf("%s %s", &horizon, &vertical)
	for i, c := range horizon {
		if c == '>' {
			for j := 0; j < m-1; j++ {
				g1[i][j].neighbors[0] = g1[i][j+1]
			}
			for j := 1; j < m; j++ {
				g2[i][j].neighbors[0] = g2[i][j-1]
			}
		} else {
			for j := 1; j < m; j++ {
				g1[i][j].neighbors[0] = g1[i][j-1]
			}
			for j := 0; j < m-1; j++ {
				g2[i][j].neighbors[0] = g2[i][j+1]
			}
		}
	}
	for j, c := range vertical {
		if c == 'v' {
			for i := 0; i < n-1; i++ {
				g1[i][j].neighbors[1] = g1[i+1][j]
			}
			for i := 1; i < n; i++ {
				g2[i][j].neighbors[1] = g2[i-1][j]
			}
		} else {
			for i := 1; i < n; i++ {
				g1[i][j].neighbors[1] = g1[i-1][j]
			}
			for i := 0; i < n-1; i++ {
				g2[i][j].neighbors[1] = g2[i+1][j]
			}

		}
	}
	if dfs(g1) && dfs(g2) {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

func dfs(g [][]*Vertex) bool {
	visited := make(map[*Vertex]struct{})
	v := g[0][0]
	dfsRecurse(v, visited)
	return len(visited) == len(g) * len(g[0])

}

func dfsRecurse(v *Vertex, visited map[*Vertex]struct{}) {
	visited[v] = struct{}{}
	for _, n := range v.neighbors {
		if n == nil {
			continue
		}
		if _, ok := visited[n]; !ok {
			dfsRecurse(n, visited)
		}
	}
}


package main

import (
        "fmt"
        "math"
)

var n int

func main() {
        fmt.Scan(&n)
        sqt := math.Sqrt(float64(n))
        hight := int(sqt)
        width := 0
        if hight*hight == n {
                width = hight
        } else {
                width = hight + 1
                if hight*width < n {
                        hight += 1
                }
        }
        fmt.Println(hight*2 + width*2)
}

package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	for i := 1; ; i++ {
		if i*i >= n {
			fmt.Println(4 * i)
			return
		}
		if i*(i+1) >= n {
			fmt.Println(4*i + 2)
			return
		}
	}
}

package main

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

func roundUp(x float64) int {
	return int(math.Floor(x + 1))
}

func main() {
	var n int
	fmt.Scanf("%d\n", &n)
	if sqrt := math.Sqrt(float64(n)); int(sqrt)*int(sqrt) == n {
		fmt.Println(int(sqrt) * 4)
		os.Exit(0)
	} else {
		x := roundUp(sqrt)
		y := x
		for {
			if x*y == n {
				break
			} else if x*y < n {
				x++
				break
			}
			x--
		}
		fmt.Println(x*2 + y*2)
		os.Exit(0)
	}
}

package main

import "fmt"

var (
    n, a, b int
)

func main() {
    fmt.Scan(&n)
    a , b = 1, 1
    for a * b < n {
        a++
        if a > b {
            a, b = b, a
        }
    }
    fmt.Println(2*(a+b))
}


package main

import "fmt"
import "bufio"
import "os"

var bufin *bufio.Reader
var bufout *bufio.Writer

func main() {
	bufin = bufio.NewReader(os.Stdin)
	bufout = bufio.NewWriter(os.Stdout)
	defer bufout.Flush()

	var n int
	var s string

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

	var res []int
	for i := 0; i < n; i++ {
		if s[i] == 'B' {
			j := i
			for (j < n) && (s[j] == 'B') {
				j++
			}
			res = append(res, j-i)
			i = j - 1
		}
	}

	fmt.Fprintf(bufout, "%d\n", len(res))
	for _, v := range res {
		fmt.Fprintf(bufout, "%d ", v)
	}
}

package main

import (
	"fmt"
)

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

	var counter int
	var answer []int
	for i := 0; i <= n; i++ {
		if (i == n || (i != 0 && str[i-1] != str[i])) && counter != 0 {
			answer = append(answer, counter)
			counter = 0
		}
		if i < n && str[i] == 'B' {
			counter++
		}
	}

	fmt.Println(len(answer))
	for _, a := range answer {
		fmt.Printf("%d ", a)
	}
	fmt.Println()
}

package main

import "fmt"

func main() {
    var n int
    fmt.Scan(&n)
    groups := make([]int, n)
    var s string
    fmt.Scan(&s)
    s += "W"
    var lastRune rune = 'W'
    var groupCnt int
    var curGroup int
    for _, r := range s {
        if r == 'B' {
            curGroup++
            if lastRune == 'W' {
                groupCnt++
            }
            lastRune = 'B'
        } else if r == 'W' {
            if lastRune == 'B' {
                groups[groupCnt-1] = curGroup
            }
            lastRune = 'W'
            curGroup = 0
        }
    }
    fmt.Print(groupCnt, "\n")
    for i:=0; i < groupCnt; i++ {
        fmt.Print(groups[i], " ")
    }
}

package main

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

func main() {
	fsc := NewFastScanner()
	N := fsc.NextInt()
	_ = N
	str := fsc.Next()
	var ans []int
	var res int

	for i := 0; i < len(str); i++ {
		if str[i] == 'B' {
			res++
		} else {
			if res > 0 {
				ans = append(ans, res)
			}
			res = 0
		}
	}
	if res > 0 {
		ans = append(ans, res)
	}
	fmt.Println(len(ans))
	for i := 0; i < len(ans); i++ {
		fmt.Print(ans[i], " ")
	}
}

//template
type FastScanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewFastScanner() *FastScanner {
	rdr := bufio.NewReaderSize(os.Stdin, 2028)
	return &FastScanner{r: rdr}
}

func (s *FastScanner) 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 *FastScanner) NextInt() int {
	val, err := strconv.Atoi(s.Next())
	if err != nil {
		panic(err)
	}
	return val
}
func (s *FastScanner) NextInt64() int64 {
	val, err := strconv.ParseInt(s.Next(), 10, 64)
	if err != nil {
		panic(err)
	}
	return val
}
func (s *FastScanner) Pre() {
	if s.p >= len(s.buf) {
		s.ReadLine()
		s.p = 0
	}
}

func (s *FastScanner) ReadLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, err := s.r.ReadLine()
		if err != nil {
			panic(err.Error())
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

package main

import (
    "fmt"
    "regexp"
    "strings"
)

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

    var str string
    fmt.Scanln(&str)
    re := regexp.MustCompile("(W)*")
	str = re.ReplaceAllString(str, "$1")

	blocks := strings.Split(str, "W")
    if len(blocks) > 0 {
        if len(blocks[0]) == 0 {
            blocks = append(blocks[1:])
        }
        if len(blocks[len(blocks) - 1]) == 0 {
            blocks = append(blocks[:len(blocks)-1])
        }
    }
    fmt.Println(len(blocks))
    for _, block := range blocks {
        fmt.Printf("%v ", len(block))
    }
}

// A. One-dimensional Japanese Crossword
/*
Recently Adaltik discovered japanese crosswords. Japanese crossword is a picture, represented as a table sized a × b squares, and each square is colored white or black. There are integers to the left of the rows and to the top of the columns, encrypting the corresponding row or column. The number of integers represents how many groups of black squares there are in corresponding row or column, and the integers themselves represents the number of consecutive black squares in corresponding group (you can find more detailed explanation in Wikipedia https://en.wikipedia.org/wiki/Japanese_crossword).

Adaltik decided that the general case of japanese crossword is too complicated and drew a row consisting of n squares (e.g. japanese crossword sized 1 × n), which he wants to encrypt in the same way as in japanese crossword.

Help Adaltik find the numbers encrypting the row he drew.

Input
The first line of the input contains a single integer n (1 ≤ n ≤ 100) — the length of the row. The second line of the input contains a single string consisting of n characters 'B' or 'W', ('B' corresponds to black square, 'W' — to white square in the row that Adaltik drew).

Output
The first line should contain a single integer k — the number of integers encrypting the row, e.g. the number of groups of black squares in the row.

The second line should contain k integers, encrypting the row, e.g. corresponding to sizes of groups of consecutive black squares in the order from left to right.
Examples

Input
3
BBW

Output
1
2

Input
5
BWBWB

Output
3
1 1 1

Input
4
WWWW

Output
0

Input
4
BBBB

Output
1
4

Input
13
WBBBBWWBWBBBW

Output
3
4 1 3

Note
The last sample case correspond to the picture in the statement.
*/
package main

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

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

	input2, _ := reader.ReadString('\n')
	a := strings.TrimSpace(input2)

	k, g := 0, 0
	arrK := []int{}
	for i := 0; i < n; i++ {
		if a[i] == 'B' {
			k++
		} else if k > 0 {
			g++
			arrK = append(arrK, k)
			k = 0
		}
	}

	if k > 0 {
		g++
		arrK = append(arrK, k)
		k = 0
	}

	fmt.Println(g)

	for _, v := range arrK {
		fmt.Printf("%v ", v)
	}
}

package main

import "fmt"

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

	seq := []int{}
	for i, v := range s {
		if v == 'B' {
			if i == 0 || s[i-1] == 'W' {
				seq = append(seq, 0)
			}
			seq[len(seq)-1]++
		}
	}

	fmt.Println(len(seq))
	if len(seq) == 0 {
		return
	}
	for i, v := range seq {
		if i != 0 {
			fmt.Print(" ")
		}
		fmt.Print(v)
	}
	fmt.Println()
}

// http://acm.timus.ru/problem.aspx?space=1&num=1741
package main

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

// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)

const MOD = 1e9 + 7

func main () {
	var n int
	var str string

	//f, _ := os.Open("input.txt")
	//input := bufio.NewReader(f)
	input := bufio.NewReader(os.Stdin)

	fmt.Fscanln(input, &n)
	fmt.Fscanln(input, &str)

	cnt := 0
	ans := make([]int, 0)
	for i := 0; i < len(str); i++ {
		if str[i] == 'W' {
			if cnt > 0 {
				ans = append(ans, cnt)
				cnt = 0
			}
		} else {
			cnt++
		}
	}

	if cnt > 0 {
		ans = append(ans, cnt)
	}

	fmt.Println(len(ans))
	for i := 0; i < len(ans); i++ {
		if i != 0 {
			fmt.Print(" ", ans[i])
		} else {
			fmt.Print(ans[i])
		}
	}
}

package main

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

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

	codes := []string{}
	b := 0
	for _, c := range strings.TrimSpace(cs) {
		if c == 'B' {
			b++
		} else {
			if b > 0 {
				codes = append(codes, fmt.Sprintf("%d", b))
				b = 0
			}
		}
	}
	if b > 0 {
		codes = append(codes, fmt.Sprintf("%d", b))
	}

	if len(codes) > 0 {
		fmt.Fprintln(os.Stdout, len(codes))
		fmt.Fprintln(os.Stdout, strings.Join(codes, " "))
	} else {
		fmt.Fprintln(os.Stdout, 0)
	}

}

package main

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

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

	codes := []string{}
	b := 0
	for _, c := range strings.TrimSpace(cs) {
		if c == 'B' {
			b++
		} else {
			if b > 0 {
				codes = append(codes, fmt.Sprintf("%d", b))
				b = 0
			}
		}
	}
	if b > 0 {
		codes = append(codes, fmt.Sprintf("%d", b))
	}

	if len(codes) > 0 {
		fmt.Println(strings.Join(codes, " "))
	} else {
		fmt.Println(0)
	}

}

package main

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

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

	codes := []string{}
	b := 0
	for _, c := range strings.TrimSpace(cs) {
		if c == 'B' {
			b++
		} else {
			if b > 0 {
				codes = append(codes, fmt.Sprintf("%d", b))
				b = 0
			}
		}
	}
	if b > 0 {
		codes = append(codes, fmt.Sprintf("%d", b))
	}

	if len(codes) > 0 {
		fmt.Fprintln(os.Stdout, strings.Join(codes, " "))
	} else {
		fmt.Fprintln(os.Stdout, 0)
	}

}

package main

import (
	"fmt"
)

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

	var counter int
	for i := 0; i <= n; i++ {
		if (i == n || (i != 0 && str[i-1] != str[i])) && counter != 0 {
			fmt.Printf("%d ", counter)
			counter = 0
		}
		if i < n && str[i] == 'B' {
			counter++
		}
	}
	fmt.Println()
}

package main

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

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

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

func PrintInts(ints ...int) {
	for _, value := range ints {
		writer.WriteString(strconv.Itoa(value))
		writer.WriteByte(' ')
	}
}

func main() {
	//fmt.Scanf("%d%d",&n, &k)
	scanner.Split(bufio.ScanWords)
	var row string
	var length, index int
	var arr [100]int
	_ = ReadInt32()
	fmt.Scanf("%s", &row)
	for i := 0; i < len(row); i++ {
		if row[i] == 'B' {
			length++
		} else if row[i] != 'B' && length > 0 {
			arr[index] = length
			index++
			length = 0
		}
	}
	if length != 0 {
		arr[index] = length
		index++
	}
	fmt.Printf("%d", index)
	if index > 0 {
		fmt.Printf("\n%d", arr[0])
	}
	for i := 1; i < index; i++ {
		fmt.Printf(" %d", arr[i])
	}
	fmt.Printf("\n")
}

package main

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

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

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

func PrintInts(ints ...int) {
	for _, value := range ints {
		writer.WriteString(strconv.Itoa(value))
		writer.WriteByte(' ')
	}
}

func main() {
	//fmt.Scanf("%d%d",&n, &k)
	scanner.Split(bufio.ScanWords)
	var row string
	var length, index int
	var arr [100]int
	_ = ReadInt32()
	fmt.Scanf("%s", &row)
	for i := 0; i < len(row); i++ {
		if row[i] == 'B' {
			length++
		} else if row[i] != 'B' && length > 0 {
			arr[index] = length
			index++
			length = 0
		}
	}
	if length != 0 {
		arr[index] = length
		index++
	}
	fmt.Println(index)
	for i := 0; i < index; i++ {
		fmt.Println(arr[i], " ")
	}
}

package main

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

func main() {
	fsc := NewFastScanner()
	N := fsc.NextInt()
	_ = N
	str := fsc.Next()
	var ans []int
	var res int

	for i := 0; i < len(str); i++ {
		if str[i] == 'B' {
			res++
		} else {
			if res > 0 {
				ans = append(ans, res)
			}
			res = 0
		}
	}
	fmt.Println(len(ans))
	for i := 0; i < len(ans); i++ {
		fmt.Print(ans[i], " ")
	}
}

//template
type FastScanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewFastScanner() *FastScanner {
	rdr := bufio.NewReaderSize(os.Stdin, 2028)
	return &FastScanner{r: rdr}
}

func (s *FastScanner) 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 *FastScanner) NextInt() int {
	val, err := strconv.Atoi(s.Next())
	if err != nil {
		panic(err)
	}
	return val
}
func (s *FastScanner) NextInt64() int64 {
	val, err := strconv.ParseInt(s.Next(), 10, 64)
	if err != nil {
		panic(err)
	}
	return val
}
func (s *FastScanner) Pre() {
	if s.p >= len(s.buf) {
		s.ReadLine()
		s.p = 0
	}
}

func (s *FastScanner) ReadLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, err := s.r.ReadLine()
		if err != nil {
			panic(err.Error())
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}


package main

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

func main(){
	var n string
	r := bufio.NewScanner(os.Stdin)
	r.Split(bufio.ScanWords)
	w := bufio.NewWriter(os.Stdout)
	r.Scan()
	n = r.Text()
	l := len(n)
	if l < 3 || (l == 3 && n < "128") {
		w.WriteString("byte")
	} else if l < 5 || (l == 5 && n < "32768") {
		w.WriteString("short")
	} else if l < 10 || (l == 10 && n < "2147483648") {
		w.WriteString("int")
	} else if l < 19 || (l == 19 && n < "9223372036854775808") {
		w.WriteString("long")
	} else {
		w.WriteString("BigInteger")
	}
	w.WriteString("\n")
	w.Flush()
}

// 66A
package main

import (
	"fmt"
)

func main() {
	var x string
	fmt.Scan(&x)
	if len(x) < 3 || (len(x) == 3 && x <= "127") {
		fmt.Print("byte")
	} else if len(x) < 5 || (len(x) == 5 && x <= "32767") {
		fmt.Print("short")
	} else if len(x) < 10 || (len(x) == 10 && x <= "2147483647") {
		fmt.Print("int")
	} else if len(x) < 19 || (len(x) == 19 && x <= "9223372036854775807") {
		fmt.Print("long")
	} else {
		fmt.Print("BigInteger")
	}
}

package main

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

func main(){
	var n int64
	r := bufio.NewScanner(os.Stdin)
	r.Split(bufio.ScanWords)
	w := bufio.NewWriter(os.Stdout)
	r.Scan()
	n, _ = strconv.ParseInt(r.Text(), 0, 64)
	if n <= 127 {
		w.WriteString("byte")
	} else if n <= 32767 {
		w.WriteString("short")
	} else if n <= 2147483647 {
		w.WriteString("int")
	} else if n <= 9223372036854775807 {
		w.WriteString("long")
	} else {
		w.WriteString("BigInteger")
	}
	w.WriteString("\n")
	w.Flush()
}

package main

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

func main(){
	var n float64
	r := bufio.NewScanner(os.Stdin)
	r.Split(bufio.ScanWords)
	w := bufio.NewWriter(os.Stdout)
	r.Scan()
	n, _ = strconv.ParseFloat(r.Text(), 64)
	if n >=0 {
		w.WriteString("byte")
	} else if n >= 128 {
		w.WriteString("short")
	} else if n >= 32768 {
		w.WriteString("int")
	} else if n >= 2147483648 {
		w.WriteString("long")
	} else if n >= 9223372036854775808 {
		w.WriteString("BigInteger")
	}
	w.WriteString("\n")
	w.Flush()
}

package main

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

func main(){
	var n string
	r := bufio.NewScanner(os.Stdin)
	r.Split(bufio.ScanWords)
	w := bufio.NewWriter(os.Stdout)
	r.Scan()
	n = r.Text()
	l := len(n)
	if n >= "0" && n < "128" && l <= 3 {
		w.WriteString("byte")
	} else if n >= "128" && n < "32768" && l <= 5 {
		w.WriteString("short")
	} else if n >= "32768" && n < "2147483648" && l <= 10 {
		w.WriteString("int")
	} else if n >= "2147483648" && n < "9223372036854775808" && l <= 19 {
		w.WriteString("long")
	} else {
		w.WriteString("BigInteger")
	}
	w.WriteString("\n")
	w.Flush()
}

package main

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

func main(){
	var n float64
	r := bufio.NewScanner(os.Stdin)
	r.Split(bufio.ScanWords)
	w := bufio.NewWriter(os.Stdout)
	r.Scan()
	n, _ = strconv.ParseFloat(r.Text(), 64)
	if n <= 127 {
		w.WriteString("byte")
	} else if n <= 32767 {
		w.WriteString("short")
	} else if n <= 2147483647 {
		w.WriteString("int")
	} else if n <= 9223372036854775807 {
		w.WriteString("long")
	} else {
		w.WriteString("BigInteger")
	}
	w.WriteString("\n")
	w.Flush()
}

package main

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

func main(){
	var n float64
	r := bufio.NewScanner(os.Stdin)
	r.Split(bufio.ScanWords)
	w := bufio.NewWriter(os.Stdout)
	r.Scan()
	n, _ = strconv.ParseFloat(r.Text(), 64)
	if n == 9223372036854775808 {
		w.WriteString("BigInteger")
	} else if n <= 127 {
		w.WriteString("byte")
	} else if n <= 32767 {
		w.WriteString("short")
	} else if n <= 2147483647 {
		w.WriteString("int")
	} else if n <= 9223372036854775807 {
		w.WriteString("long")
	} else {
		w.WriteString("BigInteger")
	}
	w.WriteString("\n")
	w.Flush()
}

package main

import "os"
import "bufio"

func main(){
	var n string
	r := bufio.NewScanner(os.Stdin)
	r.Split(bufio.ScanWords)
	w := bufio.NewWriter(os.Stdout)
	r.Scan()
	n = r.Text()
	if n <= "127" {
		w.WriteString("byte")
	} else if n <= "32767" {
		w.WriteString("short")
	} else if n <= "2147483647" {
		w.WriteString("int")
	} else if n <= "9223372036854775807" {
		w.WriteString("long")
	} else {
		w.WriteString("BigInteger")
	}
	w.WriteString("\n")
	w.Flush()
}


package main

import (
	"fmt"
)

func main() {
	var (
		n int
	)
	fmt.Scan(&n)
	a, b := Calculate854A(n)
	fmt.Print(a, b)
}

func Calculate854A(n int) (int, int) {
	var maxA = 0
	var maxB = 0
	for i := 1; i < n; i++ {
		var a = i
		var b = n - i
		if a >= b {
			break
		}
		if Gcd(a, b) == 1 {
			maxA = a
			maxB = b
		}
	}
	return maxA, maxB
}

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

package main

import (
        "fmt"
)

func gcd(a int, b int) int {
        if b == 0 {
                return a
        }
        if a < b {
                return gcd(b, a)
        } else {
                return gcd(b, a%b)
        }
}

var num int

func main() {
        fmt.Scan(&num)
        div := num / 2
        for i := div; div >= 1; i-- {
                if gcd(i, num-i) == 1 {
                        fmt.Println(i, num-i)
                        break
                }
        }
}

// cf854a project main.go
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	var a, b int
	for i := n / 2; ; i-- {
		a = i
		b = n - a
		flag := true
		for j := a; j > 1; j-- {
			if a%j == 0 && b%j == 0 {
				flag = false
				break
			}
		}
		if flag {
			break
		}
	}
	fmt.Println(a, b)
}

package main

import (
	"fmt"
)

func gcd(a int32,b int32)(int32){

	if(b==0) {
		return a
	}else {
		return  gcd(b,a%b)
	}
}

func main(){

	var n int32
	fmt.Scanf("%d",&n)
	value:=float64(0)
	var x,y int32
	for i:=int32(1);i<=1000;i++{
		for j:=int32(i);j<=1000;j++{
			if(i+j==n&&gcd(i,j)==1){
				var a,b float64
				a=float64(i)
				b=float64(j)
				tvalue:=a/b
				if(tvalue>value){
					x=int32(a)
					y=int32(b)
				}

			}

		}
	}

	fmt.Printf("%d %d",x,y)

}

package main

import "fmt"

func vzaimnoProst(a, b int) bool {
	return gcd(a, b) == 1
}

func gcd(a, b int) int {
	for a != b {
		if a > b {
			a -= b
		} else {
			b -= a
		}
	}

	return a
}

func main() {
	var a, b, n int
	fmt.Scanf("%d", &n)
	if n%2 == 0 {
		a = n/2 - 1
		b = n/2 + 1
	} else {
		a = n / 2
		b = n/2 + 1
	}
	for !vzaimnoProst(a, b) {
		a--
		b++
	}
	fmt.Println(a, b)
}

package main

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

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

	for a := N / 2; a >= 1; a-- {
		if gcd(a, N-a) == 1 {
			fmt.Println(a, N-a)
			return
		}
	}
}

func gcd(a, b int) int {
	for b > 0 {
		a, b = b, a%b
	}
	return a
}

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 "fmt"

func main() {
	var n, x, a, b int
	fmt.Scan(&n)
	for x = n / 2; x > 0; x-- {
		for a, b = n-x, x; b != 0; {
			a, b = b, a%b
		}
		if a == 1 {
			break
		}
	}
	fmt.Println(x, n-x)
}

package main

import "fmt"

func nod(a, b int) int {
	for b != 0 {
		a, b = b, a%b
	}
	return a
}

func main() {
	var n int
	fmt.Scan(&n)
	for a := n / 2; a > 0; a-- {
		b := n - a
		if nod(a, b) == 1 {
			fmt.Println(a, b)
			return
		}
	}
}

package main

import (
	"fmt"
)

func main() {
	var (
		n int
	)
	fmt.Scan(&n)
	a, b := Calculate854A(n)
	fmt.Print(a, b)
}

func Calculate854A(n int) (int, int) {
	for a := n / 2; a > 0; a-- {
		var b = n - a
		if Gcd(a, b) == 1 {
			return a, b
		}
	}
	return 0, 0
}

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

package main

import "fmt"

func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	if a < b {
		return gcd(b, a)
	} else {
		return gcd(b, a%b)
	}
}

func main() {
	var n int
	fmt.Scan(&n)
	for i := n/2; i >= 1; i-- {
		if gcd(i, n-i) == 1 {
			fmt.Println(i, n-i)
			break
		}
	}
}

package main

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

func solve() {
	n := readInt()
	ansA := 0
	ansB := 0
	for i := 1; i <= n; i++ {
		a := i
		b := n - i
		if a < b {
			ok := true
			for j := 2; j <= a; j++ {
				if a%j == 0 && b%j == 0 {
					ok = false
					break
				}
			}
			if ok {
				ansA = a
				ansB = b
			}
		}
	}
	fmt.Printf("%d %d\n", ansA, ansB)
}

var scanner *bufio.Scanner

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

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

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

func main() {
	var n int;
	fmt.Scan(&n);
	var an, bn int = 0, 1;
	var ch bool;
	for i := 1; i <= n / 2; i++ {

		b := n - i;
		if b < i {
			break;
		}
		ch = true;
		for a := 2; a <= i; a++ {
			if (i % a == 0) && (b % a == 0) {
				ch = false;
				break;
			}
		}
		if ch && bn * i > an * b {
			an, bn = i, b;
		}
	}
	fmt.Print(an," " ,  bn);
}

package main

import (
	"fmt"
)

func main() {
	var (
		n int
	)
	fmt.Scan(&n)
	a, b := Calculate854A(n)
	fmt.Print(a, b)
}

func Calculate854A(n int) (int, int) {
	var maxA = 0
	var maxB = 0
	for i := 1; i < n; i++ {
		var a = i
		var b = n - i
		if a >= b {
			break
		}
		if Gcd(a, b) != 0 {
			maxA = a
			maxB = b
		}
	}
	return maxA, maxB
}

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

package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	var a, b int
	if n %2 == 0{
		a = n/2-1
		b = n/2+1
	} else {
		a = n/2
		b = n/2+1
	}
	fmt.Println(a, " ", b)
}

package main

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

func solve() {
	n := readInt()
	ansA := 0
	ansB := 0
	for i := 1; i <= n; i++ {
		a := i
		b := n - i
		if a < b {
			ok := true
			for j := 2; j < a; j++ {
				if a%j == 0 && b%j == 0 {
					ok = false
					break
				}
			}
			if ok {
				ansA = a
				ansB = b
			}
		}
	}
	fmt.Printf("%d %d\n", ansA, ansB)
}

var scanner *bufio.Scanner

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

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

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

func main() {

}

package main

import "fmt"

func vzaimnoProst(a, b int) bool {
	return gcd(a, b) == 1
}

func gcd(a, b int) int {
	for a != b {
		if a > b {
			a -= b
		} else {
			b -= a
		}
	}

	return a
}

func main() {
	var a, b, n int
	fmt.Scanf("%d", &n)
	if n%2 == 0 {
		a = n/2 - 1
		b = n/2 + 1
	} else {
		a = n / 2
		b = n/2 + 1
	}
	for !vzaimnoProst(a, b) {
		a++
		b--
	}
	fmt.Println(a, b)
}


package main

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

var helper SHelper

func main() {
	helper.Init()
	n := helper.ReadInt64()
	l := n / 10
	r := n % 10
	if r == 0 {
		fmt.Println(n)
	} else if r <= 5 {
		fmt.Println(l * 10)
	} else {
		fmt.Println((l + 1) * 10)
	}
}

type SHelper struct {
	file *os.File
	scanner *bufio.Scanner
}

func (this *SHelper) Init() {
	this.file = os.Stdin
	this.scanner = bufio.NewScanner(this.file)
	this.scanner.Split(bufio.ScanWords)
}

func (this *SHelper) ReadInt64() int64 {
	this.scanner.Scan()
	n, err:= strconv.ParseInt(this.scanner.Text(), 10, 64)
	if err != nil {
		panic(err)
	}
	return n
}

package main

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

func solve() {
	n := readInt()
	v := n % 10
	if v > 5 {
		n += 10 - v
	} else {
		n -= v
	}
	fmt.Println(n)
}

var scanner *bufio.Scanner

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

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

func min(a int, 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 "fmt"

func main() {
    var n uint64
    fmt.Scan(&n)
    last := n%10
    if last <= 5 {
        n = n - last
    } else {
        n = n + (10 - last)
    }
    fmt.Print(n)
}

package main

import "fmt"

func main() {
  var n int
  fmt.Scan(&n)
  ans := 10 * (n / 10)
  if n % 10 > 5 {
    ans += 10
  }
  fmt.Println(ans)
}

package main
import "fmt"
func main() {
    var n uint64
    fmt.Scan(&n)
    if n%10 > 5 {
        fmt.Print(n+(10-(n%10)))
    } else {
        fmt.Print(n-(n%10))
    }
}

package main

import "fmt"

func main() {
    var n int
    fmt.Scan(&n)
    n = n - n%10
    fmt.Print(n)
}


package main

import (
	"fmt"
)

// 6
// 100011

func main() {
	var n int
	fmt.Scanln(&n)
	sum := 0
	var x string
	fmt.Scanln(&x)
	for i := 0; i < n; i++ {
		if x[i] == '0' {
			sum++
		} else {
			sum--
		}
	}
	if sum == 0 {
		fmt.Println(2)
		fmt.Printf("%s %c", x[0:len(x)-1], x[len(x)-1])
	} else {
		fmt.Println(1)
		fmt.Println(x)
	}
}

package main

import (
	"fmt"
)

func main() {
	var a string
	var n, cnt int
	// var x float64
	// var s string
	// scr := bufio.NewReader(os.Stdin)
	// ocr := bufio.NewWriter(os.Stdout)

	fmt.Scanln(&n)
	fmt.Scanln(&a)
	m := make(map[string]int)

	m = count(a, m)

	if m["1"] == m["0"] {
		cnt = 2
	} else {
		cnt = 1
	}

	fmt.Println(cnt)

	if cnt == 2 {
		for x := range a {
			m2 := make(map[string]int)
			m1 := make(map[string]int)
			if x > 0 {
				m2 = count(a[:x], m2)
				m1 = count(a[x:], m1)
				if (m2["1"] != m2["0"]) && (m1["0"] != m1["1"]) {
					fmt.Println(a[:x], " ", a[x:])
					break
				}
			}
		}

	} else {
		fmt.Println(a)
	}
}

func count(a string, m map[string]int) map[string]int {
	for _, y := range a {
		m[string(y)]++
	}
	return m
}

package main

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

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

    count := 0
    for _, ch := range str {
        if ch == '1' {
            count++
        } else {
            count--
        }
    }
    if count != 0 {
        fmt.Printf("1\n%v\n", str)
    } else {
        fmt.Printf("2\n%c %v\n", str[0], str[1:len(str)])
    }
}

package main

import "fmt"

func main() {
	var n int
	var s string
	fmt.Scanln(&n)
	fmt.Scanln(&s)
	o := 0
	l := 0
	for _, r := range s {
		if r == '0' {
			o++
		} else {
			l++
		}
	}
	if l != o {
		fmt.Println(1)
		fmt.Println(s)
		return
	}
	fmt.Println(2)
	fmt.Println(string(s[0]), string(s[1:]))

}

package main

import (
	"fmt"
)
func main() {
	var n int
	var str string

	fmt.Scanln(&n)
	fmt.Scanln(&str)

	l:=0
	r:=0

	for _,s:=range str{
		if s=='0'{
			l++
		} else {
			r++;
		}
	}
	if l!=r{
		fmt.Println(1);
		fmt.Println(str);
		return;
	}
	fmt.Println(2);
	fmt.Println(string(str[0]),string(str[1:]))

}

package main

import "fmt"

func main() {
	var n int
	fmt.Scanln(&n)
	var x string
	fmt.Scanln(&x)
	diff := 0
	for _, c := range x {
		if c == '0' {
			diff++
		} else {
			diff--
		}
	}
	if diff == 0 {
		fmt.Println(2)
		fmt.Print(string(x[0]), " ")
		for i, c := range x {
			if i == 0 {
				continue
			}
			fmt.Print(string(c))
		}
	} else {
		fmt.Println(1)
		fmt.Println(x)
	}
}

package main

import (
	"fmt"
	"strings"
)

func main() {
	var count int
	var number string

	fmt.Scan(&count, &number)

	if strings.Count(number, "0") == strings.Count(number, "1") {
		fmt.Println("2")
		fmt.Print(number[:len(number)-1], " ", string(number[len(number)-1]))
	} else {
		fmt.Println("1")
		fmt.Print(number)
	}
}

package main

import "fmt"

func main() {
	var n, cnt0, cnt1 int32
	fmt.Scanf("%d\n", &n)
	var str string
	fmt.Scanf("%s\n", &str)

	for _, c := range(str) {
		if c == '0' {
			cnt0 ++
		} else {
			cnt1 ++
		}
	}
	if (cnt0 != cnt1) {
		fmt.Println(1)
		fmt.Println(str)
	} else {
		fmt.Println(2)
		fmt.Println(str[0:1], str[1:])
	}
}

package main

import "fmt"

// 800
//https://codeforces.com/problemset/problem/1189/A

func main() {
	var v []byte
	fmt.Scanln(&v)
	fmt.Scanln(&v)
	var ones, zeros int
	for _, k := range v {
		if k == '1' {
			ones++
		} else {
			zeros++
		}
	}
	if ones != zeros {
		fmt.Println("1")
		fmt.Println(string(v))
	} else {
		fmt.Println("2")
		fmt.Println(string(v[0]), string(v[1:]))
	}
}

package main

import (
	"fmt"
	"strings"
)

func retCount(str string) (int, int) {
	one := strings.Count(str, "1")
	zero := strings.Count(str, "0")
	return one, zero
}

func check(str string) bool {
	one, zero := retCount(str)
	if one == zero {
		return false
	} else {
		return true
	}
}

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

package main

import (
	"fmt"
)

func right(n int, stroka string) int {
	var one int = 0
	var zero int = 0
	for i := 0; i < n; i++ {
		if stroka[i] == '1' {
			one += 1
		} else if stroka[i] == '0' {
			zero += 1
		}
	}
	if one == zero {
		return 2
	} else {
		return 1
	}
}

func main() {
	var n int
	var stroka string
	fmt.Scan(&n)
	fmt.Scan(&stroka)
	if n%2 == 1 {
		fmt.Println(1)
		fmt.Println(stroka)
	} else {
		fmt.Println(right(n, stroka))
		if right(n, stroka) == 1 {
			fmt.Println(stroka)
		} else {
			fmt.Println(stroka[:1], stroka[1:])
		}

	}
}

package main

import "fmt"

func main() {
	var s string
	var c int

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

	for _, v := range s {
		if v == 49 {
			c++
		}
	}

	if c*2 == len(s) {
		fmt.Println(2)
		fmt.Println(s[:len(s)-1], s[len(s)-1:])
	} else {
		fmt.Println(1)
		fmt.Println(s)
	}
}

package main

import (
    "fmt"
    "strings"
)

func main() {
    var n int
    var s string
    fmt.Scan(&n)
    fmt.Scan(&s)
    c := strings.Count(s, "1")
    if 2 * c != n {
        fmt.Printf("1\n%s\n", s)
    } else {
        fmt.Printf("2\n%s %s\n", s[:1], s[1:])
    }
}

package main

import "fmt"

func main(){
	var n int
	_,_=fmt.Scanln(&n)
	var s string
	_,_=fmt.Scanln(&s)
	cnt1,cnt2:=0,0
	for _,v:=range s {
		if v == '1' {
			cnt1++
		} else {
			cnt2++
		}
	}
	if cnt1 == cnt2 {
		fmt.Println(2)
		fmt.Printf("%s %c\n",s[0:n-1],s[n-1])
	}else{
		fmt.Println(1)
		fmt.Println(s)
	}
}

// Author: sighduck
// URL: https://codeforces.com/contest/1189/problem/A

package main

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

func Solve(n int, s string) []string {
	ones := 0
	zeros := 0
	for _, char := range s {
		if string(char) == "1" {
			ones += 1
		} else {
			zeros += 1
		}
	}
	if ones != zeros {
		return []string{s}
	}
	return []string{string(s[0]), s[1:]}
}

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

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

	solution := Solve(n, s)
	fmt.Fprintf(writer, "%d\n", len(solution))
	for i := 0; i < len(solution); i++ {
		fmt.Fprintf(writer, "%s ", solution[i])
	}
	fmt.Fprintf(writer, "\n")
}

package main

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

func main() {
	var read = bufio.NewReader(os.Stdin)
	var write = bufio.NewWriter(os.Stdout)
	defer write.Flush()
	var n int
	fmt.Fscan(read, &n)
	var s string
	fmt.Fscan(read, &s)
	if n%2 == 1 {
		fmt.Fprintln(write, 1)
		fmt.Fprint(write, s)
		return
	}
	var a = strings.Split(s, "")
	var n1, n0 int
	for i := 0; i < n; i++ {
		if a[i] == "1" {
			n1++
		} else {
			n0++
		}
	}
	if n1 != n0 {
		fmt.Fprintln(write, 1)
		fmt.Fprint(write, s)
		return
	}
	fmt.Fprintln(write, 2)
	for i := 0; i < n-1; i++ {
		fmt.Fprint(write, a[i])
	}
	fmt.Fprint(write, " ", a[n-1])

}

package main

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

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

    count := 0
    for _, ch := range str {
        if ch == '1' {
            count++
        } else {
            count--
        }
    }
    if count != 0 {
        fmt.Printf("1\n%v\n", str)
    } else {
        fmt.Printf("2\n%c %v\n", str[0], str[1:len(str)])
    }
}

package main

import (
	"fmt"
)

func main() {
	var n int
	var s string
	fmt.Scan(&n)
	fmt.Scan(&s)
	if n == 1 {
		fmt.Println(n)
		fmt.Println(s)
		return
	}
	if n%2 == 0 {
		fmt.Println(2)
		fmt.Println(s[:n/2] + " " + s[n/2:])
	} else {
		fmt.Println(3)
		fmt.Println(s[:n/2] + " " + s[n/2:n/2+1] + " " + s[n/2+1:])
	}
}

package main

import (
	"fmt"
	"strings"
)

func retCount(str string) (int, int) {
	one := strings.Count(str, "1")
	zero := strings.Count(str, "0")
	return one, zero
}

func main() {
	var n, i int
	var s string
	fmt.Scan(&n)
	fmt.Scan(&s)
	if n == 1 {
		fmt.Println(n)
		fmt.Println(s)
		return
	}
	if n%2 == 0 {
		fmt.Println(2)
		fmt.Println(s[:n/2] + " " + s[n/2:])
	} else {
		for i = 1; i < n; i++ {
			one, zero := retCount(s[1:])
			if one != zero {
				break
			}
		}
		if i != n {
			fmt.Println(2)
			fmt.Println(s[:i] + " " + s[i:])
		} else {
			fmt.Println(3)
			fmt.Println(s[:n/2] + " " + s[n/2:n/2+1] + " " + s[n/2+1:])
		}
	}
}

package main

import (
	"fmt"
	"strings"
)

func retCount(str string) (int, int) {
	one := strings.Count(str, "1")
	zero := strings.Count(str, "0")
	return one, zero
}

func check(str string) bool {
	one, zero := retCount(str)
	if one == zero {
		return false
	} else {
		return true
	}
}

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

	}
}

package main

import (
	"fmt"
)

func right(n int, stroka string) int {
	var one int = 0
	var zero int = 0
	for i := 0; i < n; i++ {
		if stroka[i] == '1' {
			one += 1
		} else if stroka[i] == '0' {
			zero += 1
		}
	}
	if one == zero {
		return 2
	} else {
		return 1
	}
}

func main() {
	var n int
	var stroka string
	fmt.Scan(&n)
	fmt.Scan(&stroka)
	if n%2 == 1 {
		fmt.Println(1)
		fmt.Println(stroka)
	} else {
		fmt.Println(right(n, stroka))
		fmt.Println(stroka[:1], stroka[1:])
	}
}