package main

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

func OpenFile(fpath string) *os.File {
	f, err := os.Open(fpath)
	Assert(err == nil)
	return f
}

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

func GetLine(scanner *bufio.Scanner) string {
	Assert(scanner.Scan() && scanner.Err() == nil)
	return scanner.Text()
}

func ReadIntLine(scanner *bufio.Scanner) []int {
	lst := make([]int, 0)
	for _, s := range strings.Fields(GetLine(scanner)) {
		i, err := strconv.Atoi(s)
		Assert(err == nil)
		lst = append(lst, i)
	}
	return lst
}

func SliceIndex(limit int, predicate func(i int) bool) int {
	for i := 0; i < limit; i++ {
		if predicate(i) {
			return i
		}
	}
	return -1
}

func Ternary(c bool, a, b interface{}) interface{} {
	if c { return a }
	return b
}

func main() {
	f := os.Stdin
	//f := strings.NewReader("Now is the winter of our discontent,\n1 3 4\n")
	//f = OpenFile("/home/ilya/opt/programming/tasks/724A.txt")

	sc := bufio.NewScanner(f)

	days := []string{"monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"}
	ReadDay := func() int {
		s := GetLine(sc)
		idx := SliceIndex(len(days), func(i int) bool { return days[i] == s })
		Assert(idx != -1)
		return idx
	}

	first  := ReadDay()
	second := ReadDay()
	diff := second - first
	if diff < 0 {
		diff += 7
	}

	possibles := []int{0, 2, 3}
	res := SliceIndex(len(possibles), func(i int) bool { return possibles[i] == diff })

	fmt.Println(Ternary(res == -1, "NO", "YES"))
}


package main

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

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

var days [12]int = [12]int{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
var weekDays [7]string = [7]string{"monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"}

func getWeekDayId(wd string) int {
	for i := 0; i < 7; i++ {
		if weekDays[i] == wd {
			return i
		}
	}
	return -1
}

func yes(d1 int, d2 int) bool {
	for i := 0; i < 11; i++ {
		if (d1+days[i])%7 == d2 {
			return true
		}
	}
	return false
}

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

	var wd1, wd2 string
	fmt.Fscanf(bufin, "%s\n", &wd1)
	fmt.Fscanf(bufin, "%s\n", &wd2)

	var d1, d2 int
	d1 = getWeekDayId(wd1)
	d2 = getWeekDayId(wd2)

	if yes(d1, d2) {
		fmt.Fprintf(bufout, "YES\n")
	} else {
		fmt.Fprintf(bufout, "NO\n")
	}
}


package main
import ("fmt"
"strings")
func main() {
    var a,b string
    fmt.Scan(&a,&b)
    a=strings.ToLower(a)
    b=strings.ToLower(b)
    if a<b {
        fmt.Println(-1)
    } else if a==b {
        fmt.Println(0)
    } else {
        fmt.Println(1)
    }
}


package main

import (
	"fmt"
	"strings"
)

func main() {
	var a, b string
	fmt.Scan(&a)
	fmt.Scan(&b)
	fmt.Println(strings.Compare(strings.ToLower(a), strings.ToLower(b)))
}


package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	a, _ := reader.ReadString('\n')
	b, _ := reader.ReadString('\n')
	a = strings.ToLower(a)
	b = strings.ToLower(b)
	if a < b {
		fmt.Println(-1)
	} else if a > b {
		fmt.Println(+1)
	} else {
		fmt.Println(0)
	}
}


package main

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

//N _
const (
	N = 1e6 + 5
)

var values []byte

func inputter(inputReader *bufio.Reader,strs chan *string){
	for {
		input , _ := inputReader.ReadString('\n')
		input = strings.TrimSpace(input)
		if len(input) > 0 {
			inputs := strings.Split(input, " ")
			for i := range inputs{
				strs <- &inputs[i]
			}
		}
	}
}

func digits(ch1 chan int64, ch2 chan byte){
	for x := range ch1{
		a := byte(0)
		for x > 0 {
			a += values[x%10]
			x/=10
		}
		ch2 <- a
	}
	close(ch2)
}

func main(){
	rs := bufio.NewReader(os.Stdin)
	ws := bufio.NewWriter(os.Stdout)

	strs := make(chan *string, 100)

	go inputter(rs, strs)

	a , _ := strconv.ParseInt(*<-strs, 10, 64)
	b , _ := strconv.ParseInt(*<-strs, 10, 64)

	values = []byte{6, 2, 5, 5, 4, 5, 6, 3, 7, 6}

	ch1 := make(chan int64, N)
	ch2 := make(chan byte, N)

	go digits(ch1, ch2)

	go func(){
		for i := a; i <= b; i++ {
			ch1 <- i
		}
		close(ch1)
	}()

	total := int64(0)
	for x := range ch2 {
		total += int64(x)
	}

	ws.WriteString(fmt.Sprint(total))
	ws.Flush()
}


package main

import "fmt"

func main() {
	m := map[int]int{
		0: 6,
		1: 2,
		2: 5,
		3: 5,
		4: 4,
		5: 5,
		6: 6,
		7: 3,
		8: 7,
		9: 6,
	}
	var a, b, s int
	fmt.Scan(&a, &b)
	for i := a; i <= b; i++ {
		tmp := i
		for tmp > 0 {
			s += m[tmp%10]
			tmp /= 10
		}
	}
	fmt.Print(s)
}


package main

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

var dig = map[int]int{
	0: 6,
	1: 2,
	2: 5,
	3: 5,
	4: 4,
	5: 5,
	6: 6,
	7: 3,
	8: 7,
	9: 6,
}

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

	scanner.Scan()
	start := strings.Split(scanner.Text(), " ")
	x1, _ := strconv.Atoi(start[0])
	x2, _ := strconv.Atoi(start[1])

	sum := 0
	for i := x1; i <= x2; i++ {
		d := i
		for d != 0 {
			sum += dig[d % 10]
			d = d / 10
		}

	}
	fmt.Print(sum)
}


package main

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

var v []int64 = []int64{0,4,10,20,35,56,83,116,155,198,244,292}

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

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

	if int(n) < len(v) {
		fmt.Printf("%d", v[n])
	} else {
		fmt.Printf("%d", 49 * (n - int64(len(v)) + 1) + v[len(v) - 1])
	}
}


package main

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

// github.com/EndlessCheng/codeforces-go
func CF997B(in io.Reader, out io.Writer) {
	a := [...]int{0, 4, 10, 20, 35, 56, 83, 116, 155, 198, 244}
	var n int64
	Fscan(in, &n)
	if n < 11 {
		Fprint(out, a[n])
	} else {
		Fprint(out, 49*n-247)
	}
}

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


// Author: sighduck
// URL: https://codeforces.com/problemset/problem/592/A

package main

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

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

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

func Solve(board [8]string) string {
	whitePawn := 7
	blackPawn := 0
	for j := 0; j < 8; j++ {
		for i := 0; i < 8; i++ {
			if string(board[i][j]) == "B" {
				break
			} else if string(board[i][j]) == "W" {
				whitePawn = min(i, whitePawn)
				break
			}
		}
		for i := 7; i >= 0; i-- {
			if string(board[i][j]) == "W" {
				break
			} else if string(board[i][j]) == "B" {
				blackPawn = max(i, blackPawn)
				break
			}
		}
	}
	if whitePawn <= 7-blackPawn {
		return "A"
	}
	return "B"
}

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

	var board [8]string
	for i := 0; i < 8; i++ {
		fmt.Fscanf(reader, "%s\n", &board[i])
	}
	fmt.Fprintf(writer, "%s\n", Solve(board))
}


package main

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

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

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

	board := make([]string, 8)
	maxB, minW := 0, 10

	for i := range board {
		board[i] = next()
	}

	for c := 0; c < 8; c++ {
		b, w := -1, -1

		for r := 0; r < 8; r++ {
			if board[r][c] == 'B' {
				break
			}

			if board[r][c] == 'W' {
				w = r
				break
			}
		}

		for r := 7; r >= 0; r-- {
			if board[r][c] == 'W' {
				break
			}

			if board[r][c] == 'B' {
				b = r
				break
			}
		}

		// println(w, b, minW, maxB)

		if w != -1 && w < minW {
			minW = w
		}

		if b != -1 && b > maxB {
			maxB = b
		}
	}

	// println(minW, maxB)
	maxB = 8 - maxB - 1
	// println(minW, maxB)
	if minW <= maxB {
		println("A")
	} else {
		println("B")
	}
}

func scan(a ...interface{}) {
	fmt.Fscan(reader, a...)
}

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

func nextInt64() int64 {
	n, _ := strconv.ParseInt(next(), 0, 64)
	return n
}

func nextInt() int {
	n, _ := strconv.Atoi(next())
	return n
}

func nextFloat() float64 {
	n, _ := strconv.ParseFloat(next(), 64)
	return n
}

func println(a ...interface{})               { fmt.Fprintln(writer, a...) }
func print(a ...interface{})                 { fmt.Fprint(writer, a...) }
func printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }


package main

import (
	"fmt"
	"math"
)

type Point struct {
	X, Y float64
}

type Square struct {
	Points [4]Point
}

func rotateAxis(p Point, angle float64) (res Point) {
	res = Point{}
	angle = (angle * math.Pi) / 180
	res.X = p.X*math.Cos(angle) + p.Y*math.Sin(angle)
	res.Y = -1*p.X*math.Sin(angle) + p.Y*math.Cos(angle)
	return
}

func isInSquare(sq Square, p Point) (b bool) {
	var minHoz float64 = 101
	for _, v := range sq.Points {
		minHoz = math.Min(minHoz, v.Y)
	}

	var maxHoz float64 = -101
	for _, v := range sq.Points {
		maxHoz = math.Max(maxHoz, v.Y)
	}

	var minVer float64 = 101
	for _, v := range sq.Points {
		minVer = math.Min(minVer, v.X)
	}

	var maxVer float64 = -101
	for _, v := range sq.Points {
		maxVer = math.Max(maxVer, v.X)
	}

	return (p.X >= minVer && p.X <= maxVer) && (p.Y >= minHoz && p.Y <= maxHoz)
}

func solve(sq, sq45 Square) bool {
	center := Point{0, 0}
	for _, v := range sq45.Points {
		center.X += v.X
		center.Y += v.Y
		if isInSquare(sq, v) {
			return true
		}
	}

	center.X /= 4
	center.Y /= 4
	if isInSquare(sq, center) {
		return true
	}

	rotatedSquare := Square{}
	for i := range rotatedSquare.Points {
		rotatedSquare.Points[i] = rotateAxis(sq45.Points[i], 45)
	}

	center = Point{0, 0}
	for _, v := range sq.Points {
		center.X += v.X
		center.Y += v.Y
		rotatedPoint := rotateAxis(v, 45)
		if isInSquare(rotatedSquare, rotatedPoint) {
			return true
		}
	}

	center.X /= 4
	center.Y /= 4
	rotatedCenter := rotateAxis(center, 45)
	if isInSquare(rotatedSquare, rotatedCenter) {
		return true
	}

	return false
}

