The first and only line contains the word s, which Vasya typed. This word consisits of small Latin letters, its length is no less that 1 and no more than 100 letters.

If Vasya managed to say hello, print "YES", otherwise print "NO".

package main

import (
	"fmt"
	"os"
)

//import "strings"

//import "math"
//import "strconv"
//import "sort"

func main() {

	str := "hello*"

	d := ""

	fmt.Scan(&d)

	cur := 0

	for i := 0; i < len(d); i++ {

		if str[cur] == d[i] {
			cur++
		}
		if cur == 5 {
			fmt.Println("YES")
			os.Exit(0)
		}
	}
	fmt.Println("NO")
}

package main

import (
  "fmt"
)

func main() {
  var s string
  h, e, l1, l2, o := false, false, false, false, false
  fmt.Scan(&s)
  for _,val := range s {
    switch ue := string(val); {
    case ue=="h":
      h = true
    case ue=="e"&&h:
      e = true
    case ue=="l"&&!l1&&h&&e:
      l1 = true
    case ue=="l"&&l1&&h&&e:
      l2 = true
    case ue=="o"&&h&&e&&l1&&l2:
      o = true
    }
  }
  if h && e && l1 && l2 && o {
    fmt.Print("YES")
  }  else {
    fmt.Print("NO")
  }
}

package main

import (
	"fmt"
)

// INPUT
// ahhellllloou -> YES
// hlelo -> NO
// helhcludoo -> YES
// pnnepelqomhhheollvlo -> YES

