Harryxun/stf_run huggingface dataset:
import math

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

l = [0]*(n+2)
r = [0]*(n+2)
m = [0]*(n+2)

for i in range(n+1):
    j = n-i
    if i == 0:  # j = n
        l[i] = 0
        r[j+1] = 0
    else:
        l[i] = math.gcd(l[i-1], a[i-1])
        r[j] = math.gcd(r[j+1], a[j])

m = [math.gcd(l[i], r[i+1]) for i in range(n+1)]

print(max(m))


### FIXED CODE ###

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


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

l = [0]*(n+2)
r = [0]*(n+2)
m = [0]*(n+2)

for i in range(n+1):
    j = n-i
    if i == 0:  # j = n
        l[i] = 0
        r[j+1] = 0
    else:
        l[i] = gcd(l[i-1], a[i-1])
        r[j] = gcd(r[j+1], a[j])

m = [gcd(l[i], r[i+1]) for i in range(n+1)]

print(max(m))
a, b, k = map(int, input().split())
da = []
db = []
dc = []
for i in range(1,a+1):
    if a%1 == 0:
    	da.append(i)

for j in range(1, b+1):
    if b%j == 0:
    	db.append(j)

for k in range da:
    if k in db:
    	dc.append(k)

if dc:
    dc.sort(reverse = True)
    print(dc[k-1])

else:
    print(0)

### FIXED CODE ###

a, b, k = map(int, input().split())
da = []
db = []
dc = []
for i in range(1,a+1):
    if a%i == 0:
    	da.append(i)

for j in range(1, b+1):
    if b%j == 0:
    	db.append(j)

for l in da:
    if l in db:
    	dc.append(l)

dc.sort(reverse = True)
print(dc[k-1])
input = input()
a,b = input.split()
print(a * b, a*2 + b*2)


### FIXED CODE ###

input = input()
a,b = map(int, input.split())
print(a * b, a*2 + b*2)
s = input()
k = int(input())
for i in range(k):
    if s[i] != '1':
        ans = int(s[i])
        break
    else:
        continue
if ans:
    print(ans)
else:
    print(1)

### FIXED CODE ###

s = input()
n = len(s)
k = int(input())
ans = None
for i in range(k):
    if i == n:
        break

    if s[i] != '1':
        ans = int(s[i])
        break
    else:
        continue
if ans:
    print(ans)
else:
    print(1)
N = int(input())
T, A = map(int, input().split())
H = list(map(int,input().split()))

for i in H:
    temp = T-i*0.006-A
print(min(temp))

### FIXED CODE ###

N = int(input())
T, A = map(int, input().split())
H = list(map(int,input().split()))
t = [abs(T - H[i]*0.006-A) for i in range(N)]
print(t.index(min(t))+1)
n, k = map(int, input().split())
pos = [int(i) for i in input().split()]
score = [int(i) for i in input().split()]
if max(score) <= 0:
  print(max(score))
else:
  pos = [0] + pos
  score = [0] + score
  max_point = -10 ** 11
  s_dic = {}
  dic = {}
  loop = 0
  for i in range(1, n + 1):
    f_pos = i
    #print('f_pos',f_pos)
    if f_pos not in dic:
      points = [0]
      index = 0
      loop += 1
      while True:
        n_pos = pos[f_pos]
        points.append(points[-1] + score[n_pos])
        index += 1
        dic[f_pos] = [index, loop]
        if n_pos in dic:
          break
        f_pos = n_pos
      #print(nei)
      s_dic[loop] = points
      index = 1
    else:
      index, loop = dic[f_pos]
      points = s_dic[loop]
    #print(points)
    #print(count)
    loop_num = len(points) - 1
    s = points[index - 1]
    m = points[loop_num] - s
    a = k // loop_num
    b = k % loop_num
    if points[loop_num] > 0:
      point = points[loop_num] * a
      if point > max_point and a != 0:
        max_point = point
    else:
      point = 0
      if a > 0:
        b = loop_num
    #print(point)
    if b > 0:
      t_max = -10 ** 11
      if loop_num - index + 1 >= b:
        for j in range(b):
          t = points[j + index] - s
          #print(t)
          if t > t_max:
            t_max = t
      else:
        for j in range(index, loop_num + 1):
          t = points[j] - s
          #print(t)
          if t > t_max:
            t_max = t
        for j in range(1, b - loop_num + index):
          t = points[j] + m
          #print(t)
          if t > t_max:
            t_max = t
      point += t_max
    #print(point)
    if point > max_point:
      max_point = point
  print(max_point)