func consoleInput() {
	var x, y float64
	sq := Square{}
	for i := 0; i < 4; i++ {
		fmt.Scan(&x, &y)
		sq.Points[i] = Point{
			X: x,
			Y: y,
		}
	}

	sq45 := Square{}
	for i := 0; i < 4; i++ {
		fmt.Scan(&x, &y)
		sq45.Points[i] = Point{
			X: x,
			Y: y,
		}
	}

	if solve(sq, sq45) {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

func mustEqual(expected, actual bool) {
	if expected == actual {
		fmt.Println("OK")
	} else {
		fmt.Println("FAILED")
	}
}

func test() {
	{
		sq := Square{
			Points: [4]Point{
				Point{0, 0},
				Point{6, 0},
				Point{6, 6},
				Point{0, 6},
			},
		}

		sq45 := Square{
			Points: [4]Point{
				Point{1, 3},
				Point{3, 5},
				Point{5, 3},
				Point{3, 1},
			},
		}

		mustEqual(true, solve(sq, sq45))
	}

	{
		sq := Square{
			Points: [4]Point{
				Point{0, 0},
				Point{6, 0},
				Point{6, 6},
				Point{0, 6},
			},
		}

		sq45 := Square{
			Points: [4]Point{
				Point{7, 3},
				Point{9, 5},
				Point{11, 3},
				Point{9, 1},
			},
		}

		mustEqual(false, solve(sq, sq45))
	}

	{
		sq := Square{
			Points: [4]Point{
				Point{6, 0},
				Point{6, 6},
				Point{0, 6},
				Point{0, 0},
			},
		}

		sq45 := Square{
			Points: [4]Point{
				Point{7, 4},
				Point{4, 7},
				Point{7, 10},
				Point{10, 7},
			},
		}

		mustEqual(true, solve(sq, sq45))
	}

	{
		sq := Square{
			Points: [4]Point{
				Point{-5, -5},
				Point{5, -5},
				Point{5, 5},
				Point{-5, 5},
			},
		}

		sq45 := Square{
			Points: [4]Point{
				Point{6, 0},
				Point{0, 6},
				Point{-6, 0},
				Point{0, -6},
			},
		}

		mustEqual(true, solve(sq, sq45))
	}
}

func main() {
	consoleInput()
	// test()
}


package main

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

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

type Int64Slice []int64

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

type Sq struct {
	v [8]int
}

func (sq *Sq) isPara() bool {
	chk1, chk2 := false, false

	for i := 2; i < 8; i = i + 2 {
		if sq.v[i] == sq.v[0] {
			chk1 = true
		}
	}
	for i := 3; i < 8; i = i + 2 {
		if sq.v[i] == sq.v[1] {
			chk2 = true
		}
	}

	if chk1 && chk2 {
		return true
	}
	return false
}

var s1, s2 Sq

func gettoux() bool {
	xmin := s1.v[0]
	xmax := s1.v[0]
	for i := 2; i < 8; i = i + 2 {
		if s1.v[i] < xmin {
			xmin = s1.v[i]
		}
		if s1.v[i] > xmax {
			xmax = s1.v[i]
		}
	}
	ymin := s2.v[0]
	ymax := s2.v[0]
	for i := 2; i < 8; i = i + 2 {
		if s2.v[i] < ymin {
			ymin = s2.v[i]
		}
		if s2.v[i] > ymax {
			ymax = s2.v[i]
		}
	}

	if xmax < ymin || ymax < xmin {
		return false
	}
	return true
}

func gettouy() bool {
	xmin := s1.v[1]
	xmax := s1.v[1]
	for i := 3; i < 8; i = i + 2 {
		if s1.v[i] < xmin {
			xmin = s1.v[i]
		}
		if s1.v[i] > xmax {
			xmax = s1.v[i]
		}
	}
	ymin := s2.v[1]
	ymax := s2.v[1]
	for i := 3; i < 8; i = i + 2 {
		if s2.v[i] < ymin {
			ymin = s2.v[i]
		}
		if s2.v[i] > ymax {
			ymax = s2.v[i]
		}
	}

	if xmax < ymin || ymax < xmin {
		return false
	}
	return true
}

func gettouxaddy() bool {
	xmin := s1.v[0] + s1.v[1]
	xmax := s1.v[0] + s1.v[1]
	for i := 2; i < 8; i = i + 2 {
		if s1.v[i]+s1.v[i+1] < xmin {
			xmin = s1.v[i] + s1.v[i+1]
		}
		if s1.v[i]+s1.v[i+1] > xmax {
			xmax = s1.v[i] + s1.v[i+1]
		}
	}
	ymin := s2.v[0] + s2.v[1]
	ymax := s2.v[0] + s2.v[1]
	for i := 2; i < 8; i = i + 2 {
		if s2.v[i]+s2.v[i+1] < ymin {
			ymin = s2.v[i] + s2.v[i+1]
		}
		if s2.v[i]+s2.v[i+1] > ymax {
			ymax = s2.v[i] + s2.v[i+1]
		}
	}

	if xmax < ymin || ymax < xmin {
		return false
	}
	return true
}

func gettouxsuby() bool {
	xmin := s1.v[0] - s1.v[1]
	xmax := s1.v[0] - s1.v[1]
	for i := 2; i < 8; i = i + 2 {
		if s1.v[i]-s1.v[i+1] < xmin {
			xmin = s1.v[i] - s1.v[i+1]
		}
		if s1.v[i]-s1.v[i+1] > xmax {
			xmax = s1.v[i] - s1.v[i+1]
		}
	}
	ymin := s2.v[0] - s2.v[1]
	ymax := s2.v[0] - s2.v[1]
	for i := 2; i < 8; i = i + 2 {
		if s2.v[i]-s2.v[i+1] < ymin {
			ymin = s2.v[i] - s2.v[i+1]
		}
		if s2.v[i]-s2.v[i+1] > ymax {
			ymax = s2.v[i] - s2.v[i+1]
		}
	}

	if xmax < ymin || ymax < xmin {
		return false
	}
	return true
}

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

	for i := 0; i < 8; i++ {
		s1.v[i] = ReadInt32()
	}

	for i := 0; i < 8; i++ {
		s2.v[i] = ReadInt32()
	}

	if !s1.isPara() {
		s1, s2 = s2, s1
	}

	if gettoux() && gettouy() && gettouxaddy() && gettouxsuby() {
		fmt.Printf("YES")
	} else {
		fmt.Printf("NO")
	}
}

func Demo() {
	var n, m int64 = ReadInt64(), ReadInt64()
	PrintInt64s(n, m)
	writer.WriteByte('\n')
	slice := []int64{1, 2, 3, 4, 5}
	PrintInt64s(slice...)

	// sortDemo
	//slice := []int64{5, 3, 4, 2, 1}
	sort.Sort(Int64Slice(slice))

	//s := strconv.FormatBool(true)
	//s := strconv.FormatFloat(3.1415, 'E', -1, 64)
	//s := strconv.FormatInt(-42, 16)
	//s := strconv.FormatUint(42, 16)

}

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

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

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

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

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

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

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

func ReadInt64() int64 {
	scanner.Scan()
	ans, _ := strconv.ParseInt(scanner.Text(), 10, 64)
	return ans
}

func ReadFloat64() float64 {
	scanner.Scan()
	ans, _ := strconv.ParseFloat(scanner.Text(), 64)
	return ans
}

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


package main

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

func Init() {
}

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

	cnt := 0
	seen := make(map[int]bool)
	good := make([]bool, N)
	for i := N - 1; i >= 0; i-- {
		if !seen[A[i]] {
			cnt++
			seen[A[i]] = true
			good[i] = true
		}
	}

	io.Println(cnt)
	for i, v := range A {
		if good[i] {
			io.Printf("%d ", v)
		}
	}
	io.Println()
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


package main

import . "fmt"

// github.com/EndlessCheng/codeforces-go
func main() {
	var n int
	Scan(&n)
	a := make([]int, n)
	for i := range a {
		Scan(&a[i])
	}
	u := []int{}
	vis := [1001]bool{}
	for i := n - 1; i >= 0; i-- {
		if !vis[a[i]] {
			vis[a[i]] = true
			u = append(u, a[i])
		}
	}
	Println(len(u))
	for i := len(u) - 1; i >= 0; i-- {
		Print(u[i], " ")
	}
}


package main

import "fmt"

const (
	maxn = 55
)

var (
	n int
	a [maxn]int
	m map[int]bool
	ans []int
)

func main() {
	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		fmt.Scan(&a[i])
	}

	m = make(map[int]bool)
	for i := n - 1; i >= 0; i-- {
		_, inMap := m[a[i]]
		if !inMap {
			ans = append(ans, a[i])
			m[a[i]] = true
		}
	}

	fmt.Println(len(ans))
	for i := len(ans) - 1; i >= 0; i-- {
		fmt.Printf("%v ", ans[i])
	}
}


package main

import (
    "fmt"
)

func main() {
    var n, a, x, b, y int
    fmt.Scan(&n, &a, &x, &b, &y)
    a--
    x--
    b--
    y--
    for ;; a, b = (a + 1) % n, (b + n - 1) % n {
        if a == b {
            fmt.Println("YES")
            return
        }
        if a == x || b == y {
            break
        }
    }
    fmt.Println("NO")
}


package main

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

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

	fmt.Fscanln(scr, &n, &a, &x, &b, &y)

	for i := 0; i <= n+1; i++ {
		if a == b {
			cnt = 2
			break
		}
		a++
		if a == n+1 {
			a = 1
		}
		b--
		if b == 0 {
			b = n
		}

		if a == b {
			cnt = 2
			break
		}

		if a == x || b == y {
			break
		}
	}

	if cnt == 2 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


package main

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

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

func readInt() int {
	scanner.Scan()
	n, err := strconv.Atoi(scanner.Text())
	if err != nil {
		panic(err)
	}
	return n
}

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

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

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

func main() {
	scanner.Split(bufio.ScanWords)

	n, a, x, b, y := readInt(), readInt(), readInt(), readInt(), readInt()
	a--
	b--
	x--
	y--

	for {
		if a == b {
			fmt.Println("YES")
			return
		}

		if a == x || b == y {
			break
		}

		a = (a + 1) % n
		b = (b - 1 + n) % n
	}
	fmt.Println("NO")
}


package main

import "fmt"

func main() {
	var a, b int
	fmt.Scanf("%d %d", &a, &b)
	i := 1
	for {
		if a-i < 0 {
			fmt.Println("Vladik")
			return
		}
		a = a - i
		if b-i-1 < 0 {
			fmt.Println("Valera")
			return
		}
		b = b - i - 1
		i += 2
	}
}


// Codeforces helper functions
// 20 Jan 18
// samadhi

package main

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

const debug = true

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

	in := gsli(reader)
	a := in[0]
	b := in[1]

	i := 1

	for true {
		a -= i
		if a < 0 {
			fmt.Println("Vladik")
			return
		}
		i++
		b -= i
		if b < 0 {
			fmt.Println("Valera")
			return
		}
		i++
	}

}

// Input helpers

// If you don't pass in a reference to the reader, and just instantiate a new
// one every time, it will work locally, with IO typed at human-speed, but not
// on Codeforces.

// Get Space-separated Line as Strings
//
// Example input:
// 1 test 382.0
// Example output:
// ["1", "test", "382.0"]

func gsls(reader *bufio.Reader) (arr []string) {
	// Get a full line
	input, _ := reader.ReadString('\n')

	//Strip newline and return chars, if any
	input = strings.TrimSuffix(input, "\n")
	input = strings.TrimSuffix(input, "\r")

	// Split at the spaces into an array
	arr = strings.Split(input, " ")

	return
}

// Get Space-separated Line as Integers
// Any non-valid integers will be 0
//
// Example input:
// test 1 12.3 -117
// Example output:
// [0, 1, 0, -117]

func gsli(reader *bufio.Reader) (arr []int) {
	stringArr := gsls(reader)

	for _, e := range stringArr {
		cur, _ := strconv.Atoi(e)
		arr = append(arr, cur)
	}

	return
}

// Get Space-separated Line as 64-bit Floats
// Any non-valid floats will be 0
//
// Example input:
// test 128.328 12 -11.0
// Example output:
// [0, 128.328, 12, -11]

func gslf(reader *bufio.Reader) (arr []float64) {
	stringArr := gsls(reader)

	for _, e := range stringArr {
		cur, _ := strconv.ParseFloat(e, 64)
		arr = append(arr, cur)
	}

	return
}

// String helpers

// Is Lowercase
// Given some string[i], return whether it is lower case or not.

