Problem:
Score : 100 points

Problem Statement

A Hitachi string is a concatenation of one or more copies of the string hi.

For example, hi and hihi are Hitachi strings, while ha and hii are not.

Given a string S, determine whether S is a Hitachi string.

Constraints

The length of S is between 1 and 10 (inclusive).

S is a string consisting of lowercase English letters.

Input

Input is given from Standard Input in the following format:

S

Output

If S is a Hitachi string, print Yes; otherwise, print No.

Sample Input 1

hihi

Sample Output 1

Yes

hihi is the concatenation of two copies of hi, so it is a Hitachi string.

Sample Input 2

hi

Sample Output 2

Yes

Sample Input 3

ha

Sample Output 3

No

Solution in Kotlin (1.0.0) (judge verdict: Runtime Error)

import java.io.PrintWriter
import java.util.*


@JvmField val INPUT = System.`in`
@JvmField val OUTPUT = System.out

@JvmField val _reader = INPUT.bufferedReader()
fun readLine(): String? = _reader.readLine()
fun readLn() = _reader.readLine()!!
@JvmField var _tokenizer: StringTokenizer = StringTokenizer("")
fun read(): String {
    while (_tokenizer.hasMoreTokens().not()) _tokenizer = StringTokenizer(_reader.readLine() ?: return "", " ")
    return _tokenizer.nextToken()
}
fun readInt() = read().toInt()
fun readDouble() = read().toDouble()
fun readLong() = read().toLong()
fun readStrings(n: Int) = Array(n) { read() }
fun readLines(n: Int) = Array(n) { readLn() }
fun readInts(n: Int) = Array(n) { read().toInt() }
fun readIntArray(n: Int) = IntArray(n) { read().toInt() }
fun readDoubles(n: Int) = Array(n) { read().toDouble() }
fun readDoubleArray(n: Int) = DoubleArray(n) { read().toDouble() }
fun readLongs(n: Int) = Array(n) { read().toLong() }
fun readLongArray(n: Int) = LongArray(n) { read().toLong() }

@JvmField val _writer = PrintWriter(OUTPUT, false)
inline fun output(block: PrintWriter.() -> Unit) { _writer.apply(block).flush() }

fun getMatrix(bits: Int, n: Int, m: Int): Array<Array<Int>> {
    val mat = Array(n) { Array(m) {0} }
    for (i in 0 until n) {
        for (j in 0 until m) {
            val id = (i * m + j)
            if (bits.shr(id).and(1) == 1) {
                mat[i][j] = 1
            }
        }
    }
    return mat
}

fun getOdness(mat: Array<Array<Int>>): Int {
    var odds = 0
    for (i1 in 0 until mat.size) {
        for (i2 in i1 until mat.size) {
            for (j1 in 0 until mat[i1].size) {
                for (j2 in 0 until mat[i2].size) {
                    var sm = 0
                    for (i in i1..i2) {
                        for (j in j1..j2) {
                            sm += mat[i][j]
                        }
                    }
                    if (sm % 2 == 1) {
                        odds++
                    }
                }
            }
        }
    }
    return odds
}

fun getMatrix(n: Int) : Array<IntArray> {
    if (n == 1) {
        return Array(1) { IntArray(1) {1} }
    }
    val ref = getMatrix(n - 1)
    val mt = Array(1.shl(n) - 1) { IntArray(1.shl(n) - 1) { 0 } }
    for (i in 0 until ref.size) {
        for (j in 0 until ref[i].size) {
            mt[i][j] = ref[i][j]
            mt[1.shl(n-1) + i][j] = ref[i][j]
            mt[i][1.shl(n-1) + j] = ref[i][j]
            mt[1.shl(n-1) + i][1.shl(n-1) + j] = ref[i][j]
        }
    }
    mt[1.shl(n-1) - 1][1.shl(n-1) - 1] = 1
    return mt
}

fun printMatrix(mt: Array<IntArray>) {
    for (i in 0 until mt.size) {
        for (j in 0 until mt[i].size) {
            print("${mt[i][j]} ")
        }
        println()
    }
}

fun main(args: Array<String>) {
    output {
        val (N, M) = readInts(2)
        val ans = getMatrix(Math.max(N, M))
        for (i in 0 until (1.shl(N) - 1)) {
            for (j in 0 until (1.shl(M) - 1)) {
                print("${ans[i][j]}")
            }
            println()
        }
    }

}

/*
1 1 5 -> 3
1 5 1 -> 2
5 1 1 -> 1
 */