Harryxun/stf_run huggingface dataset:
import numpy as np
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

from numba import njit


def getInputs():
    D = int(readline())
    CS = np.array(read().split(), np.int32)
    C = CS[:26]
    S = CS[26:].reshape((-1, 26))
    return D, C, S


def _compute_score(output):
    last = np.zeros((26, ))
    for d in range(len(output)):
        last[output[d]] = d + 1
        score = S[d][output[d]] - np.sum(C * (d + 1 - last))

    return score


def solve():
    output = []
    #SCORE = 0
    for _ in range(D):
        max_score = float('-inf')
        best_i = 0
        for i in range(26):
            output.append(i)
            score = _compute_score(output)
            if max_score < score:
                max_score = score
                best_i = i + 1
            output.pop()
        output.append(best_i)
        #SCORE += max_score
        #print(SCORE)

    return output


if __name__ == "__main__":
    D, C, S = getInputs()
    ans = solve()
    print('\n'.join(map(str, ans)))

### FIXED CODE ###

import numpy as np
import sys
read = sys.stdin.read


D = int(input())
CS = np.array(read().split(), np.int32)
C = CS[:26]
S = CS[26:].reshape((-1, 26))
del CS

last = np.zeros((26, ))
ans = []

def getContestType_at_d(d):
    s = -10000000
    for i in range(26):
        tmp = S[d][i] - np.sum(C * (d - last)) + C[i] * (d - last[i])
        if s < tmp:
            s = tmp
            t = i

    last[t] += 1

    return t + 1


for d in range(D):
    ans.append(getContestType_at_d(d))


print('\n'.join(map(str, ans)))
s = input()
K = int(input())
head = [h for h in s]

head = set(head)
head = list(head)
head.sort()

cnt = 0
ans = []
idx = 0
while cnt < K:
    for i in range(len(s)):
        if s[i] == head[idx]:
            for k in range(i+1, len(s)+1):
                ans.append(s[i:k])
                cnt += 1
    idx += 1
ans = set(ans)
ans = list(ans)
ans.sort()
print(ans[K-1])

### FIXED CODE ###

s = input()
K = int(input())
head = [h for h in s]

head = set(head)
head = list(head)
head.sort()

cnt = 0
ans = []
idx = 0
while cnt < K:
    for i in range(len(s)):
        if s[i] == head[idx]:
            for k in range(i+1, min(len(s)+1, i+6)):
                ans.append(s[i:k])
        ans = set(ans)
        ans = list(ans)
        cnt = len(ans)
    idx += 1
ans = set(ans)
ans = list(ans)
ans.sort()
print(ans[K-1])
o=list(input())
m=list(input())
ans=' '
for i in range(len(o)):
            
                        ans +=o[i]
                        ans +=m[i]
                        
print(ans)         





### FIXED CODE ###

o=list(input())
m=list(input())

ans=[]
for i in range(len(o)-1):
            ans.append(o[i])
            ans.append(m[i])
ans.append(o[-1])
if len(o)==len(m):
            ans.append(m[-1])
print("".join(ans))
import numpy as np
import copy

N = int(input())
A = [int(i) for i in input().split()]
A = list(set(A))

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a  
if N<=2:
    print(max(A))
else:
    gcds = []
    for n in range(N):
        if n == 0:
            lgcd = None
        else:
            lgcd = A[0]
            for i in range(n):
                lgcd = gcd(lgcd,A[i])
        if n == N-1:
            rgcd = None
        else:
            rgcd = A[n+1]
            for i in range(n+1,N):
                rgcd = gcd(rgcd,A[i])
        if lgcd == None:
            gcds.append(rgcd)
        elif rgcd == None:
            gcds.append(lgcd)
        else:
            gcds.append(gcd(lgcd,rgcd))
print(max(gcds))

### FIXED CODE ###

N = int(input())
A = [int(i) for i in input().split()]
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a  
lgcds = [A[0]]
rgcds = [A[N-1]]
for n in range(N-2):
    lgcds.append(gcd(lgcds[-1],A[n+1]))
    rgcds.append(gcd(rgcds[-1],A[-2-n]))