func isl(b byte) bool {
	var r rune
	r = rune(b)
	return unicode.IsLower(r)
}

// Math helpers

// Positve Modulo
// Returns x mod y, but always positive

func posMod(x, y int) int {
	return (x%y + y) % y
}

// Max Int
// Returns the max of two ints

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

// Distance formule
// Calculates the distance to the origin

func dist(x, y float64) float64 {
	return math.Sqrt(math.Pow(x, 2) + math.Pow(y, 2))
}

// Output helpers

func yes() {
	fmt.Println("Yes")
}

func no() {
	fmt.Println("No")
}

// Debug helpers

// From https://groups.google.com/forum/#!topic/golang-nuts/Qlxs3V77nss

func dbg(s string, a ...interface{}) {
	if debug {
		fmt.Printf(s, a...)
	}
}


package main

import "fmt"

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

  var i int = 1
  for vladik >= 0 && valera >= 0 {
    if i % 2 == 1 {
      vladik -= i
    } else {
      valera -= i
    }
    i += 1
  }

  if vladik < 0 {
    fmt.Println("Vladik")
  } else {
    fmt.Println("Valera")
  }
}


package main

import "fmt"

func main() {
	var n, a, b, c, res int64
	fmt.Scan(&n, &a, &b, &c)
	r := n % 4
	switch r {
	case 0:
		res = 0
	case 1:
		res = min(3*a, b+a, c)
	case 2:
		res = min(2*a, b, 2*c, a+b+c)
	case 3:
		res = min(a, c+b, 3*c)
	}
	fmt.Println(res)
}

func min(a ...int64) int64 {
	min := a[0]
	for _, n := range a {
		if n < min {
			min = n
		}
	}
	return min
}


package main

import (
	"fmt"
)

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

	need := 4 - n%4
	if need == 1 {
		fmt.Println(min(min(a, b+c), c*3))
	} else if need == 2 {
		fmt.Println(min(min(a*2, b), c*2))
	} else if need == 3 {
		fmt.Println(min(min(a*3, a+b), c))
	} else if need == 4 {
		fmt.Println(0)
	}
}

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


package main

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

func solve() {
    n, a, b, c := readInt64(), readInt64(), readInt64(), readInt64()
    from, to := int64(0), int64(10)
    ans := int64(1<<50)
    for i1 := from; i1 < to; i1++ {
        for i2 := from; i2 < to; i2++ {
            for i3 := from; i3 < to; i3++ {
                k := i1 + 2*i2 + 3*i3
                if (n+k) % 4 == 0 {
                    cost := i1*a + i2*b + i3*c
                    if cost < ans {
                        ans = cost
                    }
                }
            }
        }
    }
    fmt.Println(ans)
}

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

func main() {
    a := make([]int, 10)
    for i := 0; i < 6; i++ {
        var x int
        fmt.Scan(&x)
        a[x]++
    }
    sort.Ints(a)
    if a[len(a)-1] == 6 {
        fmt.Println("Elephant")
    } else if a[len(a)-1] == 5 {
        fmt.Println("Bear")
    } else if a[len(a)-1] == 4 {
        if a[len(a)-2] == 2 {
            fmt.Println("Elephant")
        } else {
            fmt.Println("Bear")
        }
    } else {
        fmt.Println("Alien")
    }
}


package main

import "fmt"

var sticks [10]int

func main() {
	v := 0
	for i := 0; i < 6; i++ {
		fmt.Scan(&v)
		sticks[v] += 1
	}

	legOk := false
	elephant := false
	for i := 0; i < len(sticks); i++ {
		if sticks[i] >= 4 {
			legOk = true
			if sticks[i] == 6 {
				elephant = true
			}
		} else if sticks[i] == 2 {
			elephant = true
		}
	}

	if !legOk {
		fmt.Println("Alien")
	} else if elephant {
		fmt.Println("Elephant")
	} else {
		fmt.Println("Bear")
	}
}


package main

import (
    "fmt"
    )

func main() {
    var length[6] int
    var counts[10] int
    for i := 0; i < 6; i++ {
        fmt.Scan(&length[i])
        counts[length[i]]++
    }

    leg := -1
    for i := 0; i < 10; i++ {
        if counts[i] >= 4 {
            leg = i
        }
    }
    if leg == -1 {
        fmt.Println("Alien")
    } else {
        a := -1
        b := -1
        if (counts[leg] == 5) {
            a = leg
        } else if (counts[leg] == 6) {
            a = leg
            b = leg
        }

        for i := 0; i < 10; i++ {
            if counts[i] > 0 && i != leg {
                if a == -1 {
                    a = i
                } else if b == -1 {
                    b = i
                }
            }
        }

        if b == -1 {
            b = a
        }

        if a == b {
            fmt.Println("Elephant")
        } else {
            fmt.Println("Bear")
        }
    }
}


package main

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

func main() {
	var a int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &a)
	for sumdigit(a)%4 != 0 {
		a++
	}
	fmt.Println(a)
}
func sumdigit(a int) int {
	sum := 0
	for a > 0 {
		sum += a % 10
		a /= 10
	}
	return sum
}


package main

import (
	"fmt"
)

func isInteresting(n int) bool {
	s := 0
	for n > 0 {
		s += n % 10
		n /= 10
	}
	if s%4 == 0 {
		return true
	}
	return false
}

func main() {
	var n int
	fmt.Scanf("%d\n", &n)
	for n > 0 {
		if isInteresting(n) == true {
			fmt.Printf("%d\n", n)
			break
		}
		n++
	}
}


package main

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

func sumc(a int) int {
	var astr = strconv.Itoa(a)
	var nums = strings.Split(astr, "")
	var res = 0
	for i := 0; i < len(nums); i++ {
		var d, _ = strconv.Atoi(nums[i])
		res = res + d
	}
	return res
}

func main() {
	//var read, _ = os.Open("dat.txt")
	//var write, _ = os.Create("result.txt")
	var read = bufio.NewReader(os.Stdin)
	var write = bufio.NewWriter(os.Stdout)
	var n int
	fmt.Fscan(read, &n)
	for i := 0; i < 1000; i++ {
		var r = n + i
		var res = sumc(r)
		if res%4 == 0 {
			fmt.Fprint(write, r)
			break
		}
	}

	write.Flush()
	//read.Close()
	//write.Close()
}


package main

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

func solve(s string) int {
	var current byte = 'a'
	sum := 0
	for i := range s {
		d := int(math.Abs(float64(current) - float64(s[i])))
		if d < 13 {
			sum += d
		} else {
			sum += 26 - d
		}
		current = s[i]
	}

	return sum
}

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

	var s string

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

	fmt.Fprintf(os.Stdout, "%d\n", solve(s))
}


package main

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

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

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

func dist(c int, d int) int {
	x := abs(c - d)
	y := 26 - x
	if x < y {
		return x
	}
	return y
}

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

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

	cur := 0
	res := 0
	n := len(s)

	for i := 0; i < n; i++ {
		c := int(s[i] - 'a')
		d := dist(cur, c)
		res += d
		cur = c
	}

	fmt.Fprintf(bufout, "%d\n", res)
}


package main

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

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

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

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

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

func main() {
    scanner.Split(bufio.ScanWords)

    s := ReadString()
    res := 0
    lastChar := 'a'

    for i := 0; i < len(s); i++ {
        if int(s[i]) == int(lastChar) {
            continue
        }

        ans := math.MaxInt32

        if int(s[i]) > int(lastChar) {
            ans = Min(int(s[i]) - int(lastChar), ans)
            ans = Min(int('z') - int(s[i]) + 1 + int(lastChar) - int('a'), ans)
        } else {
            ans = Min(int(lastChar) - int(s[i]), ans)
            ans = Min(int('z') - int(lastChar) + 1 + int(s[i]) - int('a'), ans)
        }

        res += ans
        lastChar = rune(s[i])
    }

    fmt.Print(res)
}


// 437A
package main

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

func main() {
	var (
		s      string
		k      int
		a      [4]int
		b1, b2 bool
	)
	out := bufio.NewWriter(os.Stdout)
	tmp := 0
	for i := 0; i < 4; i++ {
		fmt.Scan(&s)
		a[i] = len(s) - 2
	}
	for i := 0; i < 4; i++ {
		b1 = true
		b2 = true
		for j := 0; j < 4; j++ {
			if j != i {
				if 2*a[i] > a[j] {
					b1 = false
				}
				if a[i] < 2*a[j] {
					b2 = false
				}
			}
		}
		if b1 || b2 {
			tmp++
			k = i
		}
	}
	if tmp == 1 {
		m := 65 + k
		fmt.Fprintln(out, string(m))
	} else {
		fmt.Fprintln(out, string('C'))
	}
	out.Flush()
}


package main

import ("fmt";"sort")

type set map[int]bool

func main(){
	a := make([]string, 4)
	for i := 0; i < 4; i++{
		scan(&a[i])
	}
	sort.Slice(a, func (i, j int)bool{return len(a[i]) < len(a[j])})
	if (len(a[0]) - 2) * 2 <= len(a[1]) - 2 && (len(a[2]) - 2) * 2 <= len(a[3]) - 2{
		sout("C")
	}else if (len(a[0]) - 2) * 2 <= len(a[1]) - 2{
		sout(string(a[0][0]))
	}else if (len(a[2]) - 2) * 2 <= len(a[3]) - 2{
		sout(string(a[3][0]))
	}else{
		sout("C")
	}
}

func scan(in ... interface{}){
	for _,k := range in{
		fmt.Scan(k)
	}
}

func sout(obj ... interface{}){
	for _, k := range obj{
		fmt.Print(k)
	}
	//fmt.Println()
}


package main

import "fmt"

func main() {
	lens := make([]int, 4, 4)
	choice := ""
	min := 0
	max := 0
	for i := 0; i < 4; i++ {
		fmt.Scan(&choice)
		lens[i] = len(choice) - 2
		if lens[min] > lens[i] {
			min = i
		}
		if lens[max] < lens[i] {
			max = i
		}
	}

	//fmt.Println(min, max)

	ans := 2
	cnt := 0
	for i := 0; i < 4; i++ {
		if lens[i] >= 2*lens[min] {
			cnt++
		}
	}
	//fmt.Println(cnt)
	if cnt == 3 {
		ans = min
	}

	cnt = 0
	for i := 0; i < 4; i++ {
		if lens[i] <= lens[max]/2 {
			cnt++
		}
	}

	if cnt == 3 {
		if ans == 2 {
			ans = max
		} else {
			ans = 2
		}
	}

	fmt.Println(string(ans + 'A'))
}


package main

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

func modpow(x, n, mod int) int {
	if n == 0 {
		return 1 % mod
	}
	u := modpow(x, n/2, mod)
	u = (u * u) % mod
	if n&1 == 1 {
		u = (x * u) % mod
	}

	return u
}

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

func Solve(reader io.Reader, writer io.Writer) {
	mod := 1000000007

	var n, k int
	fmt.Fscanf(reader, "%d %d\n", &n, &k)
	comb := 1
	ans := 1
	for i := 1; i <= Min(n, k); i++ {
		comb = (comb * (n - i + 1)) % mod
		comb = (comb * modpow(i, mod-2, mod)) % mod
		ans = (ans + comb) % mod

	}
	fmt.Fprintln(writer, ans)
}

func main() {
	// f, err := os.Open("data.txt")
	// if err != nil {
	// 	os.Exit(1)
	// }
	// defer f.Close()

	// reader := bufio.NewReader(f)
	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)
	Solve(reader, writer)
	writer.Flush()

}


package main

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

var P107 int = 1000000007

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

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

func Abs(a int) int {
	return Max(a, -a)
}

func Gcd(a, b int) int {
	min := Min(a, b)
	max := Max(a, b)
	if min == 0 {
		return max
	}

	for max%min != 0 {
		min, max = max%min, min
	}

	return min
}