### FIXED CODE ###

n, k = map(int, input().split())
positions = [int(i) for i in input().split()]
scores = [int(i) for i in input().split()]
if max(scores) <= 0:
  print(max(scores))
else:
  positions = [0] + positions
  scores = [0] + scores
  max_point = -pow(10, 9)
  #print(max_point)
  for i in range(1, n + 1):
    s = []
    f_pos = positions[i]
    score = scores[f_pos]
    s.append(score)
    while f_pos != i:
      f_pos = positions[f_pos]
      score += scores[f_pos]
      s.append(score)
    loop = len(s)
    if loop >= k:
      point = max(s[:k])
    elif s[-1] <= 0:
      point = max(s)
    else:
      loop_c = k // loop
      r = k % loop
      point1 = s[-1] * loop_c
      if r != 0:
        point1 += max(s[:r])
      point2 = s[-1] * (loop_c - 1)
      point2 += max(0, max(s))
      point = max(point1, point2)
    max_point = max(max_point, point)
  print(max_point)
N,M = map(int,input().split())

P = [0]*M
Y = [0]*M

for i in range(M):
    p[i],y[i] = map(int,input().split())

A = [0]*M
C = [0]*M

B = [0]*M
for i in range(M):
    B[i] = Y[i]*100000+i

B.sort()

for i in range(M):
    d = B[i] % 100000
    k = P[d] - 1

    C[d] = A[k]
    A[k] += 1

for i in range(M):
    print('%06d%06d' % (P[i],C[i]+1))


### FIXED CODE ###

N,M = map(int,input().split())

P = [0]*M
Y = [0]*M

for i in range(M):
    P[i],Y[i] = map(int,input().split())

A = [0]*N
C = [0]*M

B = [0]*M
for i in range(M):
    B[i] = Y[i]*100000+i

B.sort()

for i in range(M):
    d = B[i] % 100000
    k = P[d] - 1

    C[d] = A[k]
    A[k] += 1

for i in range(M):
    print('%06d%06d' % (P[i],C[i]+1))
from sys import stdin

N, K = [int(x) for x in stdin.readline().rstrip().split()]
A = [int(x) for x in stdin.readline().rstrip().split()]

A.sort()
c = 1
ans = 0
inf = 10 ** 9 + 7
fact_list = [0] * (N + 1)
fact_list[0] = 1
f = 1

for i in range(1, N + 1):
    f *= i
    fact_list[i] = f

for i in range(N - K + 1):
    tmp_min = A[i]
    tmp_max = A[N - i - 1]
    d = (tmp_max - tmp_min) % inf
    n = (fact_list[N - i - 1] / fact_list[K - 1] / fact_list[N - i -K]) % inf
    ans += d * n
    ans %= inf

print(int(ans))

### FIXED CODE ###

from sys import stdin

N, K = [int(x) for x in stdin.readline().rstrip().split()]
A = [int(x) for x in stdin.readline().rstrip().split()]

A.sort()
c = 1
ans = 0
inf = 10 ** 9 + 7
fact_list = [1] * (N + 1)
fact_inv = [1] * (N + 1)
f = 1

for i in range(1, N + 1):
    f *= i
    f %= inf
    fact_list[i] = f

for i in range(1, N + 1):
    fact_inv[i] = pow(fact_list[i], inf - 2, inf)

for i in range(N - K + 1):
    tmp_min = A[i]
    tmp_max = A[N - i - 1]
    d = (tmp_max - tmp_min) % inf
    n = fact_list[N - i - 1] * fact_inv[K - 1] * fact_inv[N - i -K] % inf
    ans += d * n
    ans %= inf