func main() {
	var word, greeting string
	var greetingPos int
	greeting = "hello"

	fmt.Scanf("%v", &word)

	for pos, char := range word {
		if greetingPos > 4 {
			break
		}

		if greeting[greetingPos] == word[pos] {
			if char == 'h' {
				greetingPos = 0
			}
			greetingPos++
		}
	}

	if greetingPos == 5 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import "fmt"

func isOk(s string) bool {
	pattern := "hello"
	i := 0
	//j := 0
	for si, _ := range s {
		if s[si] == pattern[i] {
			i++
		}
		if i >= len(pattern) {
			break
		}
	}
	return i == len(pattern)
}

func main() {
	var str string
	fmt.Scanf("%s", &str)
	if isOk(str) {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import "fmt"

func main() {

	var str string
	fmt.Scan(&str)

	hello := "hello"
	j := 0

	for i := 0; i < len(str) && j < len(hello); i++ {
		if str[i] == hello[j] {
			j++
		}
	}

	if j == len(hello) {
		fmt.Print("YES")
		return
	}
	fmt.Print("NO")
}

package main

import "fmt"

func foo(s string) bool {
	for i := 0; i < len(s); i++ {
		for j := i + 1; j < len(s); j++ {
			for k := j + 1; k < len(s); k++ {
				for l := k + 1; l < len(s); l++ {
					for m := l + 1; m < len(s); m++ {
						if s[i] == 'h' && s[j] == 'e' && s[k] == 'l' && s[l] == 'l' && s[m] == 'o' {
							return true
						}
					}
				}
			}
		}
	}
	return false
}

func main() {
	var s string
	fmt.Scan(&s)
	if foo(s) {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
)

func main() {
	var s, target string = "", "hello"
	fmt.Scan(&s)
	var j int
	for i := range s {
		if s[i] == target[j] {
			j++
		}
		if j == 5 {
			fmt.Print("YES")
			break
		}
	}
	if j != 5 {
		fmt.Print("NO")
	}
}

package main

import (
	"fmt"
	"log"
)

var (
	hi = []string{"h", "e", "l", "l", "o"}
)

func main() {
	var (
		s       string
		counter int
		length  = len(hi)
	)
	if _, err := fmt.Scanf("%s\n", &s); err != nil {
		log.Fatal(err)
	}

	for i := range s {
		if s[i:i+1] == hi[counter] {
			counter++
			if counter == length {
				fmt.Println("YES")
				return
			}
		}
	}
	fmt.Println("NO")
}

package main

import "fmt"

func main() {
	hello := []byte("hello")

	var input string

	_, _ = fmt.Scanln(&input)

	byteinput := []byte(input)

	pos := 0

	for i := 0; i < len(byteinput); i ++ {
		if pos >= len(hello) {
			break;
		}
		if byteinput[i] == hello[pos] {
			pos ++
		}
	}

	if pos >= len(hello) {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	s, _ := reader.ReadString('\n')
	goal := "hello"
	state := 0
	for i := 0; i < len(s)-1; i++ { //-1 newline
		if state == len(goal) { // early break
			break
		}

		if s[i] == goal[state] {
			state++
		}
	}

	if state == len(goal) {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")

	}
}

package main

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

func main() {
	var scanner *bufio.Scanner

	scanner = bufio.NewScanner(os.Stdin)

	scanner.Scan()
	if err := scanner.Err(); err == nil {
		if regexp.MustCompile("\\w*h\\w*e\\w*l\\w*l\\w*o\\w*").MatchString(scanner.Text()) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}

}

package main

import "fmt"

func main() {
    h := "hello"
    var s string
    fmt.Scan(&s)
    in := 0
    for i := 0; (i < len(s)) && (in < 5); i++ {
        if s[i] == h[in] { in++ }
    }
    if in == 5 { fmt.Println("YES") } else { fmt.Println("NO") }
}

package main

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

func main() {
	var scanner *bufio.Scanner
	var line string

	scanner = bufio.NewScanner(os.Stdin)

	if scanner.Scan() {
		line = scanner.Text()
		if managed(line) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

func managed(message string) bool {
	var hello = []rune("hello")

	for _, letter := range message {
		if len(hello) == 0 {
			return true
		}
		if letter == hello[0] {
			hello = hello[1:]
		}
	}

	if len(hello) == 0 {
		return true
	}

	return false
}

package main

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

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

	var str, pat string

	fmt.Fscan(in, &str)
	pat = `h.*e.*l.*l.*o`

	matched, _ := regexp.MatchString(pat, str)
	if matched {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

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

type input struct {
	a string
}

func (c *input) Read(scanner *bufio.Scanner) {
	for scanner.Scan() {
		c.a = scanner.Text()
		return
	}

}

func main() {
	var inp input
	sc := bufio.NewScanner(os.Stdin)
	inp.Read(sc)

	var v1 int

	for _, b := range inp.a {
		s := string(b)
		if v1 == 0 && s == "h" {
			v1++
		}

		if v1 == 1 && s == "e" {
			v1++
		}
		if (v1 == 2 || v1 == 3) && s == "l" {
			v1++

		}

		if v1 == 4 && s == "o" {
			fmt.Println("YES")
			return

		}

	}
	fmt.Println("NO")
}

package main

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

type input struct {
	a string
}

func (c *input) Read(scanner *bufio.Scanner) {
	for scanner.Scan() {
		c.a = scanner.Text()
		return
	}

}

func main() {
	var inp input
	sc := bufio.NewScanner(os.Stdin)
	inp.Read(sc)
	if regexp.MustCompile(`.*h.*e.*l.*l.*o.*`).MatchString(inp.a){
	    fmt.Println("YES")
	} else{
	    fmt.Println("NO")
	}

}

package main

import (
	"fmt"
	"strings"
)

func main() {
	var s string
	fmt.Scan(&s)
	for _, r := range "hello" {
		i := strings.Index(s, string(r))
		if i == -1 {
			fmt.Printf("NO")
			return
		}
		if i != len(s)-1 {
			s = s[i+1:]
		}
	}
	fmt.Printf("YES")
}

/* https://codeforces.com/problemset/problem/58/A
A. Chat room
time limit per test1 second
memory limit per test256 megabytes
inputstandard input
outputstandard output
Vasya has recently learned to type and log on to the Internet. He immediately entered a chat room and decided to say hello to everybody. Vasya typed the word s. It is considered that Vasya managed to say hello if several letters can be deleted from the typed word so that it resulted in the word "hello". For example, if Vasya types the word "ahhellllloou", it will be considered that he said hello, and if he types "hlelo", it will be considered that Vasya got misunderstood and he didn't manage to say hello. Determine whether Vasya managed to say hello by the given word s.

Input
The first and only line contains the word s, which Vasya typed. This word consisits of small Latin letters, its length is no less that 1 and no more than 100 letters.

Output
If Vasya managed to say hello, print "YES", otherwise print "NO".

Examples
inputCopy
ahhellllloou
outputCopy
YES
inputCopy
hlelo
outputCopy
NO
*/

package main

import "fmt"

func main() {
	var hello_index int
	var input_string string
	hello := []rune("hello")
	fmt.Scanln(&input_string)
	for _, letter := range input_string {
		if letter == hello[hello_index] {
			hello_index++
			if hello_index == 5 {
				fmt.Println("YES")
				return
			}
		}
	}
	fmt.Println("NO")
}

package main

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

func main() {
	var h byte
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanRunes)
	for scanner.Scan() {
		l := scanner.Text()
		switch {
		case l == "h" && h == 0: // 0b00000
			h = 32 // 0b10000
		case l == "e" && h == 32: // 0b10000
			h = 48 // 0b11000
		case l == "l" && h == 48: // 0b11000
			h = 56 // 0b11100
		case l == "l" && h == 56: // 0b11100
			h = 60 // 0b11110
		case l == "o" && h == 60: // 0b11110
			h = 62 // 0b11111
			break
		}
	}

	if h == 62 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
)

func main() {
	var x string
	var ref string = "hello"
	_, _ = fmt.Scan(&x)
	ref_index:= 0;
	for _, char := range(x) {
		if uint8(char) == ref[ref_index] {
			ref_index++
			if ref_index == 5 {
				break
			}
		}
	}

	if ref_index == 5 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

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

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

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

func main() {
	defer writer.Flush()

	var s string
	scanf("%s\n", &s)
	h := "hello"
	j := 0
	i := 0
	for i < len(s) && j < len(h) {

		if s[i] == h[j] {
			j++
		}
		i++
	}
	if j == len(h) {
		printf("YES\n")
	} else {
		printf("NO\n")
	}
}

/*
Chat room
time limit per test2 seconds
memory limit per test256 megabytes
inputstandard input
outputstandard output
Vasya has recently learned to type and log on to the Internet. He immediately entered a chat room and decided to say hello to everybody. Vasya typed the word s. It is considered that Vasya managed to say hello if several letters can be deleted from the typed word so that it resulted in the word "hello". For example, if Vasya types the word "ahhellllloou", it will be considered that he said hello, and if he types "hlelo", it will be considered that Vasya got misunderstood and he didn't manage to say hello. Determine whether Vasya managed to say hello by the given word s.

Input
The first and only line contains the word s, which Vasya typed. This word consisits of small Latin letters, its length is no less that 1 and no more than 100 letters.

Output
If Vasya managed to say hello, print "YES", otherwise print "NO".

Sample test(s)
input
ahhellllloou
output
YES
input
hlelo
output
NO
*/
package main

import (
	"fmt"
)

func main() {
	var (
		S string
		hello = []rune("hello")
	)
	fmt.Scanf("%s", &S)
	s := []rune(S)
	lens := len(s)
	lenHello := len(hello)
	if lens < lenHello {
		fmt.Println("NO")
		return
	}
	var i, j int
	for ; i < lenHello; {
		for ; j < lens; j++ {
			if s[j] == hello[i] {
				i++
				j++
				break
			}
		}
		if j >= lens {
			break
		}
	}
	if i == lenHello {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import "fmt"

func main() {
	hello := "hello"
	var message string
	fmt.Scan(&message)
	var offset int
	for _, character := range message {
		if character == rune(hello[offset]) {
			offset += 1
		}

		if offset == len(hello) {
			fmt.Print("YES")
			return
		}
	}
	fmt.Print("NO")
}

package main
import "fmt"
func main () {
    var n string
    h:="hello"
    a:="NO"
    fmt.Scan(&n)
    ph:=0
    for i:=0;i<len(n);i++ {
        if n[i]==h[ph] {
            if ph==4 {
                a="YES"
                break
            } else {
                ph++
            }
        }
    }
    fmt.Println(a)
}

package main

import "fmt"

func main() {
	h := "hello"
	var s string
	fmt.Scan(&s)
	in := 0
	for i := 0; i < len(s) && in < 5; i++ {
		if s[i] == h[in] {
			in++
		}
	}
	if in == 5 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import "fmt"

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

	c := []byte{'h', 'e', 'l', 'o'}
	cont := []int{1, 1, 2, 1}
	flag := 0
	hitNum := 0

	for i := 0; i < len(word); i++ {
		if word[i] == c[flag] {
			hitNum += 1
			if hitNum >= cont[flag] {
				hitNum = 0
				flag += 1
			}
		}

		if flag >= len(c) {
			fmt.Print("YES")
			return
		}
	}

	fmt.Print("NO")
}

package main

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

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

func main() {
	defer w.Flush()

	var a string
	fmt.Scan(&a)

	var h = "hello"
	var index = 0
	for i := 0; i < len(a) && index < 5; i++{
		if h[index] == a[i]  {
			index++
		}
	}
	if index >= 5 {
		print("YES")
	}else {
		print("NO")
	}
}

package main

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

var s string

func main() {
	stdin := os.Stdin
	// stdin, _ = os.Open("1.in")
	reader := bufio.NewReaderSize(stdin, 1<<20)
	fmt.Fscanf(reader, "%s\n", &s)

	cnt := "hello"
	ans := "NO"
	for i := 0; i < len(s); i++ {
		if s[i] == cnt[0] {
			if len(cnt) == 1 {
				ans = "YES"
				break
			}
			cnt = cnt[1:len(cnt)]
		}
	}
	fmt.Println(ans)
}

package main

import "fmt"
import "strings"

func main() {
	var s string
	fmt.Scan(&s)
	pos := strings.Index(s, "h")
	if pos == -1 {
		fmt.Print("NO")
		return
	}
	s = s[pos+1:]
	pos = strings.Index(s, "e")
	if pos == -1 {
		fmt.Print("NO")
		return
	}
	s = s[pos+1:]
	pos = strings.Index(s, "l")
	if pos == -1 {
		fmt.Print("NO")
		return
	}
	s = s[pos+1:]
	pos = strings.Index(s, "l")
	if pos == -1 {
		fmt.Print("NO")
		return
	}
	s = s[pos+1:]
	pos = strings.Index(s, "o")
	if pos == -1 {
		fmt.Print("NO")
		return
	}
	fmt.Print("YES")
}

package main

import (
	"fmt"
)

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

	h := "hello"
	c := 0
	for i := 0; i < len(line); i++ {
		if line[i] == h[c] {
			c++
			if c == len(h) {
				fmt.Println("YES")
				return
			}
		}
	}

	fmt.Println("NO")
}

package main

import (
	"fmt"
)

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

	count := 0
	for _, c := range line {
		switch c {
		case 'h':
			if count == 0 {
				count++
			}
		case 'e':
			if count == 1 {
				count++
			}
		case 'l':
			if count == 2 || count == 3 {
				count++
			}
		case 'o':
			if count == 4 {
				count++
			}
		}
	}

	if count == 5 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import "fmt"

func main() {
    h := "hello"
    var s string
    fmt.Scan(&s)
    in := 0
    for i := 0; (i < len(s)) && (in < 5); i++ {
        if s[i] == h[in] { in++ }
    }
    if in == 5 { fmt.Println("YES") } else { fmt.Println("NO") }
}

package main

import "fmt"

func main() {
	var hello = "hello"
	var s string
	fmt.Scan(&s)
	idx := 0
	for i := 0; i < len(s) && idx < 5; i ++ {
		if s[i] == hello[idx] {
			idx ++;
		}
	}
	if (idx >= 5) {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
)

// ahhellllloou

func solve(s string) string {
	i := 0
	var seen string = ""
	for i < len(s) {
		if seen == "" && s[i] == 'h' {
			seen = "h"
		} else if seen == "h" && s[i] == 'e' {
			seen = "he"
		} else if seen == "he" && s[i] == 'l' {
			seen = "hel"
		} else if seen == "hel" && s[i] == 'l' {
			seen = "hell"
		} else if seen == "hell" && s[i] == 'o' {
			seen = "hello"
			return "YES"
		}
		i++
	}
	return "NO"
}

func main() {
	var s string
	fmt.Scanln(&s)
	sol := solve(s)
	fmt.Println(sol)
}

package main

import "fmt"

func main() {
	var s string
	fmt.Scan(&s)
	hi := "hello"
	ans := false
	j := 0
	for i := 0; i < len(s); i++ {
		if s[i] == hi[j] {
			j += 1
		}
		if j == len(hi) {
			ans = true
			break
		}
	}
	if ans {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import "fmt"

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

    var dst string = "hello"
    id := 0
    total := len(dst)
    for i := 0; i < len(s) && id < total; i++ {
        if s[i] == dst[id] {
            id++
        }
    }

    if id == total {
        fmt.Println("YES")
    } else {
        fmt.Println("NO")
    }
}

//  URL: http://codeforces.com/problemset/problem/58/A
//  ~ Basic Implementation Problem

package main

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

func isWordIn(w string, s string) string {
	if len(w) == 0 {
		return "YES"
	}
	if len(s) == 0 {
		return "NO"
	}
	if string(w[0]) != string(s[0]) {
		return isWordIn(w, s[1:])
	} else {
		return isWordIn(w[1:], s[1:])
	}
}

func main() {
	reader, writer := bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)
	defer writer.Flush()
	var s string
	fmt.Fscanf(reader, "%s\n", &s)
	fmt.Fprintf(writer, "%s\n", isWordIn("hello", s))
}

package main

import "fmt"

func main() {
    var s string
    fmt.Scan(&s)
    t := "hello"
    ls, lt, i, j := len(s), 5, 0, 0
    for i < ls && j < lt {
        if s[i] == t[j] {
            i ++
            j ++
        } else {
            i ++
        }
    }
    if (j == lt) {
        fmt.Println("YES")
    } else {
        fmt.Println("NO")
    }
}

package main

import (
    "fmt"
    )

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

    h := "hello"
    i := 0
    for _, c := range s {
        if i == len(h) {
            break
        }
        if c == rune(h[i]) {
            i++
        }
    }
    if i == len(h) {
        fmt.Println("YES")
        return
    }
    fmt.Println("NO")
}

package main
import (
    "fmt"
)

func main() {
    var word string
    fmt.Scanf("%s", &word)

    hello := "hello"
    counter := 0

    for _, r := range word {
        if counter < len(hello) {
            //fmt.Println("r: ",r,", hello: ", hello[counter])
            if uint8(r) == hello[counter] {
              counter++
            }
        }
    }

    switch counter {
        case 5: fmt.Println("YES")
        default: fmt.Println("NO")
    }
}

package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanRunes)
	expected := []rune{'h', 'e', 'l', 'l', 'o'}
	for scanner.Scan() {
		b := scanner.Text()
		br := rune(b[0])
		if br == expected[0] {
			if len(expected) == 1 {
				expected = expected[0:0]
				break
			}
			expected = expected[1:]
		}
	}
	if len(expected) == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println(("NO"))
	}
}

package main

import "fmt"

func main() {
	var s, s2 string
	var tmp int
	var flag bool
	fmt.Scanf("%s", &s)
	for i := range s {
		if tmp == 0 {
			if s[i] == 'h' {
				s2 = s2 + string(s[i])
				tmp++
			}
		} else if tmp == 1 {
			if s[i] == 'e' {
				s2 = s2 + string(s[i])
				tmp++
			}
		} else if tmp == 2 {
			if s[i] == 'l' {
				s2 = s2 + string(s[i])
				tmp++
			}
		} else if tmp == 3 {
			if s[i] == 'l' {
				s2 = s2 + string(s[i])
				tmp++
			}
		} else if tmp == 4 {
			if s[i] == 'o' {
				s2 = s2 + string(s[i])
				tmp++
			}
		}
		if tmp == 5 {
			flag = true
			break
		}
	}
	if flag {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import "fmt"

func main() {
	var s string
	var tmp int
	var flag bool
	fmt.Scanf("%s", &s)
	for i := range s {
		if tmp == 0 {
			if s[i] == 'h' {
				tmp++
			}
		} else if tmp == 1 {
			if s[i] == 'e' {
				tmp++
			}
		} else if tmp == 2 {
			if s[i] == 'l' {
				tmp++
			}
		} else if tmp == 3 {
			if s[i] == 'l' {
				tmp++
			}
		} else if tmp == 4 {
			if s[i] == 'o' {
				tmp++
			}
		}
		if tmp == 5 {
			flag = true
			break
		}
	}
	if flag {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	var str []byte
	str, _, _ = reader.ReadLine()
	var hello []byte = []byte{'h', 'e', 'l', 'l', 'o'}
	var i byte
	for _, v := range str {
		if v == hello[i] {
			i++
			if i == byte(len(hello)) {
				fmt.Println("YES")
				return
			}
		}
	}
	fmt.Println("NO")
}

package main

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

//========== Implement Algorithm =======================
func solution(str string) bool {
	if len(str) < 5 {
		return false
	}
	h := false
	e := false
	l := false
	o := false
	lcount := 0
	for x := 0; x < len(str); x++ {
		if h && e && l && o {
			return true
		}

		if string(str[x]) == "h" {
			h = true
		} else if string(str[x]) == "e" && h {
			e = true
		} else if string(str[x]) == "l" && h && e {
			lcount++
			if lcount == 2 {
				l = true
			}

		} else if string(str[x]) == "o" && h && e && l {
			o = true
		}
	}

	return h && e && l && o
}

func main() {

	scanner := bufio.NewScanner(os.Stdin)

	//================== Variables used ====================
	var str string
	var ret bool
	//======================================================

	//============== 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()
	str = scanner.Text()
	//======================================================
	ret = solution(str)
	//==================== OUTPUT ==========================
	if ret {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import ("fmt")

func main(){
	var line string
	b := "hello"
	scan(&line)
	p := 0
	for i := 0; i < len(line); i++{
		if p < 5 && line[i] == b[p]{p++}
	}
	if p == 5 {
		sout("YES")
	}else{
		sout("NO")
	}
}

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() {
	var s string
	fmt.Scan(&s)
	hell := "hello"
	recovered := 0
	for i := range s {
		if s[i] == hell[recovered] {
			recovered++
		}
		if recovered == 5 {
			fmt.Print("YES")
			return
		}
	}
	fmt.Print("NO")
}

package main

import (
  "fmt"
)

func main() {
  var s string
  word := "hello"
  var count, l int
  l = 4
  fmt.Scanf("%s", &s)

  for i:=0; i < len(s); i++ {
    if (s[i] == word[count]) {
      count++
    }
    if(count > l) {
      break
    }
  }

  if(count > l) {
    fmt.Println("YES")
  } else {
    fmt.Println("NO")
  }
}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	var str string
	fmt.Fscanln(reader, &str)
	slice := []rune(str)
	sym := []rune("hello")
	index := 0
	flag := false
	for _, s := range slice {
		check := sym[index]
		if s == check {
			if index == 4 {
				flag = true
				fmt.Println("YES")
				break
			} else {
				index++
			}
		}
	}
	if !flag {
		fmt.Println("NO")
	}
}

package main

import "fmt"

func main() {
	s := ""
	fmt.Scanln(&s)
	w := []rune{'h', 'e', 'l', 'l', 'o'}
	lenw := len(w)
	next := 0
	for _, c := range s {
		if next >= lenw {
			break
		}
		if c == w[next] {
			next++
		}
	}
	if next >= lenw {
		fmt.Println("YES")
		return
	}
	fmt.Println("NO")
}

package main

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

func main() {
	s, _ := bufio.NewReader(os.Stdin).ReadBytes('\n')
	i, h, ello := 0, byte('h'), []byte("ello")
	for _, b := range s {
		if h == b {
			if i == 4 {
				fmt.Print("YES")
				return
			}
			h = ello[i]
			i += 1
		}
	}
	fmt.Print("NO")
}

package main

import "fmt"

func main() {
	var s []byte
	fmt.Scan(&s)
	i, h, ello := -1, byte('h'), []byte{'e', 'l', 'l', 'o'}
	for _, b := range s {
		if h == b {
			i++
			if i == 4 {
				fmt.Print("YES")
				return
			}
			h = ello[i]
		}
	}
	fmt.Print("NO")
}

package main

import "fmt"

func main() {
    h := "hello"
    var s string
    fmt.Scan(&s)
    in := 0
    for i := 0; (i < len(s)) && (in < 5); i++ {
        if s[i] == h[in] { in++ }
    }
    if in == 5 { fmt.Println("YES") } else { fmt.Println("NO") }
}

package main

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

func task_solution(line []byte) string {
	sub := []byte{'h', 'e', 'l', 'l', 'o'}
	var i, j int
	for i, j = 0, 0; i < len(sub) && j < len(line); j += 1 {
		if line[j] == sub[i] {
			i += 1
		}
	}
	if i == len(sub) && j <= len(line) {
		return "YES"
	}
	return "NO"
}

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

	fmt.Println(task_solution(bytes.TrimSpace(in_raw)))
}

package main

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

import "fmt"

const sub = "hello"

func task_solution(line string) string {
	var i, j int
	for i, j = 0, 0; i < len(sub) && j < len(line); j += 1 {
		if sub[i] == line[j] {
			i += 1
		}
	}
	if i == len(sub) && j <= len(line) {
		return "YES"
	}
	return "NO"
}

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

	fmt.Println(task_solution(line))
}

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

package main

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

func Solve(s string) string {
	order := "hello"
	i := 0
	j := 0
	for i < 5 && j < len(s) {
		if s[j] == order[i] {
			j += 1
			i += 1
		} else {
			j += 1
		}
	}
	if i == 5 {
		return "YES"
	}
	return "NO"
}

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

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

	fmt.Fprintf(writer, "%s\n", Solve(s))
}

package main

import (
	"fmt"
	"regexp"
)

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

	var hello = regexp.MustCompile(`h.*e.*l.*l.*o`)

	if hello.MatchString(s) {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}

}

package main

import (
	"fmt"
)

// Snippet: isSubSeq
func isSubseq(s1 string, s2 string) bool {
	var k = 0
	for i := 0; i < len(s2); i++ {
		if s2[i] == s1[k] {
			k++
			if k == len(s1) {
				return true
			}
		}
	}
	return false
}

func main() {
	var s string
	fmt.Scan(&s)
	if isSubseq("hello", s) {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
)

func main() {
	var s string
	hello := "hello"
	fmt.Scan(&s)
	for i := range s {
		if s[i] == hello[0] {
			hello = hello[1:]
			if len(hello) == 0 {
				fmt.Println("YES")
				return
			}
		}
	}
	fmt.Println("NO")
}

package main

import (
	"fmt"
)

func main() {
	var w, res string
	fmt.Scanln(&w)
	for _, y := range w {
		switch string(y) {
		case "h":
			if res == "" {
				res = "h"
			}
		case "e":
			if res == "h" {
				res = "he"
			}
		case "l":
			if res == "he" {
				res = "hel"
			} else if res == "hel" {
				res = "hell"
			}
		case "o":
			if res == "hell" {
				res = "hello"
			}

		}
	}

	if res == "hello" {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}

}

package main

import (
	"fmt"
	"strings"
)

func main() {
	var istring string
	_, _ = fmt.Scan(&istring)
	var check = []string{"h","e","l","l","o"}
	j:=0
	count :=0
	temp := strings.Split(istring,"")
	for i:=0; i<len(temp); i++ {
		if temp[i] == check[j] {
			count++
			if count == 5 {
				break
			} else {
				j++
			}
		}
	}
	if count == 5 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	var str string
	scanner.Scan()
	str = scanner.Text()
	var word = "hello"
	var index = 0
	key := rune(word[index])
	for _, char := range str {
		if char == key {
			index++
			if index == len(word) {
				fmt.Print("YES")
				return
			}else {
				key = rune(word[index])
			}
		}
	}
	fmt.Print("NO")
}

package main

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

func main() {
	str := "hello"
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	strInp := scanner.Text()
	var count int64
	var i, j, length int64 = 0, 0, int64(len(strInp))

	for i = 0; i < length; i++ {

		if strInp[i] == str[j] {
			count++
			j++
		}

		if count == 5 {
			break
		}
	}

	if count == 5 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

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

func main() {
	var s string
	fmt.Fscanf(os.Stdin, "%s\n", &s)
	index1 := strings.Index(s, "h")
	s = s[index1+1:]
	index2 := strings.Index(s, "e")
	s = s[index2+1:]
	index3 := strings.Index(s, "l")
	s = s[index3+1:]
	index4 := strings.Index(s, "l")
	s = s[index4+1:]
	index5 := strings.Index(s, "o")
	if index5 >= 0 && index4 >= 0 && index3 >= 0 && index2 >= 0 && index1 >= 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

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

func main() {
	var palabra string

	helloArray := []string{"h","e","l","l","o"}
	hello := make(map[string]bool)

	for _, item := range helloArray{
		hello[item] = false
	}

	fmt.Scanln(&palabra)
	strings.Split("", palabra)

	indexCounter := 0

	for i := 0; i < len(palabra); i++{
		if indexCounter < len(helloArray) {
			if string(palabra[i]) == helloArray[indexCounter] {
				hello[helloArray[indexCounter]] = true

				indexCounter++
			}
		}else{
			break
		}
	}

	for _, item := range helloArray{
		//fmt.Println(item, hello[item])

		if hello[item] == false{
			fmt.Println("NO")
			os.Exit(0)
		}
	}
	fmt.Println("YES")
}

package main

import (
"fmt"
)

func main() {
	var inp,hello string
	hello = "hello"
	fmt.Scan(&inp)
	it := 0
	for i:=0;i<len(inp)&&it<5;i++ {
		if(inp[i]==hello[it]){
			it++
		}
	}
	if(it==5){
		fmt.Print("YES")
	} else {
		fmt.Print("NO")
	}
	fmt.Println("")
}

package main

import (
	"fmt"
	"strings"
)

func find(wanted, word string) bool {
	var first string
	for len(wanted) > 0 && len(word) > 0 {
		first, wanted = string(wanted[0]), wanted[1:]
		index := strings.Index(word, first)
		if index == -1 {
			return false
		}
		word = word[index+1:]
	}
	return len(wanted) == 0
}

func main() {
	var word string

	wanted := "hello"

	fmt.Scan(&word)
	if find(wanted, word) {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}

}

package main

import (
	"fmt"
)

func main() {
	var st string
	fmt.Scan(&st)
	hello := "hello"
	cur := 0
	for i := 0; cur < len(hello) && i < len(st); i++ {
		if st[i] == hello[cur] {
			cur++
		}
	}
	if cur == len(hello) {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
	"strings"
)

func main() {
	var st string
	fmt.Scan(&st)
	if contain(st, "hello") {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

func contain(st string, pattern string) bool {
	if pattern == "" {
		return true
	}
	i := strings.IndexByte(st, pattern[0])
	if i == -1 {
		return false
	}
	return contain(st[i+1:], pattern[1:])
}

package main

import (
	"fmt"
	"os"
)

//import "strings"

//import "math"
//import "strconv"
//import "sort"

func main() {

	str := "hello*"

	d := ""

	fmt.Scan(&d)

	cur := 0

	for i := 0; i < len(d); i++ {

		if str[cur] == d[i] {
			fmt.Println(i)
			cur++
		}
		if cur == 5 {
			os.Exit(0)
		}
	}
	fmt.Println("NO")
}

package main

import (
	"fmt"
	"os"
)

//import "strings"

//import "math"
//import "strconv"
//import "sort"

func main() {

	str := "hello"

	d := ""

	fmt.Scan(&d)

	cur := 0

	for i := 0; i < len(d); i++ {

		if str[cur] == d[i] {
			cur++
		}
		if cur == 4 {
			fmt.Println("YES")
			os.Exit(0)
		}
	}
	fmt.Println("NO")
}

package main

import (
	"fmt"
	"os"
)

//import "strings"

//import "math"
//import "strconv"
//import "sort"

func main() {

	str := "hello*"

	d := ""

	fmt.Scan(&d)

	cur := 0

	for i := 0; i < len(d); i++ {

		if str[cur] == d[i] {
			fmt.Println(i)
			cur++
		}
		if cur == 4 {
			os.Exit(0)
		}
	}
	fmt.Println("NO")
}

package main

import (
	"fmt"
	"strings"
)

// INPUT
// ahhellllloou -> YES
// hlelo -> NO
// helhcludoo -> YES

func main() {
	var word, wholeWord string

	fmt.Scanf("%v", &word)

	for _, char := range word {
		if wholeWord == "" || !strings.Contains(wholeWord, string(char)) && (char == 'h' || char == 'e' || char == 'l' || char == 'o') {
			wholeWord += string(char)
		}
	}

	if strings.Contains(wholeWord, "helo") {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
	"strings"
)

// INPUT
// ahhellllloou -> YES
// hlelo -> NO
// helhcludoo -> YES

func main() {
	var word, wholeWord string

	fmt.Scanf("%v", &word)

	for _, char := range word {
		if wholeWord == "" || !strings.Contains(wholeWord, string(char)) && (char == 'h' || char == 'e' || char == 'l' || char == 'o') {
			wholeWord += string(char)
		}
	}

	fmt.Println(wholeWord)

	if strings.Contains(wholeWord, "helo") {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
	"strings"
)

// INPUT
// ahhellllloou -> YES
// hlelo -> NO

func main() {
	var word, wholeWord string

	fmt.Scanf("%v", &word)

	for _, char := range word {
		if wholeWord == "" || wholeWord[len(wholeWord)-1] != byte(char) {
			wholeWord += string(char)
		}
	}

	if strings.Contains(wholeWord, "helo") {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import "fmt"
import "strings"

func foo(s string) bool {
	var i int
	if i = strings.Index(s, "h"); i == -1 {
		return false
	}
	if i = strings.Index(s, "e"); i == -1 {
		return false
	}
	if i = strings.Index(s, "l"); i == -1 {
		return false
	}
	if i = strings.Index(s, "l"); i == -1 {
		return false
	}
	if i = strings.Index(s, "o"); i == -1 {
		return false
	}
	return true
}

func main() {
	var s string
	fmt.Scan(&s)
	if foo(s) {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import "fmt"
import "strings"

func foo(s string) bool {
	const l = "hello"
	for i, j := 0, 0; j < len(l); j++ {
		s = s[i:]
		if i = strings.Index(s[i:], string(l[j])); i == -1 {
			return false
		}
	}
	return true
	/*for i := 0; i < len(s); i++ {
		for j := i + 1; j < len(s); j++ {
			for k := j + 1; k < len(s); k++ {
				for l := k + 1; l < len(s); l++ {
					for m := l + 1; m < len(s); m++ {
						if s[i] == 'h' && s[j] == 'e' && s[k] == 'l' && s[l] == 'l' && s[m] == 'o' {
							return true
						}
					}
				}
			}
		}
	}*/
}

func main() {
	var s string
	fmt.Scan(&s)
	if foo(s) {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	s, _ := reader.ReadString('\n')
	goal := "hello"
	state := 0
	good := false
	for i := 0; i < len(s); i++ {
		if state == len(goal)-1 {
			good = true
			break
		}

		if s[i] == goal[state] {
			state++
		}
	}

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

	}
}

package main

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

func main() {
	var scanner *bufio.Scanner

	scanner = bufio.NewScanner(os.Stdin)

	scanner.Scan()
	if err := scanner.Err(); err == nil {
		if regexp.MustCompile("\\w*[h ]+[e ]+[l ]+[l ]+[o ]+\\w*").MatchString(scanner.Text()) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}

}

package main

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

type input struct {
	a string
}

func (c *input) Read(scanner *bufio.Scanner) {
	for scanner.Scan() {
		c.a = scanner.Text()
		return
	}

}

func main() {
	var inp input
	sc := bufio.NewScanner(os.Stdin)
	inp.Read(sc)

	var h, e, l, l2 bool

	for _, b := range inp.a {
		s := string(b)
		if s ==  "h" {
			h = true
		}

		if h && s == "e" {
			e = true
		}
		if h && e && s == "l" {
			l = true

		}
		if h && e && l && s=="l" {
			l2 = true

		}
		if h && e && l && l2 && s == "o" {
			fmt.Println("YES")
			return
		}
	}
	fmt.Println("NO")
}

package main

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

type input struct {
	a string
}

func (c *input) Read(scanner *bufio.Scanner) {
	for scanner.Scan() {
		c.a = scanner.Text()
		return
	}

}

func main() {
	var inp input
	sc := bufio.NewScanner(os.Stdin)
	inp.Read(sc)

	var h, e, l, l2 bool

	for _, b := range inp.a {
		s := string(b)
		if s ==  "h" {
			h = true
		}

		if h && s == "e" {
			e = true
		}
		if h && e && s == "l" {
			l = true

		}
		if h && e && l && s=="l" {
			l2 = true

		}
		if h && e && l && l2 && s == "o" {
			return
		}
	}
	fmt.Println("NO")
}

package main

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

type input struct {
	a string
}

func (c *input) Read(scanner *bufio.Scanner) {
	for scanner.Scan() {
		c.a = scanner.Text()
		return
	}

}

func main() {
	var inp input
	sc := bufio.NewScanner(os.Stdin)
	inp.Read(sc)

	var h, e, l, l2 bool

	for i, b := range inp.a {
		var v1 int
		s := string(b)
		if s ==  "h" {
			v1 = i
			h = true
		}

		if v1 > i && h && s == "e" {
			v1 = i
			e = true
		}
		if v1 > i && h && e && s == "l" {
			v1 = i

			l = true

		}
		if v1 > i && h && e && l && s=="l" {
			v1 = i

			l2 = true

		}
		if v1 > i && h && e && l && l2 && s == "o" {
			fmt.Println("YES")
			return
		}
	}
	fmt.Println("NO")
}

package main

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

type input struct {
	a string
}

func (c *input) Read(scanner *bufio.Scanner) {
	for scanner.Scan() {
		c.a = scanner.Text()
		return
	}

}

func main() {
	var inp input
	sc := bufio.NewScanner(os.Stdin)
	inp.Read(sc)

	var h, e, l, l2 bool

	for _, b := range inp.a {
		s := string(b)
		if s ==  "h" {
			h = true
			if h && s == "e" {
				e = true
				if h && e && s == "l" {
					l = true
					if h && e && l && s=="l" {
						l2 = true
						if h && e && l && l2 && s == "o" {
							fmt.Println("YES")
							return
						}
					}
					}
				}
			}
		}
	fmt.Println("NO")
}

/*
Chat room
time limit per test2 seconds
memory limit per test256 megabytes
inputstandard input
outputstandard output
Vasya has recently learned to type and log on to the Internet. He immediately entered a chat room and decided to say hello to everybody. Vasya typed the word s. It is considered that Vasya managed to say hello if several letters can be deleted from the typed word so that it resulted in the word "hello". For example, if Vasya types the word "ahhellllloou", it will be considered that he said hello, and if he types "hlelo", it will be considered that Vasya got misunderstood and he didn't manage to say hello. Determine whether Vasya managed to say hello by the given word s.

Input
The first and only line contains the word s, which Vasya typed. This word consisits of small Latin letters, its length is no less that 1 and no more than 100 letters.

Output
If Vasya managed to say hello, print "YES", otherwise print "NO".

Sample test(s)
input
ahhellllloou
output
YES
input
hlelo
output
NO
*/
package main

import (
	"fmt"
)

func main() {
	var (
		S string
		hello = []rune("hello")
	)
	fmt.Scanf("%s", &S)
	s := []rune(S)
	lens := len(s)
	lenHello := len(hello)
	if lens < lenHello {
		println("NO")
		return
	}
	var i, j int
	for ; i < lenHello; {
		for ; j < lens; j++ {
			if s[j] == hello[i] {
				i++
				j++
				break
			}
		}
		if j >= lens {
			break
		}
	}
	if i == lenHello {
		println("YES")
	} else {
		println("NO")
	}
}

/*
Chat room
time limit per test2 seconds
memory limit per test256 megabytes
inputstandard input
outputstandard output
Vasya has recently learned to type and log on to the Internet. He immediately entered a chat room and decided to say hello to everybody. Vasya typed the word s. It is considered that Vasya managed to say hello if several letters can be deleted from the typed word so that it resulted in the word "hello". For example, if Vasya types the word "ahhellllloou", it will be considered that he said hello, and if he types "hlelo", it will be considered that Vasya got misunderstood and he didn't manage to say hello. Determine whether Vasya managed to say hello by the given word s.

Input
The first and only line contains the word s, which Vasya typed. This word consisits of small Latin letters, its length is no less that 1 and no more than 100 letters.

Output
If Vasya managed to say hello, print "YES", otherwise print "NO".

Sample test(s)
input
ahhellllloou
output
YES
input
hlelo
output
NO
*/
package main

import (
	"fmt"
)

func main() {
	var (
		S string
		hello = []rune("hello")
	)
	fmt.Scanf("%s\n", &S)
	s := []rune(S)
	lens := len(s)
	lenHello := len(hello)
	if lens < lenHello {
		println("NO")
		return
	}
	var i, j int
	for ; i < lenHello; {
		for ; j < lens; j++ {
			if s[j] == hello[i] {
				i++
				j++
				break
			}
		}
		if j >= lens {
			break
		}
	}
	if i == lenHello {
		println("YES")
	} else {
		println("NO")
	}
}

package main

import "fmt"

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

	c := []byte{'h', 'e', 'l', 'o'}
	cont := []int{1, 1, 2, 1}
	flag := 0
	hitNum := 0

	for i := 0; i < len(word); i++ {
		if word[i] == c[flag] {
			hitNum += 1
		} else {
			if hitNum < cont[flag] {
				flag = 0
			} else {
				flag += 1
				i--
			}
			hitNum = 0
		}

		if flag >= len(c) {
			fmt.Print("YES")
			return
		}
	}

	fmt.Print("NO")
}

package main

import (
	"fmt"
)

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

 	var h = "hello"
 	var index = 0
 	for i := 0; i < len(a) && index < 5; i++{
		if h[index] == a[i]  {
			index++
		}
	}
	if index >= 5 {
		print("YES")
	}else {
		print("NO")
	}
}

package main

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

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

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

	var h = "hello"
	var index = 0
	for i := 0; i < len(a) && index < 5; i++{
		if h[index] == a[i]  {
			index++
		}
	}
	if index >= 5 {
		print("YES")
	}else {
		print("NO")
	}
}

package main

import (
	"fmt"
)

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

	count := 0
	for _, c := range line {
		switch c {
		case 'h':
			count++
		case 'e':
			if count == 1 {
				count++
			}
		case 'l':
			if count == 2 || count == 3 {
				count++
			}
		case 'o':
			if count == 4 {
				count++
			}
		}
	}

	if count == 5 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
)

// ahhellllloou

func solve(s string) string {
	i := 0
	for i < len(s) {
		if s[i] == 'h' {
			i++
			for s[i] == 'h' {
				i++
			}
			if s[i] == 'e' {
				i++
				for s[i] == 'e' {
					i++
				}
				if s[i] == 'l' {
					i++
					for s[i] == 'l' {
						i++
					}
					if s[i] == 'o' {
						i++
						for s[i] == 'o' {
							return "YES"
							i++
						}
					} else {
						i++
					}
				}
			} else {
				i++
			}
		} else {
			i++
		}
	}
	return "NO"
}

func main() {
	var s string
	fmt.Scanln(&s)
	sol := solve(s)
	fmt.Println(sol)
}

package main

import "fmt"

func main() {
	var s string
	fmt.Scan(&s)
	hi := "hello"
	ans := false
	j := 0
	for i := 0; i < len(s); i++ {
		if s[i] == hi[j] {
			j += 1
		}
		if j == len(hi) {
			ans = true
			break
		}
	}
	fmt.Println(ans)
}

package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanRunes)
	expected := []rune{'h', 'e', 'l', 'l', 'o'}
	for scanner.Scan() {
		b := scanner.Text()
		br := rune(b[0])
		if br == expected[0] {
			if len(expected) == 1 {
				expected = expected[:]
				break
			}
			expected = expected[1:]
		}
	}
	if len(expected) == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println(("NO"))
	}
}

package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanRunes)
	expected := []rune{'h', 'e', 'l', 'l', 'o'}
	for scanner.Scan() {
		b := scanner.Text()
		br := rune(b[0])
		if br == expected[0] {
			if len(expected) > 1 {
				expected = expected[1:]
				continue
			}
			break
		}
	}
	if len(expected) == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println(("NO"))
	}
}

package main

import "fmt"

func main() {
	var s, s2 string
	var tmp int
	var flag bool
	fmt.Scanf("%s", &s)
	for i := range s {
		if tmp == 0 {
			if s[i] == 'h' {
				s2 = s2 + string(s[i])
				tmp++
			}
		} else if tmp == 1 {
			if s[i] == 'e' {
				s2 = s2 + string(s[i])
				tmp++
			}
		} else if tmp == 2 {
			if s[i] == 'l' {
				s2 = s2 + string(s[i])
				tmp++
			}
		} else if tmp == 3 {
			if s[i] == 'l' {
				s2 = s2 + string(s[i])
				tmp++
			}
		} else if tmp == 4 {
			if s[i] == 'l' {
				s2 = s2 + string(s[i])
				tmp++
			}
		}
		if tmp == 5 {
			flag = true
			break
		}
	}
	if flag {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

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

//========== Implement Algorithm =======================
func solution(str string) bool {
	if len(str) < 6 {
		return false
	}
	h := strings.Count(str, "h") >= 1
	e := strings.Count(str, "e") >= 1
	l := strings.Count(str, "l") >= 2
	o := strings.Count(str, "o") >= 1
	return h && e && l && o
}

func main() {

	scanner := bufio.NewScanner(os.Stdin)

	//================== Variables used ====================
	var str string
	var ret bool
	//======================================================

	//============== 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()
	str = scanner.Text()
	//======================================================
	ret = solution(str)
	//==================== OUTPUT ==========================
	if ret {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

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

//========== Implement Algorithm =======================
func solution(str string) bool {
	if len(str) < 6 {
		return false
	}
	h := false
	e := false
	l := false
	o := false
	lcount := 0
	for x := 0; x < len(str); x++ {
		if h && e && l && o {
			return true
		}
		if string(str[x]) == "h" {
			h = true
		} else if string(str[x]) == "e" && h {
			e = true
		} else if string(str[x]) == "l" && h && e {
			lcount++
			if lcount == 2 {
				l = true
			}

		} else if string(str[x]) == "o" && h && e && l {
			o = true
		}
	}

	return false
}

func main() {

	scanner := bufio.NewScanner(os.Stdin)

	//================== Variables used ====================
	var str string
	var ret bool
	//======================================================

	//============== 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()
	str = scanner.Text()
	//======================================================
	ret = solution(str)
	//==================== OUTPUT ==========================
	if ret {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

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

//========== Implement Algorithm =======================
func solution(str string) bool {
	if len(str) < 6 {
		return false
	}
	h := false
	e := false
	l := false
	o := false
	lcount := 0
	for x := 0; x < len(str); x++ {
		if h && e && l && o {
			return true
		}

		if string(str[x]) == "h" {
			h = true
		} else if string(str[x]) == "e" && h {
			e = true
		} else if string(str[x]) == "l" && h && e {
			lcount++
			if lcount == 2 {
				l = true
			}

		} else if string(str[x]) == "o" && h && e && l {
			o = true
		}
	}

	return h && e && l && o
}

func main() {

	scanner := bufio.NewScanner(os.Stdin)

	//================== Variables used ====================
	var str string
	var ret bool
	//======================================================

	//============== 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()
	str = scanner.Text()
	//======================================================
	ret = solution(str)
	//==================== OUTPUT ==========================
	if ret {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

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

//========== Implement Algorithm =======================
func solution(str string) bool {
	if len(str) < 6 {
		return false
	}
	h := false
	e := false
	l := false
	o := false
	lcount := 0
	for x := 0; x < len(str); x++ {
		if h && e && l && o {
			return true
		}
		if string(str[x]) == "h" {
			h = true
		} else if string(str[x]) == "o" {
			o = true
		} else if string(str[x]) == "l" {
			lcount++
			if lcount == 2 {
				l = true
			}

		} else if string(str[x]) == "e" {
			e = true
		}
	}

	return false
}

func main() {

	scanner := bufio.NewScanner(os.Stdin)

	//================== Variables used ====================
	var str string
	var ret bool
	//======================================================

	//============== 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()
	str = scanner.Text()
	//======================================================
	ret = solution(str)
	//==================== OUTPUT ==========================
	if ret {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import ("fmt")

func main(){
	var line string
	b := "hello"
	scan(&line)
	p := 0
	for i := 0; i < len(line); i++{
		if line[i] == b[p] && p < 4 {p++}
	}
	if p == 4 {
		sout("YES")
	}else{
		sout("NO")
	}
}

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() {
  var s string
  word := "hello"
  var count, l int
  l = 4
  fmt.Scanf("%s", &s)

  for i:=0; i < len(s); i++ {
    if (s[i] == word[count]) {
      count++
    }
    if(count > l) {
      break
    }
  }

  if(count >= l) {
    fmt.Println("YES")
  } else {
    fmt.Println("NO")
  }
}

package main

import "fmt"

func main() {
	var s []byte
	fmt.Scan(&s)
	i, h, ello := 0, byte('h'), []byte{'e', 'l', 'l', 'o'}
	for _, b := range s {
		if h == b {
			if i == 3 {
				fmt.Print("YES")
				return
			}
			h = ello[i]
			i++
		}
	}
	fmt.Print("NO")
}

package main

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

func task_solution(line []byte) string {
	substr := []byte{'h', 'e', 'l', 'l', 'o'}
	pos := 0
	for _, c := range substr {
		for pos < len(line) && line[pos] != c {
			pos += 1
		}
		// found char
		if pos < len(line) {
			pos += 1
		}
	}
	if pos < len(line) {
		return "YES"
	}
	return "NO"
}

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

	fmt.Println(task_solution(bytes.TrimSpace(in_raw)))
}

package main

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

func task_solution(line []byte) string {
	substr := []byte{'h', 'e', 'l', 'l', 'o'}
	pos := 0
	for _, c := range substr {
		for pos < len(line) && line[pos] != c {
			pos += 1
		}
		// found char
		if pos < len(line) {
			pos += 1
		}
	}
	if pos <= len(line) {
		return "YES"
	}
	return "NO"
}

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

	fmt.Println(task_solution(bytes.TrimSpace(in_raw)))
}


One day Vasya the Hipster decided to count how many socks he had. It turned out that he had a red socks and b blue socks.According to the latest fashion, hipsters should wear the socks of different colors: a red one on the left foot, a blue one on the right foot.Every day Vasya puts on new socks in the morning and throws them away before going to bed as he doesn't want to wash them.Vasya wonders, what is the maximum number of days when he can dress fashionable and wear different socks, and after that, for how many days he can then wear the same socks until he either runs out of socks or cannot make a single pair from the socks he's got.Can you help him?

NoteIn the first sample Vasya can first put on one pair of different socks, after that he has two red socks left to wear on the second day.

package main

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

var in *bufio.Scanner = bufio.NewScanner(os.Stdin)
var out *bufio.Writer = bufio.NewWriter(os.Stdout)

func main() {
	defer out.Flush()
	in.Split(bufio.ScanWords)

	a, b := nextInt(), nextInt()
	fmt.Printf("%d %d", min(a, b), (a + b - 2 * min(a, b)) / 2)
}

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

func nextInt() int {
	in.Scan()
	res, _ := strconv.Atoi(in.Text())
	return res
}

func next() string {
	in.Scan()
	return in.Text()
}

package main

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

func main(){
	var r,b int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in,&r,&b)
	min,max := minmax(r,b)
	fmt.Println(min,(max-min)/2)
}
func minmax(a,b int)(int,int){
	if a<b {
		return a,b
	}
	return b,a
}

// A. Vasya the Hipster
/*
One day Vasya the Hipster decided to count how many socks he had. It turned out
that he had a red socks and b blue socks.

According to the latest fashion, hipsters should wear the socks of different
colors: a red one on the left foot, a blue one on the right foot.

Every day Vasya puts on new socks in the morning and throws them away before
going to bed as he doesn't want to wash them.

Vasya wonders, what is the maximum number of days when he can dress
fashionable and wear different socks, and after that, for how many days he
can then wear the same socks until he either runs out of socks or cannot make
a single pair from the socks he's got.

Can you help him?

Input
The single line of the input contains two positive integers a and b
(1 ≤ a, b ≤ 100) — the number of red and blue socks that Vasya's got.

Output
Print two space-separated integers — the maximum number of days when Vasya can
wear different socks and the number of days when he can wear the same socks
until he either runs out of socks or cannot make a single pair from the socks
he's got.

Keep in mind that at the end of the day Vasya throws away the socks that he's
been wearing on that day.

Examples
Input
3 1

Output
1 1

Input
2 3

Output
2 0

Input
7 3

Output
3 2

Note
In the first sample Vasya can first put on one pair of different socks,
after that he has two red socks left to wear on the second day.
*/
package main

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

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

	o1, o2 := 0, 0
	if a < b {
		o1 = a
		o2 = (b - o1) / 2
	} else {
		o1 = b
		o2 = (a - o1) / 2
	}
	fmt.Printf("%v %v", o1, o2)
}

package main
import (
	"fmt"
	"math"
)

func main() {
	var(
		a, b int
		together, separate int
	)
	fmt.Scanln(&a, &b)
	together = int(math.Min(float64(a), float64(b)))
	separate = int(math.Abs(float64(a-b))/2)
	fmt.Println(together, separate)
}

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)

	a, b := nextInt(), nextInt()

	if a > b {
		println(b, (a-b)/2)
	} else {
		println(a, (b-a)/2)
	}
}

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

type u32 uint32

func min(a,b *u32)u32{
    if *a>*b{
        return *b
    }
    return *a
}

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

func main(){
    var(
        a,b u32
    )
    fmt.Scan(&a,&b)
    fmt.Println(min(&a,&b),(max(&a,&b)-min(&a,&b))/2)
}

package main

import "fmt"

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

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

func main() {
	var a,b int
	_, _ = fmt.Scan(&a, &b)
	a, b = min(a,b), max(a, b)
	fmt.Println(a, (b - a) / 2)
}

package main

import "fmt"

func main() {
	var r, b int
	fmt.Scan(&r, &b)

	dif := min(r, b)
	sam := (max(r, b) - dif) / 2

	fmt.Println(dif, sam)
}

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

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

package main

import "fmt"

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

func main() {
    var a, b int
    fmt.Scanf("%d %d", &a, &b)

    both := min(a, b)
    a -= both
    b -= both
    single := a/2 + b/2

    fmt.Println(both, single)
}

package main

import "fmt"

func diff(red int,blue int) (val1 int,val2 int) {
for{
  if (red!=0)&&(blue!=0) {
	  val1++

  }else{
	 // fmt.Printf("the value of red and blue before being passed to same :%d %d\n",red,blue)
   if red>1 {
	   val2=same(red)
	   break
   }else if blue>1{
	   val2=same(blue)
	   break
   }else{
	   break
   }

}
red--;blue--;
}
return
}

func main()  {
	var red,blue int
	fmt.Scan(&red)
	fmt.Scan(&blue)
	val1,val2:=diff(red,blue)
	fmt.Print(val1,val2)
	}

func same(col int)(val2 int){

	for{

		if col>1{
			val2++
		}else{
			return
		}
		col=col-2
	}

}

package main

import "fmt"

func main() {
	var red, blue, min, max int
	fmt.Scanf("%d %d", &red, &blue)
	if red < blue {
		min = red
		max = blue
	} else {
		min = blue
		max = red
	}
	fmt.Println(min, (max-min)/2)
}

package main

import (
	"fmt"
)

func main() {
	var a, b int
	fmt.Scanf("%d %d \n", &a, &b)
	if a > b {
		a, b = b, a
	}

	fmt.Println(a, (b-a)/2)
}

package main

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

func main() {
	reader := bufio.NewReaderSize(os.Stdin, 1024*1024)
	line := readLine(reader)
	var a, b int64 = 0, 0
	fmt.Sscanf(line, "%d %d", &a, &b)
	fmt.Println(min(a, b), abs(a-b)/2)
}

func readLine(reader *bufio.Reader) string {
	str, _, err := reader.ReadLine()
	if err == io.EOF {
		return ""
	}

	return strings.TrimRight(string(str), "\r\n")
}

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

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

package main

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

func Read(s *bufio.Reader) string {
    line, _ := s.ReadString('\n')
    return line
}

func Write(s *bufio.Writer, a ...interface{}) {
    fmt.Fprintln(s, a...)
    s.Flush()
}

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

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

    var a, b int
    line, _ := reader.ReadString(' ')
    fmt.Sscanln(line, &a)
    fmt.Sscanln(Read(reader), &b)

    a, b = Max(a, b)

    writer := bufio.NewWriter(os.Stdout)
    Write(writer, b, (a - b) / 2)
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var red, blue int
	fmt.Scan(&red, &blue)
	var array = []int{red, blue}
	sort.Ints(array)
	day1 := array[0]
	day2 := (array[1] - array[0]) / 2
	fmt.Println(day1, day2)
}

package main

import "fmt"

var r, b int

func main() {
	fmt.Scan(&r, &b)
	if r > b {
		fmt.Println(b, " ", (r-b)/2)
	} else {
		fmt.Println(r, " ", (b-r)/2)
	}
}

package main

import "fmt"

func sock1 (a int, b int) int {
	res1 := 0
	if a < b {
		res1 = a
	} else if a > b {
		res1 = b
	} else if b == a {
		res1 = a
	}
	return res1
}
func sock2 (a int, b int) int {
	res2 := 0
	if a < b {
		res2 = (b-a)/2
	} else if a > b {
		res2 = (a-b)/2
	} else if b == a {
		res2 = 0
	}
	return res2
}

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	fmt.Print(sock1(a, b), sock2(a, b))
}

package main
import (
  "fmt"
)
func min(c int, d int) int {
    if d > c {
        return c
    } else {
        return d
    }
}
func main() {
  var a, b int = 0, 0
  fmt.Scanf("%d%d", &a, &b)
  var f int = min(a, b)
  var h int = (a + b - 2 * f) / 2
  fmt.Println(f, h)
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	sp := []int{a, b}
	sort.Ints(sp)
	k := sp[0]
	k2 := (sp[1] - sp[0]) / 2
	fmt.Println(k, k2)
}

package main

import "fmt"

func main() {
	var a, b int
	fmt.Scan(&a, &b)

	if a > b {
		fmt.Printf("%d ", b)
		fmt.Print((a - b) / 2)
	} else {
		fmt.Printf("%d ", a)
		fmt.Print((b - a) / 2)
	}
}

package main

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

var reader *bufio.Reader

func init() {
	stdin := os.Stdin
	// stdin, _ = os.Open("1.in")
	reader = bufio.NewReaderSize(stdin, 1<<20)
}

var a, b int

func main() {
	fmt.Fscan(reader, &a, &b)
	if a > b {
		a, b = b, a
	}
	fmt.Println(a, (b-a)/2)
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var a, b uint8
	fmt.Fscanf(in, "%d %d\n", &a, &b)
	if a > b {
		fmt.Println(b, (a-b)/2)

	} else if a < b {
		fmt.Println(a, (b-a)/2)
	} else if a == b {
		fmt.Println(a, 0)
	}

}

package main

import "fmt"

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	if a < b {
		fmt.Print(a, (b-a)/2)
	} else if a > b {
		fmt.Print(b, (a-b)/2)
	} else if b == a {
		fmt.Print(a, 0)
	}
}

package main

import (
	"fmt"
	"math"
)

func main() {
	var a, b float64
	fmt.Scanf("%f %f", &a, &b)
	firstDay := math.Min(a, b)
	secondDay := (math.Max(a, b) - firstDay) / 2
	fmt.Print(firstDay, " ", int(secondDay))
}

package main

import "fmt"

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

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

func main() {
	var a, b int

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

	max := max(a, b)
	min := min(a, b)

	fmt.Printf("%d %d", min, (max - min) / 2)
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	s := []int{a, b}
	sort.Ints(s)
	m := s[0]
	m2 := (s[1] - s[0]) / 2
	fmt.Println(m, m2)
}

package main

import "fmt"

func main() {
	var a, b int
	fmt.Scanf("%d %d", &a, &b)
	if a < b {
		a, b = b, a
	}
	fmt.Println(b, (a-b)/2)
}

package main

import "fmt"

func main() {
	var a, b int
	fmt.Scanf("%d %d", &a, &b)
	days := a
	if a > b {
		days = b
	}
	fmt.Printf("%d %d\n", days, (a+b)/2-days)
}

package main

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

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

	scanner.Scan()
	ab := scanner.Text()
	var chList []int
	for _, ch := range strings.Split(ab, " ") {
		ch, err := strconv.Atoi(ch)
		if err != nil {
			log.Fatal(err)
		}
		chList = append(chList, ch)
	}
	a, b := chList[0], chList[1]
	var c int
	c = a - b
	if c < 0 {
		b, c, a = -c, a, 0
		b = b / 2
		fmt.Println(c, b)
	} else if c == 0 {
		c = a
		b = 0
		fmt.Println(c, b)
	} else {
		a, c, b = c, b, 0
		a = a / 2
		fmt.Println(c, a)
	}
}

package main

import (
	"fmt"
)

func main() {
	var red, blue, same, different int

	fmt.Scan(&red, &blue)

	if red > blue {
		different = blue
		same = (red - different) / 2
	} else {
		different = red
		same = (blue - different) / 2
	}

	fmt.Println(different, same)
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	mas := []int{a, b}
	sort.Ints(mas)
	r := mas[0]
	r2 := (mas[1] - mas[0]) / 2
	fmt.Println(r, r2)
}

package main

import "fmt"

// https://codeforces.com/problemset/problem/581/A
// A. Vasya the Hipster
// time limit per test
// 1 second
// memory limit per test
// 256 megabytes
// input
// standard input
// output
// standard output

// One day Vasya the Hipster decided to count how many socks he had. It turned out that he had a red socks and b blue socks.

// According to the latest fashion, hipsters should wear the socks of different colors: a red one on the left foot, a blue one on the right foot.

// Every day Vasya puts on new socks in the morning and throws them away before going to bed as he doesn't want to wash them.

// Vasya wonders, what is the maximum number of days when he can dress fashionable and wear different socks, and after that, for how many days he can then wear the same socks until he either runs out of socks or cannot make a single pair from the socks he's got.

// Can you help him?
// Input

// The single line of the input contains two positive integers a and b (1 ≤ a, b ≤ 100) — the number of red and blue socks that Vasya's got.
// Output

// Print two space-separated integers — the maximum number of days when Vasya can wear different socks and the number of days when he can wear the same socks until he either runs out of socks or cannot make a single pair from the socks he's got.

// Keep in mind that at the end of the day Vasya throws away the socks that he's been wearing on that day.

func main() {
	var a, b int
	_, _ = fmt.Scan(&a, &b)

	hipsterDays := intMin(a, b)

	a -= hipsterDays
	b -= hipsterDays

	nonHipsterDays := (a + b) / 2

	fmt.Print(hipsterDays, nonHipsterDays)
}

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

package main

import (
 "fmt"
)

func main() {
 var a, b int
 fmt.Scanf("%d %d", &a, &b)
 if a > b {
  a, b = b, a
 }
 fmt.Print(a, " ")
 fmt.Println((b - a) / 2)
}

package main

import "fmt"

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

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

// https://codeforces.com/problemset/problem/581/A
// комментарии к решению
// Для того, чтобы определить кол-во дней, во время которых Вася
// будет в разноцветных носках необходимо определить наименьшее
// из двух представленных чисел.
// Для того, чтобы определить кол-во дней, во время которых Вася
// будет в одноцветных (оставшихся) носках необходимо оставшиеся
// разбить на пары
func taskSolution(n int, m int) string {
	return fmt.Sprint(min(n, m), abs(n-m)/2)
}

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

	fmt.Println(taskSolution(n, m))
}

// A. Vasya the Hipster
/*
One day Vasya the Hipster decided to count how many socks he had. It turned out
that he had a red socks and b blue socks.

According to the latest fashion, hipsters should wear the socks of different
colors: a red one on the left foot, a blue one on the right foot.

Every day Vasya puts on new socks in the morning and throws them away before
going to bed as he doesn't want to wash them.

Vasya wonders, what is the maximum number of days when he can dress
fashionable and wear different socks, and after that, for how many days he
can then wear the same socks until he either runs out of socks or cannot make
a single pair from the socks he's got.

Can you help him?

Input
The single line of the input contains two positive integers a and b
(1 ≤ a, b ≤ 100) — the number of red and blue socks that Vasya's got.

Output
Print two space-separated integers — the maximum number of days when Vasya can
wear different socks and the number of days when he can wear the same socks
until he either runs out of socks or cannot make a single pair from the socks
he's got.

Keep in mind that at the end of the day Vasya throws away the socks that he's
been wearing on that day.

Examples
Input
3 1

Output
1 1

Input
2 3

Output
2 0

Input
7 3

Output
3 2

Note
In the first sample Vasya can first put on one pair of different socks,
after that he has two red socks left to wear on the second day.
*/
package main

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

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

	o1, o2 := 0, 0
	if a < b {
		o1 = a % b
		o2 = (b - o1) / 2
	} else {
		o1 = b % a
		o2 = (a - o1) / 2
	}
	fmt.Printf("%v %v", o1, o2)
}

package main

import "fmt"

func diff(red int,blue int) (val1 int,val2 int) {
for{
  if (red!=0)&&(blue!=0) {
	  val1++

  }else{
	 // fmt.Printf("the value of red and blue before being passed to same :%d %d\n",red,blue)
   if red>1 {
	   val2=same(red)
	   break
   }else if blue>1{
	   val2=same(blue)
	   break
   }else{
	   break
   }

}
red--;blue--;
}
return
}

func main()  {
	var red,blue int
	fmt.Scan(&red)
	fmt.Scan(&blue)
	val1,val2:=diff(red,blue)
	fmt.Print(val1,val2)
	}

func same(col int)(val2 int){

	for{

		if col>0 {
			val2++
		}else{
			return
		}
		col=col-2
	}

}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var a, b, c, d uint8
	c = 0
	d = 0
	fmt.Fscanf(in, "%d %d\n", &a, &b)
	for i := b; i > 0 && a > 0; i-- {
		a--
		b--
		c++
	}
	d = a / 2
	fmt.Println(c, d)
}

package main

import "fmt"

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	if a < b {
		fmt.Print(a, b/2)
	} else if b < a {
		fmt.Print(b, a/2)
	} else if b == a {
		fmt.Print(a, 0)
	}
}


Let's call a string good if and only if it consists of only two types of letters — 'a' and 'b' and every two consecutive letters are distinct. For example "baba" and "aba" are good strings and "abb" is a bad string.You have $$$a$$$ strings "a", $$$b$$$ strings "b" and $$$c$$$ strings "ab". You want to choose some subset of these strings and concatenate them in any arbitrarily order.What is the length of the longest good string you can obtain this way?

The first line contains three positive integers $$$a$$$, $$$b$$$, $$$c$$$ ($$$1 \leq a, b, c \leq 10^9$$$) — the number of strings "a", "b" and "ab" respectively.

NoteIn the first example the optimal string is "baba".In the second example the optimal string is "abababa".In the third example the optimal string is "bababababab".In the fourth example the optimal string is "ababab".

// A. Another One Bites The Dust
/*
Let's call a string good if and only if it consists of only two types of letters — 'a' and 'b' and every two consecutive letters are distinct. For example "baba" and "aba" are good strings and "abb" is a bad string.

You have 𝑎 strings "a", 𝑏 strings "b" and 𝑐 strings "ab". You want to choose some subset of these strings and concatenate them in any arbitrarily order.

What is the length of the longest good string you can obtain this way?

Input
The first line contains three positive integers 𝑎, 𝑏, 𝑐 (1≤𝑎,𝑏,𝑐≤109) — the number of strings "a", "b" and "ab" respectively.

Output
Print a single number — the maximum possible length of the good string you can obtain.

Examples
Input
1 1 1

Output
4

Input
2 1 2

Output
7

Input
3 5 2

Output
11

Input
2 2 1

Output
6

Input
1000000000 1000000000 1000000000

Output
4000000000

Note
In the first example the optimal string is "baba".

In the second example the optimal string is "abababa".

In the third example the optimal string is "bababababab".

In the fourth example the optimal string is "ababab".
*/
package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	input, _ := reader.ReadString('\n')
	arr := strings.Split(strings.TrimSpace(input), " ")
	a, _ := strconv.ParseInt(arr[0], 10, 64)
	b, _ := strconv.ParseInt(arr[1], 10, 64)
	c, _ := strconv.ParseInt(arr[2], 10, 64)

	total := c * 2
	if a > b {
		total += (2 * b) + 1
	} else if a < b {
		total += (2 * a) + 1
	} else {
		total += 2 * a
	}
	fmt.Print(total)
}

package main

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

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

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

package main

import (
	"fmt"
)

func queen(x int64, y int64, z int64) int64 {
	res := z * 2
	if x == y {
		res += x * 2
		return res
	} else if x > y {
		res += y * 2 + 1
		return res
	} else {
		res += x * 2 + 1
		return res
	}
}

func main() {
	var a int64
	var b int64
	var c int64
	fmt.Scan(&a, &b, &c)
	fmt.Println(queen(a, b, c))
}

package main

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

var reader = bufio.NewReader(os.Stdin)

func main() {
	in := readString()
	parts := strings.Split(in, " ")
	a := Atoi(parts[0])
	b := Atoi(parts[1])
	ab := Atoi(parts[2])

	aabb := Min(a, b)
	res := ab*2 + aabb*2
	if Abs(a-b) != 0 {
		res++
	}
	fmt.Println(res)
}

func readInteger() int64 {
	s, _, _ := reader.ReadLine()
	n, _ := strconv.ParseInt(string(s), 0, 64)
	return n
}

func readString() string {
	s, _, _ := reader.ReadLine()
	return string(s)
}

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

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

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

func Atoi(s string) int64 {
	i, _ := strconv.ParseInt(s, 10, 64)
	return i
}

package main

import "fmt"

func solve(a, b, c uint64) uint64 {
	res := a
	if b < a {
		res = b
	}

	res += c
	res *= 2

	if a != b {
		res++
	}

	return res
}

func main() {
	var a, b, c uint64

	fmt.Scan(&a, &b, &c)

	res := solve(a, b, c)
	fmt.Println(res)
}

package main

import (
	"fmt"
)

func solve(first int64, second int64, third int64) int64 {
	ans := third * 2
	if first == second {
		ans += first * 2
		return ans
	} else if first > second {
		ans += second * 2 + 1
		return ans
	} else {
		ans += first * 2 + 1
		return ans
	}
}

func main() {
	var a, b, c int64
	fmt.Scan(&a, &b, &c)
	fmt.Println(solve(a, b, c))
}

package main
import "fmt"
func main() {
	var a, b, c, res uint64
	fmt.Scan(&a, &b, &c)
    res = a
	if b < a {
	    res = b
	}
	res = res + c
	res = res * 2
	if a != b {
		res++
	}
	fmt.Println(res)
}

package main

import (
	"fmt"
)

func fun(x int64, y int64, z int64) int64 {
	ans := z * 2
	if x == y {
		ans += x * 2
		return ans
	} else if x > y {
		ans += y * 2 + 1
		return ans
	} else {
		ans += x * 2 + 1
		return ans
	}
}

func main() {
	var a, b, c int64
	fmt.Scan(&a, &b, &c)
	fmt.Println(fun(a, b, c))
}

package main

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

func main()  {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var a , b ,c int
	fmt.Fscan(in,&a,&b,&c)
	//3 2
	var total int64
	total = int64(min1(a,b) + c) * 2
	if(a != b){
		total += 1
	}
	fmt.Fprint(out,int64(total))

}
func min1(x1,x2 int) int  {
	if(x1 < x2){
		return x1
	}else{
		return x2
	}
}

// A. Another One Bites The Dust
/*
Let's call a string good if and only if it consists of only two types of letters — 'a' and 'b' and every two consecutive letters are distinct. For example "baba" and "aba" are good strings and "abb" is a bad string.

You have 𝑎 strings "a", 𝑏 strings "b" and 𝑐 strings "ab". You want to choose some subset of these strings and concatenate them in any arbitrarily order.

What is the length of the longest good string you can obtain this way?

Input
The first line contains three positive integers 𝑎, 𝑏, 𝑐 (1≤𝑎,𝑏,𝑐≤109) — the number of strings "a", "b" and "ab" respectively.

Output
Print a single number — the maximum possible length of the good string you can obtain.

Examples
Input
1 1 1

Output
4

Input
2 1 2

Output
7

Input
3 5 2

Output
11

Input
2 2 1

Output
6

Input
1000000000 1000000000 1000000000

Output
4000000000

Note
In the first example the optimal string is "baba".

In the second example the optimal string is "abababa".

In the third example the optimal string is "bababababab".

In the fourth example the optimal string is "ababab".
*/
package main

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

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

	total := c * 2
	if a > b {
		total += (2 * b) + 1
	} else if a < b {
		total += (2 * a) + 1
	} else {
		total += 2 * a
	}
	fmt.Print(total)
}

// A. Another One Bites The Dust
/*
Let's call a string good if and only if it consists of only two types of letters — 'a' and 'b' and every two consecutive letters are distinct. For example "baba" and "aba" are good strings and "abb" is a bad string.

You have 𝑎 strings "a", 𝑏 strings "b" and 𝑐 strings "ab". You want to choose some subset of these strings and concatenate them in any arbitrarily order.

What is the length of the longest good string you can obtain this way?

Input
The first line contains three positive integers 𝑎, 𝑏, 𝑐 (1≤𝑎,𝑏,𝑐≤109) — the number of strings "a", "b" and "ab" respectively.

Output
Print a single number — the maximum possible length of the good string you can obtain.

Examples
Input
1 1 1

Output
4

Input
2 1 2

Output
7

Input
3 5 2

Output
11

Input
2 2 1

Output
6

Input
1000000000 1000000000 1000000000

Output
4000000000

Note
In the first example the optimal string is "baba".

In the second example the optimal string is "abababa".

In the third example the optimal string is "bababababab".

In the fourth example the optimal string is "ababab".
*/
package main

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

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

	total := c * 2
	if a > b {
		total += 2*b + 1
	} else if a < b {
		total += 2*a + 1
	} else {
		total += 2 * a
	}
	fmt.Print(total)
}

package main

import (
	"fmt"
)

func queen(x int, y int, z int) int {
	res := z * 2
	if x == y {
		res += x * 2
		return res
	} else if x > y {
		res += y * 2 + 1
		return res
	} else {
		res += x * 2 + 1
		return res
	}
}

func main() {
	var a int
	var b int
	var c int
	fmt.Scan(&a, &b, &c)
	fmt.Println(queen(a, b, c))
}

package main

import (
	"fmt"
)

func queen(x int, y int, z int) int {
	res := z * 2
	if x == y {
		res += x * 2
		return res
	}
	if x > y {
		res += y * 2 + 1
		return res
	}
	if x < y {
		res += x * 2 + 1
		return res
	} else {
		return res
	}
}

func main() {
	var a int
	var b int
	var c int
	fmt.Scan(&a, &b, &c)
	fmt.Println(queen(a, b, c))
}

package main

import "fmt"

func solve(a, b, c uint64) uint64 {
	res := a
	if b < a {
		res = b
	}

	return 2*res + 2*c
}

func main() {
	var a, b, c uint64

	fmt.Scan(&a, &b, &c)

	res := solve(a, b, c)
	fmt.Println(res)
}

package main

import (
	"fmt"
)

func solve(first int, second int, third int) int {
	ans := third * 2
	if first == second {
		ans += first * 2
		return ans
	} else if first > second {
		ans += second * 2 + 1
		return ans
	} else {
		ans += first * 2 + 1
		return ans
	}
}

func main() {
	var a, b, c int
	fmt.Scan(&a, &b, &c)
	fmt.Println(solve(a, b, c))
}

package main

import (
	"fmt"
)

func fun(x int, y int, z int) int {
	ans := z * 2
	if x == y {
		ans += x * 2
		return ans
	} else if x > y {
		ans += y * 2 + 1
		return ans
	} else {
		ans += x * 2 + 1
		return ans
	}
}

func main() {
	var a, b, c int
	fmt.Scan(&a, &b, &c)
	fmt.Println(fun(a, b, c))
}

package main

import (
	"fmt"
)

func fun(x int, y int, z int) int {
	ans:=z * 2
	if x == y {
		ans += x * 2
		return ans
	} else if x > y {
		ans += y * 2 + 1
		return ans
	} else {
		ans += x * 2 + 1
		return ans
	}
}

func main() {
	var a, b, c int
	fmt.Scan(&a, &b, &c)
	fmt.Println(fun(a, b, c))
}

package main

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

func main()  {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var a , b ,c int
	fmt.Fscan(in,&a,&b,&c)
	//3 2
	total := (min1(a,b) + c) * 2
	if(a != b){
		total += 1
	}
	fmt.Fprint(out,int64(total))

}
func min1(x1,x2 int) int  {
	if(x1 < x2){
		return x1
	}else{
		return x2
	}
}

package main

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

func main()  {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var a , b ,c int
	fmt.Fscan(in,&a,&b,&c)
	//3 2
	total := (min1(a,b) + c) * 2
	if(a != b){
		total += 1
	}
	fmt.Fprint(out,total)

}
func min1(x1,x2 int) int  {
	if(x1 < x2){
		return x1
	}else{
		return x2
	}
}

package main

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

func main()  {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var a , b ,c int
	fmt.Fscan(in,&a,&b,&c)
	//3 2
	total := min1(a,b) + c * 2
	if(a != b){
		total += 1
	}
	fmt.Fprint(out,total)

}
func min1(x1,x2 int) int  {
	if(x1 < x2){
		return x1
	}else{
		return x2
	}
}

package main

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

func main()  {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var a , b ,c int
	fmt.Fscan(in,&a,&b,&c)
	//3 2
	fmt.Fprint(out,int64(a + b + c * 2))

}
func min1(x1,x2 int) int  {
	if(x1 < x2){
		return x1
	}else{
		return x2
	}
}


Recently Vasya found a golden ticket — a sequence which consists of $$$n$$$ digits $$$a_1a_2\dots a_n$$$. Vasya considers a ticket to be lucky if it can be divided into two or more non-intersecting segments with equal sums. For example, ticket $$$350178$$$ is lucky since it can be divided into three segments $$$350$$$, $$$17$$$ and $$$8$$$: $$$3+5+0=1+7=8$$$. Note that each digit of sequence should belong to exactly one segment.Help Vasya! Tell him if the golden ticket he found is lucky or not.

The first line contains one integer $$$n$$$ ($$$2 \le n \le 100$$$) — the number of digits in the ticket. The second line contains $$$n$$$ digits $$$a_1 a_2 \dots a_n$$$ ($$$0 \le a_i \le 9$$$) — the golden ticket. Digits are printed without spaces.

If the golden ticket is lucky then print "YES", otherwise print "NO" (both case insensitive).

NoteIn the first example the ticket can be divided into $$$7$$$, $$$34$$$ and $$$52$$$: $$$7=3+4=5+2$$$.In the second example it is impossible to divide ticket into segments with equal sum.

package main

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

func main() {

	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	scanner.Scan()
	ans := strings.Split(scanner.Text(), "")

	total := 0
	for i := 0; i < len(ans)-1; i++ {
		a, _ := strconv.Atoi(ans[i])
		total += a
		if findGolden(total, ans[i+1:]) {
			fmt.Print("YES")
			return
		}
	}
	fmt.Print("NO")
}

func findGolden(cut int, rem []string) bool {
	total := 0
	for i := 0; i < len(rem); i++ {
		a, _ := strconv.Atoi(rem[i])

		total += a
		if total > cut {
			return false
		}
		if total == cut {
			return i+1 == len(rem) || findGolden(cut, rem[i+1:]) || findGolden(0, rem[i+1:])

		}
	}
	return false
}

package main

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

// github.com/EndlessCheng/codeforces-go
func CF1030C(_r io.Reader, out io.Writer) {
	var n, s int
	var a []byte
	Fscan(bufio.NewReader(_r), &n, &a)
o:
	for i, v := range a[:n-1] {
		s += int(v & 15)
		for j := i + 1; j < n; {
			s2 := int(a[j] & 15)
			for j++; j < n && (s2 < s || s2 == s && a[j] == '0'); j++ {
				s2 += int(a[j] & 15)
			}
			if s2 != s {
				continue o
			}
		}
		Fprintln(out, "YES")
		return
	}
	Fprintln(out, "NO")
}

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

package main

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

func main() {

	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	scanner.Scan()
	ans := strings.Split(scanner.Text(), "")

	total := 0
	for i := 0; i < len(ans)-1; i++ {
		a, _ := strconv.Atoi(ans[i])
		total += a
		if findGolden(total, ans[i+1:]) {
			fmt.Print("YES")
			return
		}
	}
	fmt.Print("NO")
}

func findGolden(cut int, rem []string) bool {
	total := 0
	for i := 0; i < len(rem); i++ {
		a, _ := strconv.Atoi(rem[i])

		total += a
		if total > cut {
			return false
		}
		if total == cut {
			return i+1 == len(rem) || findGolden(cut, rem[i+1:])

		}
	}
	return false
}


Kolya got string s for his birthday, the string consists of small English letters. He immediately added k more characters to the right of the string.Then Borya came and said that the new string contained a tandem repeat of length l as a substring. How large could l be?See notes for definition of a tandem repeat.

The first line contains s (1 ≤ |s| ≤ 200). This string contains only small English letters. The second line contains number k (1 ≤ k ≤ 200) — the number of the added characters.

Print a single number — the maximum length of the tandem repeat that could have occurred in the new string.

NoteA tandem repeat of length 2n is string s, where for any position i (1 ≤ i ≤ n) the following condition fulfills: si = si + n.In the first sample Kolya could obtain a string aabaab, in the second — aaabbbbbb, in the third — abracadabrabracadabra.

package main

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

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

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

	s, k := next(), nextInt()

	if k >= len(s) {
		println((len(s) + k) / 2 * 2)
		return
	}

	s += strings.Repeat(".", k)
	result := k * 2
	// length := 0

	for i := 0; i < len(s); i++ {
		for j := i + 1; j <= len(s); j++ {
			str := s[i:j]
			if len(str) % 2 == 0 && len(str) > result && isTandemRepeat(str) {
				result = len(str)
				// println(str, result)
			}
		}
	}

	// println(s, len(s))
	println(result)
}