func Lcm(a, b int) int {
	return a / Gcd(a, b) * b
}

var facs []int = make([]int, 100010)

func FacP(n, p int) int {
	if facs[n] != 0 {
		return facs[n]
	}

	result := 1
	facs[0] = 1
	for i := 1; i <= n; i++ {
		result = (result * i) % p
		facs[i] = result
	}

	return result
}

func ExpP(a, x, p int) int {
	if x == 0 {
		return 1
	}

	if x%2 == 0 {
		half := ExpP(a, x/2, p)
		return (half * half) % p
	} else {
		return ((a % p) * ExpP(a, x-1, p)) % p
	}
}

func CombP(n, c, p int) int {
	return (FacP(n, p) * ((ExpP(FacP(n-c, p), p-2, p) * ExpP(FacP(c, p), p-2, p)) % p)) % p
}

func Solve(reader *bufio.Reader) {
	scanner := bufio.NewScanner(reader)
	scanner.Split(bufio.ScanWords)
	wr := bufio.NewWriter(os.Stdout)
	defer wr.Flush()

	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())
	scanner.Scan()
	k, _ := strconv.Atoi(scanner.Text())
	k = Min(k, n)

	result := 0
	for i := 0; i <= k; i++ {
		result = (result + CombP(n, i, P107)) % P107
	}

	wr.WriteString(strconv.Itoa(result) + "\n")
}

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


package main

import (
	"fmt"
)

const modulo int64 = 1000000000 + 7

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

	const all_ways int64 = 3 * 3 * 3
	const sei_ways int64 = 7

	a := power_modulo(all_ways, n)
	b := power_modulo(sei_ways, n)
	if a < b {
		a += modulo
	}

	fmt.Println(a - b)
}

// Calculate w to the power of n, in modulo of 1000000007
func power_modulo(w int64, n int) int64 {

	rs := make([]int64, n+1)
	rs[1] = w % modulo

	for i := 2; i <= n; i++ {
		p := rs[i-1] * w
		if p >= modulo {
			p %= modulo
		}

		rs[i] = p
	}

	return rs[n]
}


package main

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

// github.com/EndlessCheng/codeforces-go
func CF584B(_r io.Reader, _w io.Writer) {
	const mod int64 = 1e9 + 7
	pow := func(x int64, n int) int64 {
		res := int64(1)
		for ; n > 0; n >>= 1 {
			if n&1 == 1 {
				res = res * x % mod
			}
			x = x * x % mod
		}
		return res
	}
	var n int
	Fscan(_r, &n)
	Fprint(_w, (pow(27, n)-pow(7, n)+mod)%mod)
}

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


package main

import (
	"bufio"
	"fmt"
	"math/big"
	"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 init() {
	if f, err := os.Open("in.txt"); err == nil {
		r = bufio.NewReader(f)
	} else {
		r = bufio.NewReader(os.Stdin)
	}
	w = bufio.NewWriter(os.Stdout)
}

func main() {
	defer w.Flush()
	var n int64
	for I(&n, "\n") == nil {
		solve(n)
	}
}

func solve(n int64) {
	ans := big.NewInt(n)
	a := big.NewInt(27)
	b := big.NewInt(7)
	c := big.NewInt(1e9 + 7)

	a.Exp(a, ans, nil)
	b.Exp(b, ans, nil)
	ans.Sub(a, b)
	ans.Mod(ans, c)
	O(ans, "\n")
}


package main;import"fmt";func main(){var z string;fmt.Scan(&z);a:=make(map[rune]int);for _,i:=range z{a[i]=1};if len(a)%2==0{fmt.Print("CHAT WITH HER!")}else{fmt.Print("IGNORE HIM!")}}


package main

import (
	"fmt"
	"strings"
	"unicode/utf8"
)

func odd(str string)(int){
	n := utf8.RuneCountInString(str)
	for j, i := range(str){
		if strings.Count(str[0:j], string(i)) > 0{
			n -= 1
		}
	}
	return n % 2
}

func main(){
	dct := map[int]string{
		0: "CHAT WITH HER!",
		1: "IGNORE HIM!",
	}
	var name string
	var isOdd int
	fmt.Scan(&name)
	isOdd = odd(name)
	fmt.Println(dct[isOdd])
}


package main

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

func main() {
    st:= ""

	in := bufio.NewReader(os.Stdin)

    fmt.Fscan(in, &st)
    stnew :=""

    //st = strings.Replace(st,"m","",-1)
    //st = strings.Replace(st,string(st[0]),"",-1)
    for len(st)>0{
       stnew += string(st[0])
       st = strings.Replace(st,string(st[0]),"",-1)
    }
    //stnew = st
    if(len(stnew)%2)==0{
        fmt.Println("CHAT WITH HER!")
    }else{
        fmt.Println("IGNORE HIM!")
    }

}


package main

import "fmt"

func main() {
	var input string
	var len int

	fmt.Scanln(&len)
	fmt.Scanln(&input)

	var acc int
	piv := 1

	for acc < len {
		acc += piv

		fmt.Printf("%s", input[acc-1:acc])

		piv++
	}

	fmt.Println()
}


package main

import "fmt"

func main() {
	var s string
	var n int
	fmt.Scanf("%d\n%s", &n, &s)
	for i, j := 0, 1; i < n; i, j = i+j, j+1 {
		fmt.Printf("%c", []rune(s)[i])
	}
}


package main

import (
	"fmt"
)

func decode(in string) string {
	var i int

	for i < len(in) {
		in = in[:i+1] + in[i+i+1:]
		i++
	}

	return in
}

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

	fmt.Print(decode(text))
}


package main

import (
	"fmt"
)

func needs(sum, xor, carry, digit int64) int64 {
	if digit < 1 {
		return 1 - carry
	}

	if (xor & digit) != 0 {
		if (sum & digit) != 0 {
			return (1 - carry) * 2 * needs(sum, xor, 0, digit>>1)
		}
		return carry * 2 * needs(sum, xor, 1, digit>>1)
	}

	if (sum & digit) != 0 {
		return needs(sum, xor, 1, digit>>1)
	}
	return needs(sum, xor, 0, digit>>1)
}

func main() {
	var sum, xor int64
	fmt.Scan(&sum, &xor)

	if sum != xor {
		fmt.Println(needs(sum, xor, 0, 1<<62))
	} else {
		fmt.Println(needs(sum, xor, 0, 1<<62) - 2)
	}
}


package main

import "fmt"

func solve(s, x int64) int64 {
	if (s-x)%2 == 1 {
		return 0
	}
	if ((s-x)/2)&x != 0 {
		return 0
	}
	if s < x {
		return 0
	}
	res := int64(1)
	for y := x; y > 0; y &= (y - 1) {
		res *= 2
	}
	if s-x == 0 {
		res -= 2
	}
	return res
}

func main() {
	var s, x int64
	fmt.Scan(&s, &x)
	fmt.Println(solve(s, x))
}


package main

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

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

const BITS = 50

var s, x int64

func main() {
	defer out.Flush()
	fmt.Fscan(in, &s, &x)
	ans := solve(0, 0)
	if s == x {
		ans -= 2
	}
	fmt.Fprintln(out, ans)
}

func solve(i, carry int) int64 {
	if i == BITS {
		if carry == 0 {
			return 1
		}
		return 0
	}
	key := Key{i, carry}
	if result, ok := cache[key]; ok {
		return result
	}
	result := int64(0)
	for a := 0; a <= 1; a++ {
		b := a ^ get(i, x)
		sum := a + b + carry
		if sum&1 == get(i, s) {
			result += solve(i+1, sum>>1)
		}
	}
	cache[key] = result
	return result
}

var cache = map[Key]int64{}

type Key struct {
	i, carry int
}

func get(i int, x int64) int {
	return int((x >> uint(i)) & 1)
}


package main

import "fmt"

func main() {
    var n,t int
    var a [55]int
    var s string
    fmt.Scan(&n,&t,&s)
    for i, v := range s { a[i] = int(v) }
    for ; t > 0; t-- {
        for i := 1; i < n; i++ {
            if (a[i] == 'G') && (a[i-1] == 'B') {
                a[i], a[i-1] = a[i-1], a[i]
                i++
            }
        }
    }
    for i := 0; i < n; i++ { fmt.Print(string(a[i])) }
    fmt.Println()
}


package main

import (
	"fmt"
)

func main() {
	var n, t int
	var s string
	fmt.Scanf("%d %d\n", &n, &t)
	fmt.Scanf("%v\n", &s)
	fmt.Println(solve(s, t))
}

func solve(s string, n int) string {
	bs := []byte(s)
	for n > 0 {
		i := 0

		for i < len(bs)-1 {
			if bs[i] == 'B' && bs[i+1] == 'G' {
				bs[i], bs[i+1] = bs[i+1], bs[i]
				i += 2
			} else {
				i++
			}
		}
		n--
	}

	return string(bs)
}


package main

import (
	"fmt"
	"os"
)

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

    //run it for t secs or t times.
	var chars = []byte(str)

	for i := 0; i < t; i++ {
		for j := 0; j < n; {
			if j+1 < n && chars[j] == 'B' && chars[j+1] == 'G' {
				chars[j] = 'G'
				chars[j+1] = 'B'
				j = j + 2
			} else {
				j = j + 1
			}
		}
	}
	fmt.Fprintf(os.Stdout, "%s", string(chars))

}


package main

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

var n, t int
var s string

func main() {
	stdin := os.Stdin
	// stdin, _ = os.Open("1.in")
	reader := bufio.NewReaderSize(stdin, 1<<20)
	fmt.Fscanf(reader, "%d%d\n%s\n", &n, &t, &s)
	sb := []byte(s)
	for ; t != 0; t-- {
		for i := 0; i < n-1; i++ {
			if sb[i] == 'B' && sb[i+1] == 'G' {
				sb[i] = 'G'
				sb[i+1] = 'B'
				i++
			}
		}
	}
	fmt.Println(string(sb))
}


package main

import "fmt"

// B. Queue at the School
// time limit per test
// 2 seconds
// memory limit per test
// 256 megabytes
// input
// standard input
// output
// standard output

// During the break the schoolchildren, boys and girls, formed a queue of n people in the canteen. Initially the children stood in the order they entered the canteen. However, after a while the boys started feeling awkward for standing in front of the girls in the queue and they started letting the girls move forward each second.

// Let's describe the process more precisely. Let's say that the positions in the queue are sequentially numbered by integers from 1 to n, at that the person in the position number 1 is served first. Then, if at time x a boy stands on the i-th position and a girl stands on the (i + 1)-th position, then at time x + 1 the i-th position will have a girl and the (i + 1)-th position will have a boy. The time is given in seconds.

// You've got the initial position of the children, at the initial moment of time. Determine the way the queue is going to look after t seconds.
// Input

// The first line contains two integers n and t (1 ≤ n, t ≤ 50), which represent the number of children in the queue and the time after which the queue will transform into the arrangement you need to find.

// The next line contains string s, which represents the schoolchildren's initial arrangement. If the i-th position in the queue contains a boy, then the i-th character of string s equals "B", otherwise the i-th character equals "G".
// Output

// Print string a, which describes the arrangement after t seconds. If the i-th position has a boy after the needed time, then the i-th character a must equal "B", otherwise it must equal "G"

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

	currentState := []byte(queue)
	nextState := []byte(queue)

	for i := 0; i < t; i++ {
		for i := 0; i < len(currentState)-1; {
			if currentState[i] == 'B' && currentState[i+1] == 'G' {
				nextState[i] = 'G'
				nextState[i+1] = 'B'
				i += 2
			} else {
				nextState[i] = currentState[i]
				i++
			}
		}

		currentState = nextState
		nextState = currentState
	}

	fmt.Print(string(currentState))
}


package main

import(
    "fmt"
)

type u32 uint32

