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 C++14 (Clang 3.8.0) (judge verdict: Wrong Answer)

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <string>
#include <queue>
#include <unordered_map>
#include <iterator>
#include <stack>
#include <unordered_set>
#include <iomanip>
#include <ctime>
#include <cstring>
#include <bitset>

#include <random>

using namespace std;
void dout() { cerr << endl; }
typedef long long ll;
template <typename Head, typename... Tail>
void dout(Head H, Tail... T) {
    cerr << H << ' ';
    dout(T...);
}

using ll = long long;
using pii = pair<ll, ll>;
using ld = long double;
using pll = pair<long long, long long>;

void precalc() {}

//#define solvsh
//#define multi
#ifdef solvsh

const int MAXN = 5e5 + 10;

vector<int> vals;

int n;

bool check_bit(int bt) {
    vector<int> crr;
    int mod = 1 << (bt + 1);

    for (int i = 0; i < n; ++i) {
        crr.push_back(vals[i] % mod);
    }

    ll cnt = 0;

    sort(crr.begin(), crr.end());

    for (int i = 0; i < n; ++ i){

        int min = 0;
        int max = 0;

        int left = -1;
        int right = n;

        while (right - left > 1){
            int mid = (left + right) >> 1;

            if (crr[i] + crr[mid])

        }


        cnt += max - min + 1;

    }

    return cnt % 2 == 1;
}

void solve() {
    cin >> n;

    for (int i = 0; i < n; ++i) {
        int curr;
        cin >> curr;
        vals.push_back(curr);
    }

    int answr = 0;

    for (int k = 0; k < 25; ++k) {
        if (check_bit(k)) {
            answr |= 1 << k;
        }
    }

    cout << answr << "\n";
}

#else


const int MAXN = 2e5 + 19;
vector<int> g[MAXN];

int colors[MAXN];


void dfs(int vertex, int color, int par = -1){
    colors[vertex] = color;
    for (auto out : g[vertex]){
        if (out == par)
            continue;

        dfs(out, 1- color, vertex);
    }
}

int answr[MAXN];

void solve() {

    int n;
    cin >> n;

    for (int i = 0; i < n - 1; ++i) {
        int u, v;
        cin >> u >> v;

        g[u].push_back(v);
        g[v].push_back(u);
    }


    dfs(1, 0);

    int last1 = 1;
    int last2 = 2;
    int last3 = 3;


    for (int i = 1; i <= n; ++i) {
        if (colors[i] == 0) {
            if (last1 <= n) {
                answr[i] = last1;
                last1 += 3;
            } else {
                answr[i] = last3;
                last3 += 3;
            }
        }

        if (colors[i] == 1) {
            if (last2 <= n) {
                answr[i] = last2;
                last2 += 3;
            } else {
                answr[i] = last3;
                last3 += 3;
            }
        }
    }

    for (int i = 1; i <= n; ++i)
        cout << answr[i] << " ";
}

#endif

void multisolve() {
    int t;
    cin >> t;

    while (t--)
        solve();
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);
    cout << fixed << setprecision(20);

    precalc();

#ifdef multi
    multisolve();
#else
    solve();
#endif

#ifdef LOCAL
    //cout << '\n' << (double)clock() / CLOCKS_PER_SEC << '\n';
#endif
}