func isTandemRepeat(s string) bool {
	if len(s) % 2 == 1 {
		return false
	}

	for i := 0; i < len(s) / 2; i++ {
		if s[i] != s[i + len(s) / 2] && s[i + len(s) / 2] != '.' {
			return false
		}
	}

	return true
}

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

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

package main

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

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

	s := strings.TrimSpace(line)
	stringLength := len(s)

	line, _ = reader.ReadString('\n')
	var k int

	fmt.Sscanf(line, "%d", &k)

	newString := make([]rune, stringLength+k)
	copy(newString, []rune(s))

	bestRepeat := 0
	for i := 0; i < stringLength+k; i++ {
		currentRepeat := 0
		for currentRepeat <= (stringLength+k-i)/2 {
			tandemRepeat := true
			for j := i; j < i+currentRepeat; j++ {
				if newString[j+currentRepeat] != newString[j] && newString[j+currentRepeat] != 0 {
					tandemRepeat = false
					break
				}
			}
			if tandemRepeat && currentRepeat > bestRepeat {
				bestRepeat = currentRepeat
			}
			currentRepeat++
		}
	}
	fmt.Println(2*bestRepeat - 0)
}

package main

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

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

	s := strings.TrimSpace(line)
	stringLength := len(s)

	line, _ = reader.ReadString('\n')
	var k int

	fmt.Sscanf(line, "%d", &k)

	newString := make([]rune, stringLength+k)
	copy(newString, []rune(s))

	bestRepeat := 0
	for i := 0; i < stringLength+k; i++ {
		for currentRepeat := 0; currentRepeat <= (stringLength+k-i)/2; currentRepeat++ {
			tandemRepeat := true
			for j := i; j < i+currentRepeat; j++ {
				if newString[j+currentRepeat] != newString[j] && newString[j+currentRepeat] != 0 {
					tandemRepeat = false
					break
				}
			}
			if tandemRepeat && currentRepeat > bestRepeat {
				bestRepeat = currentRepeat
			}

		}
	}
	fmt.Println(2*bestRepeat - 0)
}