func main(){
    var(
        n,t,i u32
        s   string
    )

    fmt.Scan(&n,&t)
    fmt.Scan(&s)
    b := make([]byte,len(s))
    for i=0;i<n;i++{
        b[i]=s[i]
    }
    for t>0{
        for i=1;i<n;i++{
            if b[i]>b[i-1]{
               b[i],b[i-1]=b[i-1],b[i]
               i++
            }
        }
        t--
    }
    fmt.Println(string(b))
}


package main

import "fmt"

func main() {
	var n, t int
	fmt.Scan(&n, &t)
	var s string
	fmt.Scan(&s)
	a := []byte(s)
	for i := 0; i < t; i++ {
		for j := 0; j < n; j++ {
			if a[j] == 'B' && j < n-1 {
				if a[j+1] == 'G' {
					a[j+1] = 'B'
					a[j] = 'G'
					j++
				}
			}
		}
	}
	fmt.Print(string(a))
}


package main

import (
	"fmt"
)

func main() {
	var n int
	var t int
	var s string
	fmt.Scanf("%d%d\n%s\n", &n, &t, &s)
	out := []byte(s)
	for i := 0; i < t; i++ {
		for j := 0; j < n-1; j++ {
			if out[j] == 66 && out[j+1] == 71 {
				out[j] = 71
				out[j+1] = 66
				j++
			}
		}
	}

	fmt.Println(string(out))
}


/* https://codeforces.com/problemset/problem/266/B
B. Queue at the School
time limit per test2 seconds
memory limit per test256 megabytes
inputstandard input
outputstandard output
During the break the schoolchildren, boys and girls, formed a queue of n people in the canteen. Initially the children stood in the order they entered the canteen. However, after a while the boys started feeling awkward for standing in front of the girls in the queue and they started letting the girls move forward each second.

Let's describe the process more precisely. Let's say that the positions in the queue are sequentially numbered by integers from 1 to n, at that the person in the position number 1 is served first. Then, if at time x a boy stands on the i-th position and a girl stands on the (i + 1)-th position, then at time x + 1 the i-th position will have a girl and the (i + 1)-th position will have a boy. The time is given in seconds.

You've got the initial position of the children, at the initial moment of time. Determine the way the queue is going to look after t seconds.

Input
The first line contains two integers n and t (1 ≤ n, t ≤ 50), which represent the number of children in the queue and the time after which the queue will transform into the arrangement you need to find.

The next line contains string s, which represents the schoolchildren's initial arrangement. If the i-th position in the queue contains a boy, then the i-th character of string s equals "B", otherwise the i-th character equals "G".

Output
Print string a, which describes the arrangement after t seconds. If the i-th position has a boy after the needed time, then the i-th character a must equal "B", otherwise it must equal "G".

Examples
inputCopy
5 1
BGGBG
outputCopy
GBGGB
inputCopy
5 2
BGGBG
outputCopy
GGBGB
inputCopy
4 1
GGGB
outputCopy
GGGB
*/

package main

import "fmt"

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

	var s string
	fmt.Scanln(&s)

	queue := make([]rune, n)
	for j, position := range s {
		queue[j] = position
	}

	for t > 0 {
		for i := 1; i < n; i++ {
			if queue[i] == 'G' && queue[i-1] == 'B' {
				queue[i] = 66
				queue[i-1] = 71
				i++
			}
		}
		t--
	}
	var queue_string = string(queue)

	fmt.Println(queue_string)
}


package main

import (
	"bytes"
	"fmt"
)

func main() {
	var n, t int
	var s string
	fmt.Scan(&n, &t)
	fmt.Scan(&s)
	var result string
	var buffer bytes.Buffer
	result = s
	for i := 0; i < t; i++ {
		for j := 0; j < len(result)-1; j++ {
			if result[j] == 'B' && result[j+1] == 'G' {
				buffer.WriteByte(result[j+1])
				buffer.WriteByte(result[j])
				j++
				continue
			}
			buffer.WriteByte(result[j])
		}
		if len(buffer.String()) != len(s) {
			buffer.WriteByte(result[len(result)-1])
		}
		result = buffer.String()
		buffer.Reset()
	}
	fmt.Print(result)
}


package main

import (
	"fmt"
)

func main() {
	var (
		n, t int
		s    string
	)
	fmt.Scan(&n, &t, &s)
	b := []byte(s)
	for t > 0 {
		for i := 1; i < n; i++ {
			if b[i-1] == 'B' && b[i] == 'G' {
				b[i], b[i-1] = 'B', 'G'
				i++
			}
		}
		t--
	}
	fmt.Println(string(b))
}


package main

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

func fastGetInt(b []byte) int {
	neg := false
	if b[0] == '-' {
		neg = true
		b = b[1:]
	}
	n := 0
	for _, v := range b {
		n = n*10 + int(v-'0')
	}
	if neg {
		return -n
	}
	return n
}

func fastGetCharFromByte(b byte) string {
	t := ""
	if b >= 'A' && b <= 'Z' {
		t = string('Z' - ('Z' - b))
	}
	if b >= 'a' && b <= 'z' {
		t = string('z' - ('z' - b))
	}

	return t
}

//========== Implement Algorithm =======================
func solution(lineStr string, seconds int) string {
	// make a slice of chars
	lineSlice := strings.Split(lineStr, "")
	//fmt.Println(lineSlice)
	numSwaps := 0

	for x := 0; x < seconds; x++ {
		numSwaps = 0
		prev := lineSlice[0]
		for i := 1; i < len(lineSlice); i++ {
			curr := lineSlice[i]
			if prev == "B" && curr == "G" {
				numSwaps++
				lineSlice[i] = "B"
				lineSlice[i-1] = "G"

			}

			//fmt.Println("prev:", prev, "curr:", curr)
			prev = curr
		}
		//fmt.Println("line:", lineSlice)
		if numSwaps == 0 {
			return strings.Join(lineSlice, "")
		}
	}
	//fmt.Println(lineSlice)
	return strings.Join(lineSlice, "")
}

func main() {

	scanner := bufio.NewScanner(os.Stdin)

	//================== Variables used ====================
	var lineStr, ret string
	var seconds int
	//======================================================

	//============== Get return value from File ============
	if len(os.Args) >= 2 {

		file, err := os.Open(os.Args[1])
		if err != nil {
			log.Fatalf("failed opening file: %s", err)
		}
		scanner = bufio.NewScanner(file)
		defer file.Close()

	}
	scanner.Split(bufio.ScanWords)
	//======================= I/O ==========================
	scanner.Scan()
	scanner.Scan()
	seconds = fastGetInt(scanner.Bytes())
	scanner.Scan()
	lineStr = scanner.Text()
	//======================================================
	ret = solution(lineStr, seconds)
	//==================== OUTPUT ==========================
	fmt.Println(ret)
}


package main

import (
	"fmt"
	"strings"
)
//bg менять на gb
func checking(s string) string {
	flag := strings.ReplaceAll(s, "BG", "GB")
	return flag
}

func main() {
	var x, y int
	var itog string
    fmt.Scan(&x, &y)
	fmt.Scan(&itog)

	for i := 0; i < y; i++ {
		itog = checking(itog)
	}
	fmt.Println(itog)
}


package main

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

func main() {
	var n, t int
	var queue string
	fmt.Fscan(os.Stdin, &n, &t, &queue)
	var replacer = strings.NewReplacer("BG", "GB")
	for i := 0; i < t; i++ {
		queue = replacer.Replace(queue)
	}
	fmt.Println(queue)
}


package main

import (
	"fmt"
)

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

	var line string
	fmt.Scan(&line)

	for i := 0; i < t; i++ {
		for j := n - 1; j >= 1; j-- {
			if line[j-1] == 'B' && line[j] == 'G' {
				line = line[:j-1] + "G" + "B" + line[j+1:]
				j--
			}
		}
	}
	fmt.Println(line)
}


package main

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

func main() {
	input := bufio.NewScanner(os.Stdin)
	hasInput := input.Scan()
	if hasInput == false {
		panic("Number of problems missing")
	}

	tmp := strings.Split(input.Text(), " ")
	t, err := strconv.Atoi(tmp[1])
	input.Scan()
	q := strings.Split(input.Text(), "")
	if err != nil {
		panic("Something went wrong")
	}

	q = tick(q, t)

	fmt.Println(strings.Join(q, ""))
}

func tick(q []string, t int) []string {
	s := make([]bool, len(q))
	var tmp string

	for i := 0; i <= t; i++ {
		for j, _ := range q {
			if s[j] == true && len(q) > j+1 {
				tmp = q[j]
				q[j] = q[j+1]
				q[j+1] = tmp
				s[j] = false
			}
		}

		for j, v := range q {
			if v == "B" && len(q) > j+1 && q[j+1] == "G" {
				s[j] = true
			}
		}

	}

	return q
}


package main

import (
    "fmt"
    )

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

    var q string
    fmt.Scan(&q)

    b := []byte(q)

    for i := 0; i < t; i++ {
        id := 0
        for id + 1 < n {
            if b[id] == 'B' && b[id+1] == 'G' {
                b[id], b[id+1] = b[id+1], b[id]
                id += 2
            } else {
                id += 1
            }
        }

        q = string(b)
    }

    fmt.Println(q)
}


package main

import (
	"fmt"
)

func schoolQueue(s string, n, t int) string {
	runes := []rune(s)
	for c := 0; c < t; c++ {
		for i := 1; i < len(s); i++ {
			if s[i] != s[i-1] && s[i] == 'G' {
				runes[i-1], runes[i] = runes[i], runes[i-1]
			}
		}
		s = string(runes)
	}
	return string(runes)
}

func main() {
	var n, t int
	fmt.Scan(&n)
	fmt.Scan(&t)
	var s string
	fmt.Scan(&s)
	fmt.Println(schoolQueue(s, n, t))
}


package main

import (
	"fmt"
	"container/list"
)

func main() {
	var peopleNumber, timeElapsed int
	fmt.Scan(&peopleNumber, &timeElapsed)
	var queue []byte
	var queueStr string
	fmt.Scan(&queueStr)
	queue = append(queue, queueStr...)
	for sec := 0; sec < timeElapsed; sec++ {
		marks := list.New()
		for offset := 0; offset < peopleNumber - 1; offset++ {
			if queue[offset] == 'B' && queue[offset + 1] == 'G' {
				marks.PushBack(offset)
			}
		}
		for e := marks.Front(); e != nil; e = e.Next() {
			pos := e.Value.(int)
			queue[pos], queue[pos + 1] = queue[pos + 1], queue[pos]
		}
	}
	fmt.Print(string(queue))
}


package main

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

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

// IO helper functions

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// IO functions

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

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

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

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

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

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

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

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

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

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

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

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

// Utilities

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

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

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

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

// reverse slice in place
func reverse(a []int) {
	for i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {
		a[i], a[j] = a[j], a[i]
	}
}

// areverse: allocating reverse
func areverse(a []int) []int {
	b := make([]int, len(a))
	for i := range a {
		b[i] = a[len(a)-i-1]
	}
	return b
}

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

// Simple math functions

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

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

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

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

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

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

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

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

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

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

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

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

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

var memo map[int]bool

func main() {
	defer Flush()

	memo = make(map[int]bool)
	memo[0] = true

	_, x := readInts(0)
	for i := range x {
		if solve(x[i]) {
			println("YES")
		} else {
			println("NO")
		}
	}
}

func solve(x int) bool {
	if x < 0 {
		return false
	}
	t, ok := memo[x]
	if ok {
		if t {
			return true
		} else {
			return false
		}
	}
	if solve(x-3) || solve(x-7) {
		memo[x] = true
		return true
	}
	memo[x] = false
	return false

}