print(int(ans))
n = int(input())
a = list(map(int, input().split()))
b = [0]*(n+1)

for i in range(1, n+1):
  print(a.count[i])
	

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
b = [0]*(n+1)

for i in range(n-1):
  b[a[i]] += 1

for i in range(1,n+1):
  print(b[i])
import numpy as np
import fractions as fra



a[13]={0,3,1,3,2,3,2,3,3,2,3,2,3}

x,y=map(int,input().split())
if(a[x]==a[y]):
    print("Yes")
else:
    print("No")

### FIXED CODE ###



import numpy as np
import fractions as fra



a=[0,3,1,3,2,3,2,3,3,2,3,2,3]

x,y=map(int,input().split())
if(a[x]==a[y]):
    print("Yes")
else:
    print("No")
# https://yahoo-procon2019-qual.contest.atcoder.jp/tasks/yahoo_procon2019_qual_c


K, A, B = map(int, input().split())

need_turns = A + 1 + 1  # 交換に必要なターン
first_need_turns = need_turns - 1

if A + 2 > B or K < first_need_turns:  # 交換せずにビスケットを叩き続ける方が得
    print(1 + K)
    exit()

ans = B  # 一度交換した
K -= (need_turns - 1)

# print("{}, {}".format(K, ans))

while K > 0:
    if ans >= A and K >= 2:
        ans += (B - A) * K / 2
        K = 0
    else:
        ans += 1
        K -= 1

print(ans)

### FIXED CODE ###

# https://yahoo-procon2019-qual.contest.atcoder.jp/tasks/yahoo_procon2019_qual_a

N, K = map(int, input().split())

if K <= (N + 1) / 2:
    print("YES")
else:
    print("NO")
S = str(input())
T = str(input())

if S == T[0:len(T)-2]:
  print(Yes)
else:
  No


### FIXED CODE ###

S = str(input())
T = str(input())
t = int(len(T)) - 1
U = T[:t]

if S == U:
  print('Yes')
else:
  print('No')
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
  int n,m;
  vector<string> s(n),t(m),o(n);
  cin>>n;
  rep(i,n){
    cin>>s.at(i);
  }
  cin>>m;
  rep(j,m){
    cin>>t.at(j)
  }
  rep(i,n){
    int sss=0, ttt=0;
      rep(j,n){
        if(s.at(i)==s.at(j)){
          sss++;
        }
      }
  }
  rep(k,m){
    if(s.at(i)==t.at(k)){
      ttt++;
    }
    o.at(i) = sss - ttt;
  }
  int max=0;
  rep(i,n){
    if(max<o.at(i)){
      max = o.at(i);
    }
  }
  cout<<max;
}
  

### FIXED CODE ###

n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]
l =[0]*n
for j in range(n):
  a = s.count(s[j])
  b = t.count(s[j])
  l[j] = a-b
print(max(max(l),0))
import numpy as np
n, m = map(int, raw_input().split())
a = [raw_input() for _ in xrange(n)]
b = [raw_input() for _ in xrange(m)]
f = False
for i in xrange(m):
    if b[i] in a:
        f = True

if f:
    print "Yes"
else:
    print "No"


### FIXED CODE ###

a,b=map(int,raw_input().split())

if a == 1 or b == 1:
    if a < b:
        print "Alice"
    elif a == b:
        print "Draw"
    elif a > b:
        print "Bob"
else:
    if a > b:
        print "Alice"
    elif a == b:
        print "Draw"
    elif a < b:
        print "Bob"