gcds = [lgcds[-1],rgcds[-1]]
for i in range(N-2):
    gcds.append(gcd(lgcds[i],rgcds[-2-i]))
print(max(gcds))
n, m = map(int,input().split())
s = list(list(map(int, input().split())) for _ in range(M)) 
p = list(map(int,input().split()))
ans = 0
for i in range(1<<n):
    # 全switch(n)のon/offパターン数
    sw = [False]*M
    # 各電球の点灯リストを作成
    for j in range(M):
        # 各電球について
        cnt = 0
        for k in range(1,len(s[j])):
            if i>>s[j][k]-1&1:
                cnt += 1
        if cnt%2==p[j]:
            sw[j]=True
    if all(sw):
        ans+=1
print(ans)

### FIXED CODE ###

n, m = map(int,input().split())
s = list(list(map(int, input().split())) for _ in range(m)) 
p = list(map(int,input().split()))
ans = 0
for i in range(1<<n):
    # 全switch(n)のon/offパターン数
    sw = [False]*m
    # 各電球の点灯リストを作成
    for j in range(m):
        # 各電球について
        cnt = 0
        for k in range(1,len(s[j])):
            if i>>s[j][k]-1&1:
                cnt += 1
        if cnt%2==p[j]:
            sw[j]=True
    if all(sw):
        ans+=1
print(ans)
import sys