package main
import (
	"fmt"
)

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

	for i:=0;i<n;i++ {
		fmt.Scan(&t)
		f:=true
		for j:=0;j<t;j++ {
			if t-7*j<0 {
				break
			}
			if ((t-7*j)%3)==0 {
				fmt.Println("YES")
				f=false
				break
			}
		}
		if f {
			fmt.Println("NO")
		}
	}
}


package main

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

func solve() {
	m := make(map[int]bool)
	for s := 0; s < 100/7; s++ {
		for t := 0; t < 100/3; t++ {
			m[(s*7)+(t*3)] = true
		}
	}
	n := readInt()
	for i := 0; i < n; i++ {
		x := readInt()
		if m[x] {
			fmt.Println("YES")
		} 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()
}

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
}


package main

import (
    "fmt"
    "math"
)

func main() {
    var n,x,y int
    fmt.Scan(&n,&x,&y)
    a := int(math.Ceil(float64(y)*float64(n)/100.0))
    if a > x { fmt.Println(a-x) } else { fmt.Println(0) }
}


package main

import (
	"fmt"
)

func main() {
	var p,x,y int
	fmt.Scan(&p,&x,&y)
	ans:=(p*y-1)/100-x+1
	if ans<0 {
		ans=0
	}
	fmt.Println(ans)
}


package main

import (
    "fmt"
    "math"
)

func main() {
    var n,x,y int										// membuat variabel n,x,y dengan jenis int
    fmt.Scan(&n,&x,&y)									// mengambil input
    a := int(math.Ceil(float64(y)*float64(n)/100.0))   // membuat variabel a dengan jenis int dan diisi hasil dari pembulatan keatas dari y dikali n dibagi 100
    if a > x { fmt.Println(a-x) } else { fmt.Println(0) } // jika a lebih dari x maka cetak hasil a-x , lainnya cetak 0
}


package main

import (
	"math"
	"fmt"
)

func main () {
	var a float64
	var b float64

	fmt.Scanf("%f %f\n",&a,&b)

	c := b * math.Log(a)
	d := a * math.Log(b)

	if c < d {
		fmt.Println("<")
	} else if c > d {
		fmt.Println(">")
	} else {
		fmt.Println("=")
	}

}


package main

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

func solve() {
	x := float64(readInt())
	y := float64(readInt())
	t0 := y * math.Log(x)
	t1 := x * math.Log(y)
	if t0 == t1 {
		fmt.Println("=")
	} else if t1 < t0 {
		fmt.Println(">")
	} else {
		fmt.Println("<")
	}
}

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

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

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

func main() {
	var x, y float64
	stdin := bufio.NewReader(os.Stdin)
	fmt.Fscanf(stdin, "%f %f\n", &x, &y)
	x, y = y*math.Log(x), x*math.Log(y)
	if x == y {
		fmt.Println("=")
	} else if x < y {
		fmt.Println("<")
	} else {
		fmt.Println(">")
	}
}


package main

import (
	"fmt"
	"math"
)

func main() {
	var x1, x2, x3 int
	//in := bufio.NewReader(os.Stdin)
	fmt.Scan(&x1, &x2, &x3)
	y1 := int(math.Abs(float64(x1-x2)) + math.Abs(float64(x1-x3)))
	y2 := int(math.Abs(float64(x2-x1)) + math.Abs(float64(x2-x3)))
	y3 := int(math.Abs(float64(x3-x1)) + math.Abs(float64(x3-x2)))
	if y1 < y2 && y1 < y3 {
		fmt.Println(y1)
	} else if y2 < y1 && y2 < y3 {
		fmt.Println(y2)
	} else {
		fmt.Println(y3)
	}
}


package main

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

func main() {
	var a, b, c int
	var scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)

	scanner.Scan()
	fmt.Sscanf(scanner.Text(), "%d %d %d", &a, &b, &c)

	if a > b {
		a, b = b, a
	}

	if b > c {
		b, c = c, b
	}

	if a > b {
		a, b = b, a
	}

	fmt.Print(c - a)
}


package main

import (
	"fmt"
	"sort"
)
func main(){
	home:=make([]int,3)
	dist:=0
	for i:=0;i<len(home);i++{
		fmt.Scanf("%d",&home[i])
	}
	sort.Ints(home)
	for i:=0;i< len(home)-1;i++{
		dist+=home[i+1]-home[i]
	}
	fmt.Println(dist)

}


package main

import (
	"fmt"
	"strings"
)

func is_palindrome(t string) bool {
	var c []string = strings.Split(t, "")

	for i, j := 0, len(c)-1; i < j; i, j = i+1, j-1 {
		c[i], c[j] = c[j], c[i]
	}

	u := strings.Join(c, "")

	if t == u {
		return true
	}

	return false
}

func get_trailing_scores_count(t string) int {

	count := 0

	for i := len(t) - 1; i > 0; i = i - 1 {
		if t[i] == '0' {
			count += 1
		} else {
			break
		}
	}

	return count
}

func add_leading_zeros(t string, c int) string {
	u := t

	for i := 0; i < c; i = i + 1 {
		u = "0" + u
	}

	return u
}

func solve(t string) bool {

	if is_palindrome(t) {
		return true
	}

	trailing_zeros := get_trailing_scores_count(t)

	u := add_leading_zeros(t, trailing_zeros)

	if is_palindrome(u) {
		return true
	}

	return false
}

func main() {
	var t string

	fmt.Scanf("%s", &t)

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


package main

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

func main() {
	ms := NewMuchScanner()
	s := ms.ReadString()
	n := len(s)

	leadingZeros := 0
	trailingZeros := 0

	for i := 0; i < n && s[i] == '0'; i++ {
		leadingZeros++
	}
	for i := n - 1; i >= 0 && s[i] == '0'; i-- {
		trailingZeros++
	}

	zerosToAdd := diff(leadingZeros, trailingZeros)
	z := make([]byte, zerosToAdd)
	for i := range z {
		z[i] = '0'
	}
	zeros := string(z)

	if leadingZeros > trailingZeros {
		s = concat(s, zeros)
	} else {
		s = concat(zeros, s)
	}
	n = len(s)

	isOk := true
	for i := 0; i < n/2; i++ {
		j := n - 1 - i
		if s[i] != s[j] {
			isOk = false
		}
	}

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

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

func concat(a, b string) string {
	var buf bytes.Buffer
	buf.WriteString(a)
	buf.WriteString(b)
	return buf.String()
}

// MuchScanner is a wrapper for bufio.Scanner
type MuchScanner struct {
	scanner *bufio.Scanner
}

// NewMuchScanner creates new insances of MuchScanner
func NewMuchScanner() *MuchScanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	return &MuchScanner{
		scanner: sc,
	}
}

// TokenSize sets maximal token size
func (ms *MuchScanner) TokenSize(tokenSize int) {
	ms.scanner.Buffer(make([]byte, tokenSize), tokenSize)
}

// ReadString reads next word as a string
func (ms *MuchScanner) ReadString() string {
	ms.scanner.Scan()
	return ms.scanner.Text()
}

// ReadInt reads next int number
func (ms *MuchScanner) ReadInt() int {
	n, _ := strconv.Atoi(ms.ReadString())
	return n
}

// ReadIntArr reads next n int numbers
func (ms *MuchScanner) ReadIntArr(n int) []int {
	arr := make([]int, n)
	for i := range arr {
		arr[i] = ms.ReadInt()
	}
	return arr
}


package main

import (
	"fmt"
)

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

	p := len(s)
	for s[p-1] == '0' {
		p--
	}

	for i := 0; i < p; i++ {
		if s[i] != s[p-1-i] {
			fmt.Println("NO")
			return
		}
	}
	fmt.Println("YES")
}


package main

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

func solve() {
	a := make([]int, 6)
	total := 0
	for i := 0; i < 6; i++ {
		a[i] = readInt()
		total += a[i]
	}
	if total%2 != 0 {
		fmt.Println("NO")
		return
	}
	for j := 1; j < 5; j++ {
		for k := j + 1; k < 6; k++ {
			if a[0]+a[j]+a[k] == total/2 {
				fmt.Println("YES")
				return
			}
		}
	}
	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()
}

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

func solve() {
	a := make([]int, 6)
	for i, _ := range a {
		a[i] = readInt()
	}
	m := make(map[int]bool)
	mnot := make(map[int]bool)
	for i := uint(0); i < 4; i++ {
		for j := i + 1; j < 5; j++ {
			for k := j + 1; k < 6; k++ {
				b := (1 << i) | (1 << j) | (1 << k)
				if m[b] || mnot[b] {
					continue
				}
				m[b] = true
				mnot[(^b)&0x3f] = true
			}
		}
	}

	for k, _ := range m {
		sum0 := 0
		sum1 := 0
		for i := uint(0); i < 6; i++ {
			if k&(1<<i) == 0 {
				sum0 += a[i]
			} else {
				sum1 += a[i]
			}
		}
		if sum0 == sum1 {
			fmt.Println("YES")
			return
		}
	}
	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()
}

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
}


package main

import "fmt"
import "os"

func main() {
	var a[6]int
	sum := 0
	for i := 0; i < 6; i++ {
		fmt.Scanf("%d",&a[i])
		sum += a[i]
	}
	for i := 0; i < 6; i++ {
		for j := i+1; j < 6; j++ {
			for k := j+1; k < 6; k++ {
				left := a[i] + a[j] + a[k]
				right := sum - left
				if left == right {
					fmt.Printf("YES")
					os.Exit(0)
				}
			}
		}
	}
	fmt.Printf("NO")
}


package main

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

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

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

func getLine() string {
	s, _ := reader.ReadString('\n')
	if strings.HasSuffix(s, "\r\n") {
		s = s[:len(s)-2]
	} else if strings.HasSuffix(s, "\n") {
		s = s[:len(s)-1]
	}
	return s
}
func getLine2Int() (n int) {
	scanf("%d\n", &n)
	return
}
func getLine2Int2() (a, b int64) {
	scanf("%d %d\n", &a, &b)
	return
}
func getLine2Ints(n int) []int64 {
	ans := make([]int64, n)
	for i := 0; i < n; i++ {
		scanf("%d ", &ans[i])
	}
	scanf("%d\n", &ans[n-1])
	return ans
}

func pcheck(i bool) {
	if i {
		printf("Yes\n")
	} else {
		printf("No\n")
	}
}

var debug = true

func see(a interface{}) {
	if debug {
		printf("DEBUG:%v\n", a)
	}
}

func main() {
	defer writer.Flush()

	_, k := getLine2Int2()
	r := 1
	for k%2 == 0 {
		r++
		k /= 2
	}
	printf("%d\n", r)
}


package main

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

func find(n, k int64) int64 {
    sz, prev := int64(0), int64(0)
    for i := int64(0); i < n; i++ {
        prev, sz = sz, 2*sz+1
    }
    if k == prev {
        return n
    }
    if k > prev {
        return find(n-1, k-prev-1)
    }
    return find(n-1, k)
}

func solve() {
    n, k := readInt64(), readInt64()-1
    fmt.Println(find(n, k))
}

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

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

	len := int64(1)
	center := 1
	for i := 1; i < n; i++ {
		len = len*2 + 1
		center++
	}

	for center > 0 {
		cp := (len + 1) / 2
		if k == cp {
			break
		} else if k > cp {
			k -= cp
		}
		len = (len - 1) / 2
		center--
	}

	fmt.Println(center)
}


package main

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

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

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

	n, m := nextInt(), nextInt()

	lights := make([]int, n)
	buttonOff := 0

	for i:=0; i<m; i++ {
		buttonOff = nextInt()

		for j:= buttonOff-1; j<n && lights[j]==0; j++ {
			lights[j] = buttonOff
		}
	}

	for i:=0; i<n; i++ {
		print(lights[i], " ")
	}
}

func next() string {
	if !scanner.Scan() {
		panic("Scan error")
	}
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(next())
	if err != nil {
		panic(err)
	}
	return n
}