package main

import (
  "fmt"
)

func Judge(line *string, n, k, l int) bool {
  for i := 0; i <= n+k-l*2; i++ {
    var flag bool = true
    for j := 0; j < l; j++ {
      if i+j+l < n && (*line)[i+j] != (*line)[i+j+l] {
        flag = false
        break
      }
    }
    if flag {
      return true
    }
  }
  return false
}

func main() {
  var line string
  var k int
  fmt.Scan(&line, &k)
  var n int = len(line)
  var res int = 0
  for i := (n + k) / 2; i > 0; i-- {
    if Judge(&line, n, k, i) {
      res = i * 2
      break
    }
  }
  fmt.Println(res)
}

package main

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

func main() {
	sc := NewScanner(os.Stdin)
	s, _ := sc.NextLine()
	m := len(s)
	k, _ := sc.NextLong()
	n := m + int(k)

	isTandemRepeat := func(i, j int) bool {
		res := true
		for k := 0; i+j+k < m && k < j; k++ {
			if s[i+k] != s[i+j+k] {
				res = false
				break
			}
		}
		return res
	}
	res := 0
	for i := 0; i < n; i++ {
		for j := 1; i+2*j <= n; j++ {
			if isTandemRepeat(i, j) {
				res = maxInt(res, j)
			}
		}
	}
	fmt.Println(res * 2)
}