N, K = map(int, input().split())
a = sorted(list(map(int, input().split())))
l = -(((1e18)+1)
r=(1e18)+1
while(l + 1 < r):
    x=(l + r) / 2
    total=0
    for i in range(N):
        if a[i] < 0:
            l=-1
            r=N
            while(l + 1 < r):
                c=(l + r) / 2
                if a[c] * a[i] < x:
                    r=c
                else:
                    l=c
            total += n - r
        else:
            l=-1
            r=N
            while(l + 1 < r):
                c=(l + r) / 2
                if a[c] * a[i] < x:
                    l=c
                else:
                    r=c
            total += r
        if a[i] * a[i] < x:
            total -= 1
    total /= 2
    if total < K:
        l=x
    else:
        r=x
print(l)


### FIXED CODE ###

import numpy as np

n, k = map(int, input().split())

A = np.array(input().split(), np.int64)

A.sort()

posA = A[A > 0]
negA = A[A < 0]
zeros = (A==0).sum()

left = -10**18
right = 10**18

while left+1 < right:
    num = (left+right)//2
    
    less_count = 0
    
    if num >= 0:
        less_count += zeros * n
    
    limit_pair_for_pos = num // posA
    limit_idxs = np.searchsorted(A, limit_pair_for_pos, side='right')
    less_count += limit_idxs.sum()

    limit_pair_for_neg = -(num // -negA)
    limit_idxs = n - np.searchsorted(A, limit_pair_for_neg, side='left')
    less_count += limit_idxs.sum()

    duplicate_cases = (A**2 <= num).sum()
    less_count -= duplicate_cases
    less_count //= 2
    
    if less_count >= k:
        right = num
    else:
        left = num

print(right)
s = input()
t = input()

list_s = list(s)
list_s.sort()

list_t = list(t)
list_t.sort(reverse=True)

yes = False
if len(list_s) < len(list_t):
    yes = True

for i in range(len(list_s)):
    if len(list_t)-1 < i:
        break
    if list_s[i] < list_t[i]:
        yes = True
        break
    elif list_s[i] > list_t[i]:
        yes = False
        break

if yes:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

import math

l = input().split()
a = int(l[0])
b = int(l[1])
c = float((a+b)/2)

print(math.ceil(c))
h,w,d = map(int, input().split())
a = [list(map(int, input().split())) for i in range(h)]
q=int(input())
b=[list(map(int, input().split())) for i in range(q)]
import collections
from collections import defaultdict
x=defaultdict(int)



for i in range(h):
    for j in range(w):
        x[i,j]=a[i][j]
x1=sorted(x.items(),key=lambda x:x[1])

ans=[[0]*(-(h*w//-d)) for i in range(d)]


for i in range(d):
    count=0
    for j in range(1,-(h*w//-d)):
        if i+j*d>=h*w:
            continue
        count+=abs(x1[i+(j-1)*d][0][0]-x1[i+j*d][0][0])
        count+=abs(x1[i+(j-1)*d][0][1]-x1[i+j*d][0][1])
        ans[i][j]+=count

for i in range(q):
    u=(b[i][0]-1)%d
    u1=(b[i][0]-u)//d
    v=(b[i][1]-b[i][0])//d

    print(ans[u][u1+v]-ans[u][u1])

### FIXED CODE ###

h,w,d = map(int, input().split())
a = [list(map(int, input().split())) for i in range(h)]
q=int(input())
b=[list(map(int, input().split())) for i in range(q)]
import collections
from collections import defaultdict
x=defaultdict(int)



for i in range(h):
    for j in range(w):
        x[i,j]=a[i][j]
x1=sorted(x.items(),key=lambda x:x[1])

ans=[[0]*(-(h*w//-d)) for i in range(d)]


for i in range(d):
    count=0
    for j in range(1,-(h*w//-d)):
        if i+j*d>=h*w:
            continue
        count+=abs(x1[i+(j-1)*d][0][0]-x1[i+j*d][0][0])
        count+=abs(x1[i+(j-1)*d][0][1]-x1[i+j*d][0][1])
        ans[i][j]+=count

for i in range(q):
    u=(b[i][0]-1)%d
    u1=(b[i][0]-1-u)//d
    v=(b[i][1]-b[i][0])//d

    print(ans[u][u1+v]-ans[u][u1])
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from math import ceil
def main():
    n, k = map(int, input().split())
    if k == 1:
        print(0)
        sys.exit()
    r1 = k % n
    r2 = abs(r1 - k)
    r = min(r1, r2)
    print(r)


if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    n, m = map(int, input().split())
    n = abs(n - (n // m) * m)
    n = min(n, abs(n - m))
    print(n)

if __name__ == '__main__':
    main()
n = int(input())
h_list = list(map(int,input().split()))
max = 0
ans = 0
for t in range(0,n):
  if h_list[t] >= h_list[t+1]:
    ans += 1
    if ans >= max:
      max = ans
  else:
    ans = 0
print(max)

### FIXED CODE ###

n = int(input())
h_list = list(map(int,input().split()))
max = 0
ans = 0
for t in range(0,n-1):
  if h_list[t] >= h_list[t+1]:
    ans += 1
    if ans >= max:
      max = ans
  else:
    ans = 0
print(max)
n = int(input())
a = [int(i) for i in input().split()]

j_Aj = [0]
i_Ai = [0] * (10 ** 9 + 2 * 10 ** 5)

for j, aj in enumerate(a):
    j_Aj.append(j + 1 - aj)
ans = 0
for j, j_aj in enumerate(j_Aj):
    if j == 0:
        continue
    if j_aj >= 2:
        ans += i_Ai[j_aj]
    i_Ai[j + a[j - 1]] += 1
print(ans)

### FIXED CODE ###

n = int(input())
a = [int(i) for i in input().split()]

j_Aj = [0]

for j, aj in enumerate(a):
    j_Aj.append(j + 1 - aj)
maxj=max(j_Aj)
i_Ai = [0] * (maxj+1)
ans = 0
for j, j_aj in enumerate(j_Aj):
    if j == 0:
        continue
    if j_aj >= 2:
        ans += i_Ai[j_aj]
    if j + a[j - 1]<=maxj:
        i_Ai[j + a[j - 1]] += 1
print(ans)
import sys
x, n = map(int, input().split())
p = [int(i) for i in input().split()]
q = []

if n == 0 or x not in p:
  print(x)
  sys.exit() 

for i in range(1, 101-x):
  if x + i not in p:
    q.append(x + i)
    if x - i not in p:
      q.append(x - i)
  break
print(min(q))

### FIXED CODE ###

X,N = map(int,input().split())
 
p = list(map(int,input().split()))
 
import sys
for i in range(300):
 
    if X-i not in p:
        print (X-i)
        sys.exit()
    elif X+i not in p:
        print (X+i)
        sys.exit()
100 2

### FIXED CODE ###

S,W=map(int,input().split())
if S<=W:print('unsafe')
else:print('safe')
n = int(input())
v = sorted(map(int, input().split()))

ans = v[0]

for i in range(1, N):
    ans = (ans + v[i]) / 2

print(ans)

### FIXED CODE ###

n = int(input())
v = sorted(map(int, input().split()))

ans = v[0]

for i in range(1, n):
    ans = (ans + v[i]) / 2

print(ans)
n = int(input())
monster = list(map(int,input().split()))
brave = list(map(int,input().split()))
ans = 0
for i in range(n):
  if i == 0:
    kill = min(monster[0],brave[0])
    ans += kill 
    brave -= kill
  else:
    kill = min(monster[i],brave[i])
    ans += kill
    brave[i] -= kill
    kill = min(monster[i+1],brave[i])
    ans += kill
    monster -= kill
print(ans)
    

### FIXED CODE ###

n = int(input())
monster = list(map(int,input().split()))
brave = list(map(int,input().split()))
ans = 0
for i in range(n):
  kill = min(monster[i],brave[i])
  ans += kill
  brave[i] -= kill
  kill = min(monster[i+1],brave[i])
  ans += kill
  monster[i+1] -= kill
print(ans)
import itertools
import heapq
import sys
readline = sys.stdin.readline
# readlines = sys.stdin.readlines
N = int(readline())
#ls = list(map(int, readline().split()))
ls = list(map(lambda x: int(x) * (-1), readline().split()))
#ls *= 100
#N *= 100
heapq.heapify(ls)
ans = 0
# n_comb = N * (N-1) * (N-2) / 6
 
import copy
copy_ls = copy.deepcopy(ls)
for i in range(N):
    max1 = -(heapq.heappop(ls))
    copy_ls1 = copy.deepcopy(ls)
    #print(ls)
    for j in range(N-i-1):
      # print(j, ls)
      max2 = -(heapq.heappop(ls))
      for _ in range(N-i-j-2):
        max3 = -(heapq.heappop(ls))
        if (max1 < max2 + max3):
          #print(max1, max2, max3)
          ans += 1
        else:
          # print('break')
          ls = copy.deepcopy(copy_ls1)
          heapq.heappop(ls)
          copy_ls1 = copy.deepcopy(ls)
          break
      ls = copy.deepcopy(copy_ls1)
      heapq.heappop(ls)
      copy_ls1 = copy.deepcopy(ls)
    
    # print('loop end')    
    ls = copy.deepcopy(copy_ls)

### FIXED CODE ###

import bisect
import sys
input = sys.stdin.readline
N = int(input())
ls = list(map(int, input().split()))
ls.sort()

ans = 0
for i in range(N-2):
  a = ls[i]
  for j in range(i+1, N-1):
    b = ls[j]
    pos = bisect.bisect_left(ls, a+b)
    ans += pos - j - 1
print(ans)
N = int(input())
li = list(map(int,input().split()))
out_count = 0


for j in range(N - 1 , 0 , -1):
  if li[j] >= li[j - 1] + 2:
    out_count += 1
  elif li[j] == li[j - 1] + 1:
    li[j - 1] -= 1

if li[0] > li[1]:
  out_count += 1
    
if out_count == 0:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

N = int(input())
li = list(map(int,input().split()))
out_count = 0

for j in range(N - 1 , 0 , -1):
  if li[j] <= li[j - 1] - 2:
    out_count += 1
  elif li[j] == li[j - 1] - 1:
    li[j - 1] -= 1
if out_count == 0:
  print('Yes')
else:
  print('No')
import numpy as np

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

r = np.sum(B)
for i in range(N-1):
  if A[i] + 1 == A[i + 1]:
    r += C[A[i]]

print(r)

### FIXED CODE ###

import numpy as np
 
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
 
r = np.sum(B)
for i in range(N-1):
  if A[i] + 1 == A[i + 1]:
    r += C[A[i]-1]

print(r)
import math
import copy
 
 
 
 
def nCast(number):
    if type(number)==str:
        return int(number)
    for idx in range(0,len(number)):
        if type(number[idx])==str:
 
            number[idx]=int(number[idx])
        else:
            nCast(number[idx])
    return number
    
def inputArr(w):
    l=list()
    for idx in range(0,w):
        l.append(input())
    return l
def inputArr1(w):
    l=list()
    for idx in range(0,w):
        l.append(input().split())
    return l
 
n=input()
s=input()

mod=1000000007
def help1(a):
    all=0
    a1=1
    a2=1
    
    b1=1
    while a!=0:
        a1=a1*a
        a2=a2*b1
        b1+=1
        tmp=(int)(a1/a2)
        a=a-1
        all=(all+tmp)%mod
    return all


def func():
    count=help1(len(s))
    dic={}

    for c in s:
        if c in dic:
            dic[c]=dic[c]+1
        else:
            dic[c]=1
    for k in dic:
        if dic[k]>1:

            count=(count+mod-(help1(dic[k])+mod-dic[k])*help1(len(s)-dic[k])%mod)%mod
    return count
  

print(func())


### FIXED CODE ###

import math
import copy
from collections import Counter
 
 
 
def nCast(number):
    if type(number)==str:
        return int(number)
    for idx in range(0,len(number)):
        if type(number[idx])==str:
 
            number[idx]=int(number[idx])
        else:
            nCast(number[idx])
    return number
    
def inputArr(w):
    l=list()
    for idx in range(0,w):
        l.append(input())
    return l
def inputArr1(w):
    l=list()
    for idx in range(0,w):
        l.append(input().split())
    return l
 

n=input()
s=input()

mod=7+10**9


def func():

    dic = Counter(s)
    ans = 1
    for x in dic:
        ans = ans*(dic[x]+1)%mod
    return ans-1
    
print(func())
n, q = map(int, input().split())
Graph = [[] for i in range(n)]
seen = [False]*n
point = [0]*n


def dfs(g, v, p):
    # vを訪問済みにする
    seen[v] = True
    if p != -1: point[v] += point[p]

    # vから行ける各頂点について
    for next_v in g[v]:

        # next_vが訪問済みだったらスルー
        if seen[next_v]: continue

        # 再帰的に探索
        dfs(g, next_v, v)


for i in range(n-1):
    a, b = map(int, input().split())
    a-=1
    b-=1

    # 無向グラフを想定
    Graph[a].append(b)
    Graph[b].append(a)


for i in range(q):
    x, p = map(int, input().split())
    point[x-1] += p


dfs(Graph, 0, -1)


print(*point)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)

n, q = map(int, input().split())
Graph = [[] for i in range(n)]
seen = [False]*n
point = [0]*n


def dfs(g, v, p):
    # vを訪問済みにする
    seen[v] = True
    if p != -1: point[v] += point[p]

    # vから行ける各頂点について
    for next_v in g[v]:

        # next_vが訪問済みだったらスルー
        if seen[next_v]: continue

        # 再帰的に探索
        dfs(g, next_v, v)


for i in range(n-1):
    a, b = map(int, input().split())
    a-=1
    b-=1

    # 無向グラフを想定
    Graph[a].append(b)
    Graph[b].append(a)


for i in range(q):
    x, p = map(int, input().split())
    point[x-1] += p


dfs(Graph, 0, -1)


print(*point)
def gcd(a, b):
    if (a % b == 0):
        return b
    else:
        return gcd(b, a%b)

def lcm(a, b):
    return int(a / gcd(a, b)) * b

n = int(input())

time = 1
for i in range(n):
    t = int(input())
    time = lcm(time, t)

print (time)

### FIXED CODE ###

def gcd(a, b):
    if (a % b == 0):
        return b
    else:
        return gcd(b, a%b)

def lcm(a, b):
    return a * b // gcd(a, b)

n = int(input())
ans = 1
for i in range(n):
    t = int(input())
    ans = lcm(ans, t)

print (ans)
min(A*N,B)

### FIXED CODE ###

N,A,B = list(map(int, input().split(" ")))
print(min(A*N,B))
#include<iostream>
#include<stdio.h>
#include<vector>//s1.erase(n)=文字列s1の、n文字目以降削除
#include<algorithm>//辞書順=next_permutation
#include<set>
#include<string>//char 小文字のほうが32大きい
#include<sstream>
#include<string.h>
#include<complex>
#include<time.h>
#include<random>
#include<cmath>
#include<math.h>
#include<queue>
#include<time.h>
#include<iomanip>
#include<locale>
#include<utility>//swap=数値交換
#define rt "\n"
#define rep(i,n) for(int i=0;i<n;i++)
#define rop(i,n) for(int i=1;i<=n;i++)
#define drep(i,n) for(int i=n-1;0<=i;i--)
#define drop(i,n) for(int i=n;0<i;i--)
#define yes(ans) if(ans)cout<<"yes"<<rt;else cout<<"no"<<rt;
#define Yes(ans) if(ans)cout<<"Yes"<<rt;else cout<<"No"<<rt;
#define YES(ans) if(ans)cout<<"YES"<<rt;else cout<<"NO"<<rt;
#define sec(a,b,ans) if(ans)cout<<a<<rt;else cout<<b<<rt;
#define vcin(s,n) rep(i,n)cin>>s[i];//vcin(配列名),(繰り返し回数)
#define sort(s) sort(s.begin(),s.end())//標準=昇順
#define reve(s) reverse(s.begin(),s.end())
#define asas int ans=0
#define llcncn llint cnt=0
#define llasas llint ans=0
#define str string
#define please return
#define AC 0
#define Rapid cin.tie(0);ios::sync_with_stdio(false)
#define Pi 3.1415926535897932384626
#define nine 1000000000

using namespace std;
typedef vector<int> vint;
typedef vector<string> vstr;
typedef vector<char> vchar;
typedef vector<double> vdou;
typedef long long int llint;
typedef pair<int, int> pint;
typedef pair<llint, llint> pllint;
typedef vector<llint> vllint;
typedef vector<pint> vpint;
typedef vector<pair<llint, llint>> vpllint;
typedef vector<vector<int>> vvint;
typedef vector<vector<char>> vvchar;
typedef vector<vector<llint>> vvllint;
typedef vector<vector<string>> vvstr;
typedef vector<vector<bool>> vvbool;
typedef vector<vector<pint>> vvpint;
typedef vector<bool> vbool;

long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}

long long LCM(long long a, long long b) {
	return a * b / GCD(a, b);
}

unsigned GetDigit(unsigned num) {
	return std::to_string(num).length();
}

int tow(int n) {//2のn乗
	if (n == 0)return 1;
	int x = tow(n / 2);
	x *= x;
	if (n % 2 == 1)x *= 2;
	return x;//@domino
}

/*
 
 (char)toupper(a[n])=文字列のn文字目を大文字で出力

  pow(a,b)=aのb乗

  */

int a = 0, b = 0, c = 0;

int main(void) {

	string s,t="2019/04/30";
	cin >> s;
	if (s > t)cout << "TBD" << rt;
	else cout << "heisei" << rt;

	please AC;
}

### FIXED CODE ###

s=str(input())
t='2019/04/30'
if t<s:
    print('TBD')
else:
    print('Heisei')
N = int(input())
ball = list(map(int, input().split()))
ball.sort(reverse = True)
dic = {}
for x in ball:
    dic[x] = 1

ans = 0
for x in ball:
    dic[x] = 0
    y = 2**(x.bit_length()) - x
    if dic[y] == 1:
        ans += 1
        dic[y] = 0
print(ans)

### FIXED CODE ###

N = int(input())
ball = list(map(int, input().split()))
ball.sort(reverse = True)
ok = {}
for x in ball:
    if x in ok:
        ok[x] += 1
    else:
        ok[x] = 1
ans = 0
for x in ball:
    if ok[x] != 0:
        y = 2**(x.bit_length()) - x
        if y in ok:
            if ok[y] != 0:
                if y == x and ok[y] == 1: 
                    continue
                ans += 1
                ok[x] -= 1
                ok[y] -= 1
print(ans)
S=input()
ans="Yes"
if S%2==1:
    ans="No"
else:
    for i in range(len(S)):
        if i%2==0:
            if S[i]!="h":
                ans="No"
                break
        if i%2==1:
            if S[i]!="i":
                ans="No"
                break
print(ans)

### FIXED CODE ###

S=input()
ans="Yes"
if len(S)%2==1:
    ans="No"
else:
    for i in range(len(S)):
        if i%2==0:
            if S[i]!="h":
                ans="No"
                break
        if i%2==1:
            if S[i]!="i":
                ans="No"
                break
print(ans)
r = int(input())
pi = 3.141592653589793238
print(pi * r * r, 2 * pi * r)


### FIXED CODE ###

r = float(input())
pi = 3.1415926535897932384626
print(pi * r * r, 2 * pi * r)
n=int(input())
t=list(map(int,input().split()))
m=int(input())
p1=[]
x1=[]
for i in range(m):
    p,x=map(int,input().split())
    p1.append(p)
    x1.append(x)
for i in range(m):
    print(p1[i])
    print(x1[i])
    print(sum(t)-t[p1[i]]+x1[p1[i]])

### FIXED CODE ###

n=int(input())
t=list(map(int,input().split()))
m=int(input())
p1=[]
x1=[]
for i in range(m):
    p,x=map(int,input().split())
    p1.append(p)
    x1.append(x)
for i in range(m):
    print(sum(t)-t[p1[i]-1]+x1[i])
N = int(input())
if N = 1:
  print(1)
elif 2 <= N <= 3:
  print(2)
elif 4 <= N <= 7:
  print(4)
elif 8 <= N <= 15:
  print(8)
elif 16 <= N <= 31:
  print(16)
elif 32 <= N <= 63:
  print(32)
elif 64 <= N <= 100:
  print(64)

### FIXED CODE ###

N = int(input())
if N == 1:
  print(1)
elif 2 <= N <= 3:
  print(2)
elif 4 <= N <= 7:
  print(4)
elif 8 <= N <= 15:
  print(8)
elif 16 <= N <= 31:
  print(16)
elif 32 <= N <= 63:
  print(32)
elif 64 <= N <= 100:
  print(64)
n, m = map(int, input().split())
a = list(map(int, input().split()))
ans = "Yes"

a.sort(reverse=True)

for i in range(m):
    if a[i] < sum(a)*(1/(4*m)):
        ans = "No"
        break

print(ans)


### FIXED CODE ###

x = list(map(int, input().split()))
print(x[2],x[0],x[1])
n=int(input())

a=list(map(int,input().split()))

needsearch=[]

for i in range(n):
    a[i]-=(i+1)
    needsearch.append(-2*(i+1)-a[i])

counter=[0]*(2*(10**6))

for i in range(n):
    if 0<a[i]+10**6<2*(10**6):
        counter[a[i]+10**6]+=1

ans = 0
for i in range(len(needsearch)):
    if 0<needsearch[i]+10**6<2*(10**6):
        ans += counter[needsearch[i]+10**6]
    counter[a[i]+10**6]-=1


print(ans)


### FIXED CODE ###

n=int(input())

a=list(map(int,input().split()))

needsearch=[]

for i in range(n):
    a[i]-=(i+1)
    needsearch.append(-2*(i+1)-a[i])

counter=[0]*(2*(10**6))

for i in range(n):
    if 0<a[i]+10**6<2*(10**6):
        counter[a[i]+10**6]+=1

ans = 0
for i in range(len(needsearch)):
    if 0<needsearch[i]+10**6<2*(10**6):
        ans += counter[needsearch[i]+10**6]
    if 0<a[i]+10**6<2*(10**6):
        counter[a[i]+10**6]-=1


print(ans)