func nextFloat() float64 {
	n, err := strconv.ParseFloat(next(), 64)
	if err != nil {
		panic(err)
	}
	return n
}

func println(a ...interface{}) {
	fmt.Fprintln(writer, a...)
}

func print(a ...interface{}) {
	fmt.Fprint(writer, a...)
}


package main

import (
    "fmt"
)

func main() {
    var t, n, m, cnt int
    var light [110]int
    fmt.Scan(&n, &m)
    cnt = 100000
    for i := 0; i < m; i++ {
        fmt.Scan(&t)
        if t < cnt {
            cnt = t
            light[t] = 1
        }
    }
    for i := 1; i <= n; i++ {
        if light[i] == 1 {
            cnt = i
        }
        fmt.Printf("%d ", cnt)
    }
}


package main

import (
    "fmt"
)

func main() {
    var t, n, m, cnt int
    var light [110]int
    fmt.Scanf("%d %d", &n, &m)
    cnt = 100000
    for i := 0; i < m; {
        c, _ := fmt.Scanf("%d", &t)
        if c == 0 {
            continue
        }
        if t < cnt {
            cnt = t
            light[t] = 1
        }
        i++
    }
    for i := 1; i <= n; i++ {
        if light[i] == 1 {
            cnt = i
        }
        fmt.Printf("%d ", cnt)
    }
}


package main

import "fmt"

func main() {
	var k, l, m, n, d int
	fmt.Scanf("%d\n%d\n%d\n%d\n%d", &k, &l, &m, &n, &d)
	var res = 0
	for i := 1; i <= d; i++ {
		if i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0 {
			res++
		}
	}
	fmt.Println(res)
}


package main

import "fmt"

func markMultiples(cu int, ovo []bool) {
	for i := 1; i < len(ovo); i++ {
		if i%cu == 0 {
			ovo[i] = true
		}
	}
}

func main() {
	var k int
	var l int
	var m int
	var n int
	var d int
	var batata int
	fmt.Scanf("%d\n", &k)
	fmt.Scanf("%d\n", &l)
	fmt.Scanf("%d\n", &m)
	fmt.Scanf("%d\n", &n)
	fmt.Scanf("%d\n", &d)
	dragaos := make([]bool, d+1)
	markMultiples(k, dragaos)
	markMultiples(l, dragaos)
	markMultiples(m, dragaos)
	markMultiples(n, dragaos)
	for i := 1; i <= d; i++ {
		if dragaos[i] == true {
			batata++
		}
	}
	fmt.Println(batata)
}


package main

import "fmt"

func main() {
	var k, l, m, n, d int
	fmt.Scan(&k, &l, &m, &n, &d)
	if k == 1 || l == 1 || m == 1 || m == 1 {
		fmt.Print(d)
		return
	}
	var cnt int
	for i := 1; i <= d; i++ {
		if i%k == 0 ||
			i%l == 0 ||
			i%m == 0 ||
			i%n == 0 {
			cnt++
		}
	}
	fmt.Print(cnt)
}


// A. Bear and Reverse Radewoosh
/*
Limak and Radewoosh are going to compete against each other in the upcoming algorithmic contest. They are equally skilled but they won't solve problems in the same order.

There will be n problems. The i-th problem has initial score p i and it takes exactly t i minutes to solve it. Problems are sorted by difficulty — it's guaranteed that p i < p i + 1 and t i < t i + 1.

A constant c is given too, representing the speed of loosing points. Then, submitting the i-th problem at time x ( x minutes after the start of the contest) gives max(0,  p i - c·x) points.

Limak is going to solve problems in order 1, 2, ..., n (sorted increasingly by p i). Radewoosh is going to solve them in order n, n - 1, ..., 1 (sorted decreasingly by p i). Your task is to predict the outcome — print the name of the winner (person who gets more points at the end) or a word "Tie" in case of a tie.

You may assume that the duration of the competition is greater or equal than the sum of all t i. That means both Limak and Radewoosh will accept all n problems.

Input
The first line contains two integers n and c (1 ≤ n ≤ 50, 1 ≤ c ≤ 1000) — the number of problems and the constant representing the speed of loosing points.

The second line contains n integers p 1, p 2, ..., p n (1 ≤ p i ≤ 1000, p i < p i + 1) — initial scores.

The third line contains n integers t 1, t 2, ..., t n (1 ≤ t i ≤ 1000, t i < t i + 1) where t i denotes the number of minutes one needs to solve the i-th problem.

Output

Print "Limak" (without quotes) if Limak will get more points in total. Print "Radewoosh" (without quotes) if Radewoosh will get more points in total. Print "Tie" (without quotes) if Limak and Radewoosh will get the same total number of points.

Examples
Input
3 2
50 85 250
10 15 25

Output
Limak

Input
3 6
50 85 250
10 15 25

Output
Radewoosh

Input
8 1
10 20 30 40 50 60 70 80
8 10 58 63 71 72 75 76

Output
Tie

Note
In the first sample, there are 3 problems. Limak solves them as follows:

    Limak spends 10 minutes on the 1-st problem and he gets 50 - c·10 = 50 - 2·10 = 30 points.
    Limak spends 15 minutes on the 2-nd problem so he submits it 10 + 15 = 25 minutes after the start of the contest. For the 2-nd problem he gets 85 - 2·25 = 35 points.
    He spends 25 minutes on the 3-rd problem so he submits it 10 + 15 + 25 = 50 minutes after the start. For this problem he gets 250 - 2·50 = 150 points.

So, Limak got 30 + 35 + 150 = 215 points.

Radewoosh solves problem in the reversed order:

    Radewoosh solves 3-rd problem after 25 minutes so he gets 250 - 2·25 = 200 points.
    He spends 15 minutes on the 2-nd problem so he submits it 25 + 15 = 40 minutes after the start. He gets 85 - 2·40 = 5 points for this problem.
    He spends 10 minutes on the 1-st problem so he submits it 25 + 15 + 10 = 50 minutes after the start. He gets max(0, 50 - 2·50) = max(0,  - 50) = 0 points.

Radewoosh got 200 + 5 + 0 = 205 points in total. Limak has 215 points so Limak wins.

In the second sample, Limak will get 0 points for each problem and Radewoosh will first solve the hardest problem and he will get 250 - 6·25 = 100 points for that. Radewoosh will get 0 points for other two problems but he is the winner anyway.

In the third sample, Limak will get 2 points for the 1-st problem and 2 points for the 2-nd problem. Radewoosh will get 4 points for the 8-th problem. They won't get points for other problems and thus there is a tie because 2 + 2 = 4.
*/
package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	input1, _ := reader.ReadString('\n')
	arr := strings.Split(strings.TrimSpace(input1), " ")
	n, _ := strconv.Atoi(arr[0])
	c, _ := strconv.Atoi(arr[1])

	input2, _ := reader.ReadString('\n')
	pArr := strings.Split(strings.TrimSpace(input2), " ")

	input3, _ := reader.ReadString('\n')
	tArr := strings.Split(strings.TrimSpace(input3), " ")

	lt, lpt, rt, rpt := 0, 0, 0, 0
	for i := 0; i < n; i++ {
		p1, _ := strconv.Atoi(pArr[i])
		t1, _ := strconv.Atoi(tArr[i])
		lpt += t1
		lt += max(0, p1-c*lpt)

		p2, _ := strconv.Atoi(pArr[n-1-i])
		t2, _ := strconv.Atoi(tArr[n-1-i])
		rpt += t2
		rt += max(0, p2-c*rpt)
	}

	if lt > rt {
		fmt.Print("Limak")
	} else if lt < rt {
		fmt.Print("Radewoosh")
	} else {
		fmt.Print("Tie")
	}
}

func max(i, j int) int {
	if i > j {
		return i
	}
	return j
}


package main

import (
	"fmt"
	"math"
)

var problems, parametres, problem, time int

func score(start, end int, scores, TIME []int) int{
	var score, time int

	for i := 0; i < problems; i++ {
		time += TIME[i]
		initial := scores[i] - parametres * time

		score += int(math.Max(0, float64(initial)))

	}

	return int(score)
}

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

	return array
}

func main() {
	fmt.Scan(&problems, &parametres)

	var scores, TIME []int
	for i := 0; i < problems; i++ {
		fmt.Scan(&problem)
		scores = append(scores, problem)
	}

	for i := 0; i < problems; i++ {
		fmt.Scan(&time)
		TIME = append(TIME, time)
	}

	var LimakScore, RadewooshScore int

	LimakScore = score(0, problems, scores, TIME)

	scores, TIME = reverse(scores), reverse(TIME)

	RadewooshScore = score(problems, 0, scores, TIME)

	if LimakScore > RadewooshScore {
		fmt.Println("Limak")
	} else if LimakScore == RadewooshScore {
		fmt.Println("Tie")
	} else {
		fmt.Println("Radewoosh")
	}
}


package main

import (
	"fmt"
	// "math"
)

func main() {
	var problems, parametres int
	fmt.Scan(&problems, &parametres)

	var scores, TIME []int
	for i := 0; i < problems; i++ {
		var problem int
		fmt.Scan(&problem)
		scores = append(scores, problem)
	}

	for i := 0; i < problems; i++ {
		var time int
		fmt.Scan(&time)
		TIME = append(TIME, time)
	}

	var LimakScore, RadewooshScore int
	var time int

	for i := 0; i < problems; i++ {
		time += TIME[i]
		if (scores[i] - parametres * time) < 0 {
			LimakScore += 0
		} else {
			LimakScore += scores[i] - parametres * time
		}
	}

	time = 0

	for i := problems - 1; i >= 0; i-- {
		time += TIME[i]
		if scores[i] - parametres * time < 0 {
			RadewooshScore += 0
		} else {
			RadewooshScore += scores[i] - parametres * time
		}
	}

	// fmt.Println(LimakScore, RadewooshScore)

	if LimakScore > RadewooshScore {
		fmt.Println("Limak")
	} else if LimakScore == RadewooshScore {
		fmt.Println("Tie")
	} else {
		fmt.Println("Radewoosh")
	}
}


package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	a, b, c, d, e, f := 0, 0, 0, 0, 0, 0
	fmt.Fscanf(in, "%d\n", &a)
	fmt.Fscanf(in, "%d\n", &b)
	fmt.Fscanf(in, "%d\n", &c)
	fmt.Fscanf(in, "%d\n", &d)
	fmt.Fscanf(in, "%d\n", &e)
	fmt.Fscanf(in, "%d\n", &f)
	ans := 0
	if e > f {
		amt := min(a, d)
		ans += amt * e
		d -= amt
		amt = min(b, d)
		amt = min(amt, c)
		ans += amt * f
	} else {
		amt := min(b, d)
		amt = min(amt, c)
		ans += amt * f
		d -= amt
		amt = min(a, d)
		ans += amt * e
	}
	fmt.Fprintf(out, "%d\n", ans)
	return
}

func minstep(a, b byte) int {
	return min(int(a-b+26)%26, int(b-a+26)%26)
}

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


package main

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

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

var (
	// ReadString returns a WORD string.
	ReadString func() string
	stdout     *bufio.Writer
)

func init() {
	ReadString = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	// r.Buffer(make([]byte, 1024), int(1e+11)) // for AtCoder
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	// Split sets the split function for the Scanner. The default split function is ScanLines.
	// Split panics if it is called after scanning has started.
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// ReadInt returns an integer.
func ReadInt() int {
	return int(readInt64())
}
func ReadInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func ReadInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func ReadInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

// ReadInt64 returns as integer as int64.
func ReadInt64() int64 {
	return readInt64()
}
func ReadInt64_2() (int64, int64) {
	return readInt64(), readInt64()
}
func ReadInt64_3() (int64, int64, int64) {
	return readInt64(), readInt64(), readInt64()
}
func ReadInt64_4() (int64, int64, int64, int64) {
	return readInt64(), readInt64(), readInt64(), readInt64()
}

func readInt64() int64 {
	i, err := strconv.ParseInt(ReadString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// ReadIntSlice returns an integer slice that has n integers.
func ReadIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt()
	}
	return b
}

// ReadInt64Slice returns as int64 slice that has n integers.
func ReadInt64Slice(n int) []int64 {
	b := make([]int64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt64()
	}
	return b
}

// ReadFloat64 returns an float64.
func ReadFloat64() float64 {
	return float64(readFloat64())
}

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

// ReadFloatSlice returns an float64 slice that has n float64.
func ReadFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadFloat64()
	}
	return b
}