////////////////////////////////////////////////////////////////
//
//  gojus: retrieved from https://github.com/tnoda/gojus
//

// NewScanner returns a new Scanner to read from r.
func NewScanner(rdr io.Reader) *Scanner {
	sc := Scanner{bufio.NewScanner(rdr), 10}
	return &sc
}

// Errors returned by Scanner
var (
	ErrNoSuchElement = errors.New("gojus.Scanner: input is exhausted.")
)

// Scanner provides a similar interface to the java.util.Scaner's one.
type Scanner struct {
	*bufio.Scanner
	radix int
}

// Next scans and returns the next token of the input.
func (sc *Scanner) Next() (string, error) {
	sc.Split(bufio.ScanWords)
	if !sc.Scan() {
		return "", ErrNoSuchElement
	}
	return sc.Text(), nil
}

// UseRadix sets the scanner's default radix to the specified one.
func (sc *Scanner) UseRadix(radix int) *Scanner {
	sc.radix = radix
	return sc
}

func (sc *Scanner) nextLong() (int64, error) {
	t, e := sc.Next()
	if e != nil {
		return 0, e
	}
	return strconv.ParseInt(t, sc.radix, 64)
}

// NextLong scans and returns the next token of the input as an int64.
func (sc *Scanner) NextLong() (int64, error) {
	return sc.nextLong()
}