from fractions import gcd
def lcm(x, y):
    return (x // math.gcd(x, y) *y)
a,b = map(int,input().split())
ans = lcm(a, b)
print(ans)

### FIXED CODE ###

from fractions import gcd
def lcm(x, y):
    return (x // gcd(x, y) *y)
a,b = map(int,input().split())
ans = lcm(a, b)
print(ans)
n, x = map(int, input().split())

def func(a, b):
    if a < b:
        if b%a == 0:
            return b//a*2 - 1
        else:
            return 2*a + func(a, b-a)
    else:
        if a%b == 0:
            return a//b*2 - 1
        else:
            return 2*b + func(a-b, b)

print(x+(n-x)+func(x,n-x))

### FIXED CODE ###

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

def func(a, b):
    if a < b:
        if b%a == 0:
            return (b//a*2 - 1)*a
        else:
            q, mod = divmod(b,a)
            return 2*q*a + func(a, mod)
    elif a > b:
        if a%b == 0:
            return (a//b*2 - 1)*b
        else:
            q, mod = divmod(a,b)
            return 2*q*b + func(mod, b)
    else:
        return a

if x == n/2:
    print(3*x)
else:
    print(x+(n-x)+func(x,n-x))
n,a,b=map(int,input().split())
print(min(a*n,b)

### FIXED CODE ###

n,a,b=map(int,input().split())
print(min(a*n,b))
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


def resolve():
    N, K = map(int, input().split())
    const = 1e9 + 7
    n_iter = int(min(K, N - K + 1))
    for i in range(1, n_iter + 1):
        ans = combinations_count(N - K + 1, i) * combinations_count(
            K - 1, i - 1)
        print(int(ans % const))

resolve()

### FIXED CODE ###

import math


def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


def resolve():
    N, K = map(int, input().split())
    const = 1e9 + 7
    for i in range(1, K + 1):
        if (N - K + 1 >= i):
            print(
                combinations_count(N - K + 1, i) *
                combinations_count(K - 1, i - 1) % 1000000007)
        else:
            print(0)
            
resolve()
n = input()
l = [1000,2000,3000,4000,5000,6000,7000,8000,9000,10000]
for i in l:
    if n <= i:
        r = i
        break
result = r - n
print(result)

### FIXED CODE ###

n = int(input())
l = [1000,2000,3000,4000,5000,6000,7000,8000,9000,10000]
for i in l:
    if n <= i:
        r = i
        break
result = r - n
print(result)
def search(i,x,con,val):
    if con[i] :
        for j in con[i]:
            search(j,x,con,val)
    val[i]+=x


n,q=map(int,input().split())
con=[[] for _ in range(n)]
val=[0]*n
for _ in range(n-1):
    a,b=map(int,input().split())
    con[a-1].append(b-1)

for _ in range(q):
    p,x=map(int,input().split())
    search(p-1,x,con,val)

print(" ".join(map(str,val)))


### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

def val_add(i,con,val):
    if con[i] :
        for j in con[i]:
            val[j]+=val[i]
            val_add(j,con,val)

def tree(i,con):
    if not con[i]: pass
    else :
        for j in con[i]:
            con[j].remove(i)
            tree(j,con)

def main():
    n,q=map(int,input().split())
    con=[[] for _ in range(n)]
    val=[0]*n
    for _ in range(n-1):
        a,b=map(int,input().split())
        con[a-1].append(b-1)
        con[b-1].append(a-1)

    tree(0,con)

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

    val_add(0,con,val)


    print(" ".join(map(str,val)))

main()
import sys
from heapq import heappush, heappop, heapify
import math
from math import gcd
import itertools as it
import collections
from collections import deque 

input = sys.stdin.readline

def inp():
    return int(input())
def inpl():
    return list(map(int, input().split()))
def _debug(obj):
    print(obj, file=sys.stderr)

# ---------------------------------------

N, M = inpl()
graph = [[] for i in range(N+1)]

for i in range(M):
    x, y = inpl()
    graph[x].append(y)

flag = [False] * (N + 1)
dp = [0] * (N + 1)


def f(x):
    if flag[x]:
        return dp[x]
    flag[x] = True
    fans = 0
    for y in graph[x]:
        fans = max(fans, f(y) + 1)
    dp[x] = fans
    return fans

ans = 0
for i in range(1, N + 1):
    ans = max(ans, f(i))
print(ans)


### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
from heapq import heappush, heappop, heapify
import math
from math import gcd
import itertools as it
import collections
from collections import deque 

def inp():
    return int(input())
def inpl():
    return list(map(int, input().split()))
def _debug(obj):
    print(obj, file=sys.stderr)

# ---------------------------------------

N, M = inpl()
graph = [[] for i in range(N+1)]

for i in range(M):
    x, y = inpl()
    graph[x].append(y)

flag = [False] * (N + 1)
dp = [0] * (N + 1)


def f(x):
    if flag[x]:
        return dp[x]
    flag[x] = True
    fans = 0
    for y in graph[x]:
        fans = max(fans, f(y) + 1)
    dp[x] = fans
    return dp[x]

ans = 0
for i in range(1, N + 1):
    ans = max(ans, f(i))
print(ans)
s = int(input())
m = s / 60
h = m / 60

print(h:m:s)

### FIXED CODE ###

a = int(input())
h = int(a/3600)
m=int((a%3600)/60)
s=int((a%3600)%60)

print(h,m,s,sep=":")
s,w=map(int.input().split())
if s<=w:
  print('unsafe')
else:
  print('safe')

### FIXED CODE ###

def issafe(S,W):
    if S > W:
        return "safe"
    return "unsafe"

S,W = map(int,input().split())
print(issafe(S,W))
import sys

sys.setrecursionlimit(10 ** 5 * 2)
input = sys.stdin.readline()
N, M = map(int, input().split())
Ps = [[] for _ in range(N)]
for i in range(M):
    x, y = map(int, input().split())
    Ps[x - 1].append(y - 1)

mem = [-1] * N


def rec(n):
    if mem[n] > -1:
        return mem[n]
    elif len(Ps[n]) == 0:
        mem[n] = 0
        return mem[n]
    else:
        mem[n] = max([rec(Ps[n][i]) for i in range(len(Ps[n]))]) + 1
        return mem[n]


for i in range(N):
    rec(i)
print(max(mem))

### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 5 * 2)
N, M = map(int, input().split())
Ps = [[] for _ in range(N)]
for i in range(M):
    x, y = map(int, input().split())
    Ps[x - 1].append(y - 1)

mem = [-1] * N


def rec(n):
    if mem[n] > -1:
        return mem[n]
    elif len(Ps[n]) == 0:
        mem[n] = 0
        return mem[n]
    else:
        mem[n] = max([rec(Ps[n][i]) for i in range(len(Ps[n]))]) + 1
        return mem[n]


for i in range(N):
    rec(i)
print(max(mem))
n,m=map(int,input().split())
if abs(n-m)>1: print(0)
else:
    mod=10**9+7
    fac=[0]*n
    fac[0]=1
    fac[1]=1
    def fact(n):
        if fac[n]>0: return fac[n]
        fac[n]=n*fact(n-1)%mod
        return fac[n]
    
    ans=(fac(n)*fac(m))%mod
    if n==m: print((2*ans)%mod)
    else: print(ans)

### FIXED CODE ###

n,m=map(int,input().split())
if abs(n-m)>1: print(0)
else:
    mod=10**9+7
    def fact(n):
        ans=1
        for i in range(n):
            ans*=(i+1)
            ans%=mod
        return ans

    ans=(fact(n)*fact(m))%mod
    if n==m: print((2*ans)%mod)
    else: print(ans)
a=input.split(' ')
a[0]=int(a[0])
a[1]=int(a[1])
print(a[0]*a[1])

### FIXED CODE ###

a=input().split(' ')
a[0]=int(a[0])
a[1]=int(a[1])
print(a[0]*a[1])
N, K = map(int, input().split())
p = list(map(int, input().split()))

res = sum(p[:K])
res_max = res
for i in range(1, N-K+1):
    res += p[i+k] - p[i-1]
    if res > res_max:
        i_max = i

ans = 0
for j in range(K):
    ans += (p[i_max + j] + 1) / 2
print(ans)


### FIXED CODE ###

N, K = map(int, input().split())
p = list(map(int, input().split()))

res = sum(p[:K])
res_max = res
i_max = 0
for i in range(1, N-K+1):
    res += p[i+K-1] - p[i-1]
    if res > res_max:
        res_max = res
        i_max = i

ans = 0
for j in range(K):
    ans += (p[i_max + j] + 1) / 2
print(ans)
n, m = map(int, input().split())
ab = [(map(int, input().split())) for _ in range(n)]

jobs = [(a, -b) for a, b in ab]
jobs.sort()

ans = 0
job_index = 0
for i in range(m):
    while job_index < len(jobs):
        if jobs[job_index] + i < m:
            ans -= jobs[job_index][1]
        else:
            job_index += 1
print(ans)


### FIXED CODE ###

from heapq import heappush, heappop

n, m = map(int, input().split())
ab = [tuple(map(int, input().split())) for _ in range(n)]


jobs = [[] for _ in range(m)]
for a, b in ab:
    if a <= m:
        jobs[a - 1].append(-b)

ans = 0
available = []
for job in jobs:
    for jo in job:
        heappush(available, jo)

    if available:
        ans -= heappop(available)

print(ans)
a,b = map(int, input().split())

if (a*b)%2:
  print("Even")
  else:
    print("Odd")

### FIXED CODE ###

a, b = map(int, input().split())
if (a*b) % 2:
    print("Odd")
else:
    print("Even")
b = int(input())
print("A" if b == "T" else "T" if b == "A" else
      "C" if b == "G" else "T")


### FIXED CODE ###

b = input()
print("A" if b == "T" else "T" if b == "A" else
      "C" if b == "G" else "G")
X = input()

ans = "1"
if int(X) < 100:
	ans = "0"


if not int(X[:-2])*5 >= int(X[-2:]):
	ans = "0"

print(ans)




### FIXED CODE ###

X = input()

ans = "1"
if int(X) < 100:
	ans = "0"
elif not int(X[:-2])*5 >= int(X[-2:]):
	ans = "0"

print(ans)
#include<stdio.h>

long int multiplyNumbers(int n) {
    if (n>=1)
        return n*multiplyNumbers(n-1);
    else
        return 1;
}

int main(){
	long int N, M;
	scanf("%ld %ld", &N, &M);
	long int c1 = multiplyNumbers(N)/((multiplyNumbers(N-2))*multiplyNumbers(2));
	long int c2 = multiplyNumbers(M)/((multiplyNumbers(M-2))*multiplyNumbers(2));
	printf("%d", c1+c2);
	return 0;
}

### FIXED CODE ###

from itertools import combinations

N, M = map(int, input().split())

a = list(combinations(range(N), 2))
b = list(combinations(range(M), 2))
print(len(a)+len(b))
import math
def distance():
    x1,x2,x3,x4 = map(int, input().split())
    n = (x3 - x1)**2 + (x4 - x2)**2
    ans = math.sqrt(n)
    print(ans)
    
if __name__ == '__main__':
    distance()


### FIXED CODE ###

import math

x1,x2,x3,x4 = map(float, input().split())
n = (x3 - x1)**2 + (x4 - x2)**2
ans = math.sqrt(n)
print(ans)
import sys
def input(): return sys.stdin.readline().rstrip()
from collections import Counter
def main():
    s=input()
    zyx="zyxwvutsrqponmlkjihgfedcba"
    if s==zyx:
        print(-1)
        sys.exit()
    ss=set(s)
    if len(ss)==26:
        for i,sx in enumerate(zyx):
            print(i,sx,s)
            if s[i]!=sx:
                sxi=s.index(sx)
                s=s[:sxi]
                sy=s[-1]
                for j in range(26):
                    sz=chr(ord(sy)+1)
                    if not(sz in s):     
                        print(s[:-1]+sz)
                        sys.exit()
    else:
        for i in range(26):
            if chr(ord('a')+i) in s:
                continue
            print(s+chr(ord('a')+i))
            break
    


if __name__=='__main__':
    main()

### FIXED CODE ###

import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    s=input()
    if len(s)==26:
        for i in range(25,0,-1):
            if s[i]<s[i-1]:
                continue
            else:
                sx=s[i-1]
                for j in range(1,25):
                    sy=chr(ord(sx)+j)
                    if sy in s[i:]:
                        print(s[:i-1]+sy)
                        sys.exit()
        else:
            print(-1)
    else:
        for i in range(26):
            if chr(ord('a')+i) in s:
                continue
            print(s+chr(ord('a')+i))
            break

if __name__=='__main__':
    main()
input = input()[-1]
if input == '3':
  print('bon')
elif intpu in ['0', '1', '6', '8']:
  print('hon')
else:
  print('hon')


### FIXED CODE ###

input = input()[-1]
if input == '3':
    print('bon')
elif input in ['0', '1', '6', '8']:
    print('pon')
else:
    print('hon')
import numpy as np
import itertools
N = int(input().strip())
A = list(map(int,input().strip().split(' ')))
Z = np.zeros((N+1,N))
Z[0,:] = np.array(A)
result = 0

for i,j in itertools.combinations_with_replacement(range(1,N),2):
        tmp = Z[i-1,j-1]+Z[0,j]
        if tmp ==0:
                result = result+1
        Z[i,j] = tmp
print(result)

### FIXED CODE ###

import collections
N = int(input().strip())
A = list(map(int, input().strip().split(' ')))
C = [0 for j in range(N)]
C[0] = A[0]
for i in range(1,N):
        C[i] = C[i-1] + A[i]
C.sort()

CC = collections.Counter(C)

result = CC[0]
for k in CC.values():
    if k > 1:
        result = result + k*(k-1)/2

print(int(result))
A, B = map(int, input().split())
if abs(A-K) == abs(B-K):
  print(K)
else:
  print('IMPOSSIBLE')

### FIXED CODE ###

A, B = map(int, input().split())
if (A + B) % 2 == 0:
  k = (A + B) // 2
  print(k)
  exit()
else:
  print('IMPOSSIBLE')
  exit()
import math
def main():
    n=int(input())
    a=list(map(int,input().split(' ')))
    ans =math.inf
    s=0
    rac=sum(a)
    for i in a[:-1]:
        s+=i
        rac-=i
        if abs(s-rac)<ans:
            ans = abs(s-rac)
    print(ans)
if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    n=int(input())
    a=list(map(int,input().split(' ')))
    ans =abs(a[0]-sum(a[1:]))
    s=0
    rac=sum(a)
    for i in a[:-1]:
        s+=i
        rac-=i
        if abs(s-rac)<ans:
            ans = abs(s-rac)
    print(ans)
if __name__ == '__main__':
    main()
import os, sys, re, math

n,k = input().split(',')
print(int(n)-int(k)+1)

### FIXED CODE ###

import os, sys, re, math

n,k = input().split(' ')
print(int(n)-int(k)+1)
n,k=map(int,input().split())
        a=list(map(int,input().split()))
        f=list(map(int,input().split()))
        a.sort()
        f.sort(reverse=1)
        su=ok=ng=0
        for i in range(n):
          ok=max(ok,a[i]*f[i])
          su+=a[i]
        if su<=k:print(0);exit()
        while ng+1<ok:
          mid=(ok+ng)//2
          h=0
          for i in range(n):
            h+=a[i]-(f[i]/mid)
          if h<=k:ok=mid
          else:ng=mid
        print(ok)

### FIXED CODE ###

n,k=map(int,input().split())
a=list(map(int,input().split()))
f=list(map(int,input().split()))
a.sort()
f.sort(reverse=1)
su=ok=ng=0
for i in range(n):
  ok=max(ok,a[i]*f[i])
  su+=a[i]
if su<=k:print(0);exit()
while ng+1<ok:
  mid=(ok+ng)//2
  h=0
  for i in range(n):
    r=a[i]-(mid//f[i])
    if (r<0):
      r=0
    h+=r
  if h<=k:ok=mid
  else:ng=mid
print(ok)