// ReadRuneSlice returns a rune slice.
func ReadRuneSlice() []rune {
	return []rune(ReadString())
}

/*********** Debugging ***********/

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

// Strtoi is a wrapper of strconv.Atoi().
// If strconv.Atoi() returns an error, Strtoi calls panic.
func Strtoi(s string) int {
	if i, err := strconv.Atoi(s); err != nil {
		panic(errors.New("[argument error]: Strtoi only accepts integer string"))
	} else {
		return i
	}
}

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintIntsLine returns integers string delimited by a space.
func PrintInts64Line(A ...int64) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.FormatInt(A[i], 10) // 64bit int version
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)
func PrintDebug(format string, a ...interface{}) {
	fmt.Fprintf(os.Stderr, format, a...)
}

/********** FAU standard libraries **********/

//fmt.Sprintf("%b\n", 255) 	// binary expression

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

//str := ReadString()
//i := ReadInt()
//X := ReadIntSlice(n)
//S := ReadRuneSlice()
//a := ReadFloat64()
//A := ReadFloat64Slice(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

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

const MOD = 1000000000 + 7
const ALPHABET_NUM = 26
const INF_INT64 = math.MaxInt64
const INF_BIT60 = 1 << 60
const INF_INT32 = math.MaxInt32
const INF_BIT30 = 1 << 30

var a, b, c, d, e, f int

func main() {
	a, b, c, d = ReadInt4()
	e, f = ReadInt2()

	bc := Min(b, c)

	ans := 0
	if e > f {
		// aの方を使う
		m := Min(a, d)
		ans += e * m
		d -= m
		if d > 0 {
			mm := Min(bc, d)
			ans += f * mm
		}
	} else {
		// bcの方を使う
		m := Min(bc, d)
		ans += f * m
		d -= m
		if d > 0 {
			mm := Min(a, d)
			ans += e * mm
		}
	}

	fmt.Println(ans)
}

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

/*
- まずは全探索を検討しましょう
- MODは最後にとりましたか？
- ループを抜けた後も処理が必要じゃありませんか？
- 和・積・あまりを求められたらint64が必要ではありませんか？
- いきなりオーバーフローはしていませんか？
	- MOD取る系はint64必須ですよ？
*/

/*
ASCII code

ASCII   10進数  ASCII   10進数  ASCII   10進数
!       33      "       34      #       35
$       36      %       37      &       38
'       39      (       40      )       41
*       42      +       43      ,       44
-       45      .       46      /       47
0       48      1       49      2       50
3       51      4       52      5       53
6       54      7       55      8       56
9       57      :       58      ;       59
<       60      =       61      >       62
?       63      @       64      A       65
B       66      C       67      D       68
E       69      F       70      G       71
H       72      I       73      J       74
K       75      L       76      M       77
N       78      O       79      P       80
Q       81      R       82      S       83
T       84      U       85      V       86
W       87      X       88      Y       89
Z       90      [       91      \       92
]       93      ^       94      _       95
`       96      a       97      b       98
c       99      d       100     e       101
f       102     g       103     h       104
i       105     j       106     k       107
l       108     m       109     n       110
o       111     p       112     q       113
r       114     s       115     t       116
u       117     v       118     w       119
x       120     y       121     z       122
{       123     |       124     }       125
~       126             127
*/

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


package main

import "fmt"

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

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

func main(){
	var a, b, c, d, e, f, maxx int
	fmt.Scan(&a, &b, &c, &d, &e, &f)
	maxx = 0
	for i := 0; i <= d; i++ {
		maxx = max(maxx, min(a, i) * e + min(min(b, c), d - i) * f)
	}
	fmt.Print(maxx);
}


package main

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

var scanner *bufio.Scanner

func getI64() int64 {
  scanner.Scan()
  x, _ := strconv.ParseInt(scanner.Text(), 10, 64)
  return x
}
func getI() int {
  return int(getI64())
}
func getF() float64 {
  scanner.Scan()
  x, _ := strconv.ParseFloat(scanner.Text(), 64)
  return x
}
func getS() string {
  scanner.Scan()
  return scanner.Text()
}

func main() {
  scanner = bufio.NewScanner(os.Stdin)
  scanner.Split(bufio.ScanWords)
  writer := bufio.NewWriter(os.Stdout)
  defer writer.Flush()

  x, o := getI(), getI()
  xPairs := x/2
  if xPairs > o {
    xPairs = o
  }
  x -= 2*xPairs
  o -= xPairs
  oFours := o/3
  if oFours > xPairs {
    oFours = xPairs
  }
  xPairs -= oFours
  o -= 3*oFours
  teams := xPairs + 2*oFours
  if x > 0 && o > 1 {
    x--
    o -= 2
    teams++
  }
  writer.WriteString(fmt.Sprintf("%d\n", teams))
}


package main

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

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

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

func getLine() string {
	s, _ := reader.ReadString('\n')
	if strings.HasSuffix(s, "\r\n") {
		s = s[:len(s)-2]
	} else if strings.HasSuffix(s, "\n") {
		s = s[:len(s)-1]
	}
	return s
}
func getLine2Int() (n int) {
	scanf("%d\n", &n)
	return
}
func getLine2Int2() (a, b int) {
	scanf("%d %d\n", &a, &b)
	return
}
func getLine2Ints(n int) []int {
	ans := make([]int, n)
	for i := 0; i < n; i++ {
		scanf("%d ", &ans[i])
	}
	scanf("%d\n", &ans[n-1])
	return ans
}

func pcheck(i bool) {
	if i {
		printf("Yes\n")
	} else {
		printf("No\n")
	}
}

var debug = true

func see(a interface{}) {
	if debug {
		printf("DEBUG:%v\n", a)
	}
}

func main() {
	defer writer.Flush()

	n, m := getLine2Int2()
	var x int
	if n*2 < m {
		x = n
	} else if m*2 < n {
		x = m
	} else {
		x = (m + n) / 3
	}
	printf("%d\n", x)
}


package main

import (
	"fmt"
	"math"
)

func main() {
	var x, y float64
	fmt.Scanf("%f %f\n", &x, &y)
	var ans float64 = math.Min((x+y)/3, math.Min(x, y))
	var ans2 = int(ans)
	fmt.Println(ans2)
}


package main

import (
	"fmt"
	"strings"
)

func main() {
	var s string
	var n int
	fmt.Scan(&s)
	chars := strings.Split(s, "")
	for _, v := range chars {
		if v == "4" || v == "7" {
			n++
		}
	}

	if n == 4 || n == 7 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


package main

import "fmt"

func main() {
	var n string
	fmt.Scan(&n)
	c := 0
	for _, d := range n {
		if d == '4' || d == '7' {
			c++
		}
	}

	if c == 4 || c == 7 {
		fmt.Print("YES")
		return
	}

	fmt.Print("NO")
}


package main

// https://codeforces.com/problemset/problem/110/A

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

func task_solution(in []byte) string {
	type s struct{}
	exists := s{}
	lucky := map[byte]s{
		'4': exists,
		'7': exists,
	}

	counter := 0
	for _, c := range in {
		if _, ok := lucky[c]; ok {
			counter += 1
		}
	}

	if counter == 4 || counter == 7 {
		return "YES"
	}
	return "NO"
}

func main() {
	in_raw, err := ioutil.ReadAll(os.Stdin)
	if err != nil {
		panic(err)
	}

	fmt.Println(task_solution(in_raw))
}


package main

import (
	"fmt"
)

type Trav func(func(data interface{}))

type TermRLE struct {
	data   interface{}
	amount int
}

func toRLE(a Trav) Trav {
	var current = TermRLE{nil, 0}
	return func(f func(interface{})) {
		a(func(data interface{}) {
			if current.amount == 0 {
				current = TermRLE{data, 1}
			} else if data != current.data {
				f(current)
				current = TermRLE{data, 1}
			} else {
				current.amount++
			}
		})
		if current.amount != 0 {
			f(current)
			current = TermRLE{nil, 0}
		}
	}
}

func main() {
	var n int
	fmt.Scan(&n)
	var s string
	fmt.Scan(&s)
	toRLE(func(f func(interface{})) {
		for _, i := range s {
			f(i)
		}
	})(func(data interface{}) {
		n--
	})
	fmt.Println(n)
}


package main

import "fmt"

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

	var colors string
	fmt.Scan(&colors)

	cur := colors[0]
	var t int
	for i := 1; i < n; i++ {
		if colors[i] == cur {
			t++
		} else {
			cur = colors[i]
		}
	}

	fmt.Print(t)
}


package main

import "fmt"

func main() {
    var n int
    var s string
    fmt.Scan(&n,&s)
    ans := 0
    for i := 1; i < n; i++ {
        if (s[i] == s[i-1]) { ans++ }
    }
    fmt.Println(ans)
}


package main

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

func main() {
	re, w := bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)
	defer w.Flush()
	var N int
	Fscan(re, &N)
	a := make([]int, N)
	for i := 0; i < N; i++ {
		Fscan(re, &a[i])
	}
	p := 0
	var num ,t int
	for j := 0; j < N; j++{
		num = 0
		t = 0
		for i := 1; i * i <= a[j]; i++{
			p = i
		}
		num += p
		for i := 1; i * i * i <= a[j]; i++{
			p = i
			if kaifang(i * i * i) {
				t++
			}
		}
		num += p
		Fprintln(w, num - t)
	}
}
func kaifang(a int) bool {
	for i := 1; i * i <= a; i++{
		if i * i == a{
			return true
		}
	}
	return false
}


package main

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

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

type Set struct {
	items map[interface{}]struct{}
}

func (s *Set) Size() int {
	return len(s.items)
}
func (s *Set) Empty() bool {
	return s.Size() == 0
}

func (s *Set) Add(t ...interface{}) {
	for _, v := range t {
		s.items[v] = struct{}{}
	}
}

func (s *Set) Remove(t ...interface{}) {
	for _, v := range t {
		delete(s.items, v)
	}
}

func (s *Set) Contains(t ...interface{}) bool {
	for _, v := range t {
		if _, ok := s.items[v]; !ok {
			return false
		}
	}
	return true
}

func (s *Set) List() []interface{} {
	ret := make([]interface{}, 0, s.Size())
	for k, _ := range s.items {
		ret = append(ret, k)
	}
	return ret
}

func New(values ...interface{}) *Set {
	ret := &Set{
		items: make(map[interface{}]struct{}),
	}
	for _, v := range values {
		ret.Add(v)
	}
	return ret
}

func main() {
	defer out.Flush()

	set := New()
	for i := 1; i*i <= 1_000_000_000; i++ {
		set.Add(i * i)
	}
	for i := 1; i <= 1000; i++ {
		set.Add(i * i * i)
	}

	arr := make([]int, 0, set.Size())
	for _, v := range set.List() {
		arr = append(arr, v.(int))
	}

	sort.Ints(arr)

	var kase int
	fmt.Fscan(in, &kase)

	for kk := 1; kk <= kase; kk++ {
		var n int
		fmt.Fscan(in, &n)

		low, high := 0, len(arr)-1

		for low <= high {
			mid := (low + high) / 2

			if n >= arr[mid] {
				low = mid + 1
			} else {
				high = mid - 1
			}
		}
		fmt.Fprintf(out, "%d\n", high+1)
	}
}