// NextDouble scans and returns the next token of the input as a float64
func (sc *Scanner) NextDouble() (float64, error) {
	t, e := sc.Next()
	if e != nil {
		return 0, e
	}
	return strconv.ParseFloat(t, 64)
}

// NextLine advances this scanner past the current line and returns
// the input that was skipped.
func (sc *Scanner) NextLine() (string, error) {
	sc.Split(bufio.ScanLines)
	if !sc.Scan() {
		return "", ErrNoSuchElement
	}
	return sc.Text(), nil
}

////////////////////////////////////////////////////////////////
//
// int/int64 utilities
//
func minInt(a, b int) int {
	if b < a {
		return b
	}
	return a
}

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

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

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

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

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

// 443B
package main

import (
	"fmt"
)

func count(s *string, n, k, l int) bool {
	for i := 0; i <= n+k-l*2; i++ {
		stat := true
		for j := 0; j < l; j++ {
			if i+j+l < n && (*s)[i+j] != (*s)[i+j+l] {
				stat = false
				break
			}
		}
		if stat {
			return true
		}
	}
	return false
}

func main() {
	var s string
	var k int
	fmt.Scan(&s, &k)
	n := len(s)
	ans := 0
	for i := (n + k) / 2; i > 0; i-- {
		if count(&s, n, k, i) {
			ans = i * 2
			break
		}
	}
	fmt.Println(ans)
}

package main

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

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

	s := strings.TrimSpace(line)
	stringLength := len(s)

	line, _ = reader.ReadString('\n')
	var k int

	fmt.Sscanf(line, "%d", &k)

	newString := make([]rune, stringLength+k)
	copy(newString, []rune(s))

	bestRepeat := 0
	for i := 0; i < stringLength+k; i++ {
		currentRepeat := 0
		for i+currentRepeat < stringLength+k && currentRepeat <= (stringLength+k-i)/2 {
			if newString[i+currentRepeat] == newString[i] || newString[i+currentRepeat] == 0 {
				if currentRepeat > bestRepeat {
					bestRepeat = currentRepeat
				}
			}
			currentRepeat++
		}
	}
	fmt.Println(2 * (bestRepeat - 0))
}

package main

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

func main() {
	sc := NewScanner(os.Stdin)
	s, _ := sc.NextLine()
	m := len(s)
	k, _ := sc.NextLong()
	n := m + int(k)

	isTandemRepeat := func(i, j int) bool {
		res := true
		for k := 0; i+2*k < m; k++ {
			if s[i+k] != s[i+2*k] {
				res = false
				break
			}
		}
		return res
	}
	res := 0
	for i := 0; i < n; i++ {
		for j := 1; i+2*j <= n; j++ {
			if isTandemRepeat(i, j) {
				res = maxInt(res, j)
			}
		}
	}
	fmt.Println(res * 2)
}

////////////////////////////////////////////////////////////////
//
//  gojus: retrieved from https://github.com/tnoda/gojus
//

// NewScanner returns a new Scanner to read from r.
func NewScanner(rdr io.Reader) *Scanner {
	sc := Scanner{bufio.NewScanner(rdr), 10}
	return &sc
}

// Errors returned by Scanner
var (
	ErrNoSuchElement = errors.New("gojus.Scanner: input is exhausted.")
)

// Scanner provides a similar interface to the java.util.Scaner's one.
type Scanner struct {
	*bufio.Scanner
	radix int
}

// Next scans and returns the next token of the input.
func (sc *Scanner) Next() (string, error) {
	sc.Split(bufio.ScanWords)
	if !sc.Scan() {
		return "", ErrNoSuchElement
	}
	return sc.Text(), nil
}

// UseRadix sets the scanner's default radix to the specified one.
func (sc *Scanner) UseRadix(radix int) *Scanner {
	sc.radix = radix
	return sc
}

func (sc *Scanner) nextLong() (int64, error) {
	t, e := sc.Next()
	if e != nil {
		return 0, e
	}
	return strconv.ParseInt(t, sc.radix, 64)
}

// NextLong scans and returns the next token of the input as an int64.
func (sc *Scanner) NextLong() (int64, error) {
	return sc.nextLong()
}

// NextDouble scans and returns the next token of the input as a float64
func (sc *Scanner) NextDouble() (float64, error) {
	t, e := sc.Next()
	if e != nil {
		return 0, e
	}
	return strconv.ParseFloat(t, 64)
}

// NextLine advances this scanner past the current line and returns
// the input that was skipped.
func (sc *Scanner) NextLine() (string, error) {
	sc.Split(bufio.ScanLines)
	if !sc.Scan() {
		return "", ErrNoSuchElement
	}
	return sc.Text(), nil
}

////////////////////////////////////////////////////////////////
//
// int/int64 utilities
//
func minInt(a, b int) int {
	if b < a {
		return b
	}
	return a
}

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

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

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

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

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

// 443B
package main

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

func main() {
	var st string
	var ans, i, j, k, n, length, flag, max int
	in := bufio.NewScanner(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	in.Split(bufio.ScanWords)
	in.Scan()
	st = in.Text()
	length = len(st)
	fmt.Scan(&n)
	ans = n + length
	max = 0
	for i = 0; i < ans; i++ {
		for j = 0; i+2*j-1 < ans; j++ {
			flag = 0
			for k = i; k < i+j; k++ {
				if k >= length || j+k >= length || st[k] == st[j+k] {
					continue
				} else {
					flag = 1
					break
				}
			}
			if flag == 0 {
				if 2*j > max {
					max = 2 * j
				}
			}
			max = 2 * j
		}
	}
	fmt.Fprintln(out, max)
	out.Flush()
}

// 443B
package main

import (
	"fmt"
)

func main() {
	var st [500]string
	var ans, i, j, k, n, length, flag, max int
	fmt.Scan(&st)
	length = len(st)
	fmt.Scan(&n)
	ans = n + length
	max = 0
	for i = 0; i < ans; i++ {
		for j = 0; i+2*j-1 < ans; j++ {
flag = 0
			for k = i; k < i+j; k++ {
				if k >= length || j+k >= length || st[k] == st[j+k] {
					continue
				} else {
					flag = 1
					break
				}
			}
			if flag == 0 {
				if 2*j > max {
					max = 2 * j
				}
			}
			max = 2 * j
		}
	}
	fmt.Println(max)
}