Harryxun/stf_run huggingface dataset:
#!usr/bin/env python3

def string_five_numbers_spliter():
    """Split a given space-separated five numbers in a string into integers

    Return five integer values from a given space-separated five integers in a string.

    Returns:
        Five integer values; namely, w, h, x, y and r
    """
    w, h, x, y, r = [int(i) for i in input().split()]
    return w, h, x, y, r


def main():
    # Given that there are a rectangle and a circle.
    # Let w, h, x, y and r be such that:
    # w = width of the rectangle
    # h = height of thek rectangle
    # x = x coordinate for the centre of the circle
    # y = y coordinate for the centre of the circle
    # r = diameter of the circle
    w, h, x, y, r = string_five_numbers_spliter()

    if not (x + r < 0) and not (y + r < 0) and
        not (x + r > w) and not (y + r > h):
        print('yes')
    else:
        print('no')

### FIXED CODE ###

#!usr/bin/env python3

def string_five_numbers_spliter():
    """Split a given space-separated five numbers in a string into integers

    Return five integer values from a given space-separated five integers in a string.

    Returns:
        Five integer values; namely, w, h, x, y and r
    """
    w, h, x, y, r = [int(i) for i in input().split()]
    return w, h, x, y, r


def main():
    # Given that there are a rectangle and a circle.
    # Let w, h, x, y and r be such that:
    # w = width of the rectangle
    # h = height of thek rectangle
    # x = x coordinate for the centre of the circle
    # y = y coordinate for the centre of the circle
    # r = diameter of the circle
    w, h, x, y, r = string_five_numbers_spliter()

    if (not (x < 0) and not (y < 0) and
        not (x + r < 0) and not (y + r < 0) and
        not (x + r > w) and not (y + r > h)):
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()
import pandas as pd
import numpy as np
N = int(input())
df = pd.DataFrame(index = range(1,N+1),columns =['name','score'])
for i in range(N):
    name,score = input().split()
    df['name'].iloc[i] = name
    df['score'].iloc[i] = score
for i in df.sort_values(['name','score'],ascending = [True,False]).index:
    print(i)

### FIXED CODE ###

N = int(input())
 
city = []
for i in range(N):
    s, p = input().split()
    city.append([s, int(p), i+1])
city.sort(key=lambda city: (city[0], -city[1]))
 
for i in city:
    print(i[2])
def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n

def lcm(m, n):
    return m//gcd(m, n)*n

MOD = 10**9+7
n, *a = map(int, sys.stdin.buffer.read().split())
l = a[0]
for x in a[1:]:
    l = lcm(x, l)
l %= MOD

ans = 0
for x in a:
    ans = (ans + l * pow(x, MOD-2, MOD)%MOD)%MOD
print(ans)


### FIXED CODE ###

def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n

def lcm(m, n):
    return m//gcd(m, n)*n
MOD = 10**9+7
n = int(input())
a = list(map(int, input().split()))
l = a[0]
for x in a:
    l = lcm(x, l)
ans = 0
for x in a:
    ans += l*pow(x, MOD-2, MOD)%MOD
print(ans%MOD)
N,M = map(int,input().split())
count = 0
for i in range(M):
    a,b = map(int,input().split())
    if count == 0:
        L = a
        R = b
        count = 1
    else:
        if L < a:
            L =a
            if L>R:
                break
        if R > b:
            R = b
            if R < L:
                break
if M == i+1:
    print(max-min+1)
else:
    print(0)

### FIXED CODE ###

N,M = map(int,input().split())
count = 0
for i in range(M):
    a,b = map(int,input().split())
    if count == 0:
        L = a
        R = b
        count = 1
    else:
        if L < a:
            L =a
            if L>R:
                break
        if R > b:
            R = b
            if R < L:
                break
if M == i+1:
    print(R-L+1)
else:
    print(0)
import sys
s = input()
N = len(s)


for i in range(N-2+1):
    if s[i] == s[i+1]:
        print(i+1, i+3)
        sys.exit()
        
for i in range(N-3+1):
    if s[i] == s[i+3]:
        print(i+1, i+4)
        sys.exit()
        
print(-1, -1)

### FIXED CODE ###

import sys
s = input()
N = len(s)


for i in range(N-2+1):
    if s[i] == s[i+1]:
        print(i+1, i+2)
        sys.exit()

        
for i in range(N-3+1):
    if s[i] == s[i+2]:
        print(i+1, i+3)
        sys.exit()

        
        
print(-1, -1)
N,M = map(int,input().split())
import numpy as np
A = sorted(np.array(list(map(int,input().split()))),reverse=True)
bi = [0]*(A[0]+1)
for a in A:
  bi[a]+=1
  
cum = [0]*(A[0]+1)
for i in range(1,A[0]+1):
  cum[i]=cum[i-1]+bi[i]

cum_max=cum[-1]
left = 0
right = A[0]*2
while right-1!=left:
  x = (right+left)//2
  num = 0
  for a in A:
    b = max(x-a,1)
    if b<=A[0]:
      num += cum_max-cum[b-1]
    
  if num>M:
    left=x
  else:
    right=x
ans = 0
for a in A:
  b = max(left-a,1)
  c = cum_max-cum[b-1]
  M-=c
  ans+=(a*c)+(sum(A[:c]))
  if M<=0:
    break
  
ans+=(M*left)
print(ans)

### FIXED CODE ###

N,M = map(int,input().split())
A = sorted(list(map(int,input().split())),reverse=True)
bi = [0]*(A[0]+1)
for a in A:
  bi[a]+=1
  
cum = [0]*(A[0]+1)
for i in range(1,A[0]+1):
  cum[i]=cum[i-1]+bi[i]

cum_max=cum[-1]
left = 0
right = A[0]*2+1
while right-1!=left:
  x = (right+left)//2
  num = 0
  for a in A:
    b = max(x-a,1)
    if b<=A[0]:
      num += cum_max-cum[b-1]
    
  if num>=M:
    left=x
  else:
    right=x

ans = 0
cum_A = [0]*(N+1)
for i in range(1,N+1):
  cum_A[i]=cum_A[i-1]+A[i-1]
for a in A:
  b = max(right-a,1)
  if b>A[0]:
    break
  c = cum_max-cum[b-1]
  M-=c
  ans+=(a*c)+cum_A[c]
  

ans+=M*left
print(ans)
k=list(input())
m=list(input())
ams=0
for i in (len(k)):
  if(k[i]!=m[i]):
    ams+=1
print(ams)

### FIXED CODE ###

k=list(input())
m=list(input())
ams=0
for i in range(len(k)):
  if(k[i]!=m[i]):
    ams+=1
print(ams)
s1 = input().split()
s2 = input().split()

if(s1[0] == s2[2]):
    if(s1[1] == s2[1]):
        if(s1[2] == s2[0]):
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

### FIXED CODE ###

s1 = input()
s2 = input()

if(s1[0] == s2[2]):
    if(s1[1] == s2[1]):
        if(s1[2] == s2[0]):
            print("YES")
        else:
            print("NO")
    else:
        print("NO")
else:
    print("NO")
a=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k=int(input())
print(a[k])

### FIXED CODE ###

a=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k=int(input())
print(a[k-1])
from collections import defaultdict
if __name__ == '__main__':
    N = int(input())
    xyh = [None]*N
    for i in range(N):
        xyh[i] = list(map(int, input().split()))
    
    H = 0
    for i in range(N):
        if xyh[i][2] >= H:
            X = xyh[i][0]
            Y = xyh[i][1]
            H = xyh[i][2]
    
    flag = True
    for i in range(0, N):
        if xyh[i][2] != max(H - abs(xyh[i][0] - X) - abs(xyh[i][1] - Y), 0):
            flag = False
    
    if flag:
        print(1/0)
    
    
    if not flag:
        for x in range(0, 101):
            for y in range(0, 101):
                flag = True
                height = 0
                for i in range(0, N):
                    if xyh[i][2] != 0:
                        if height == 0:
                            height = xyh[i][2] + abs(xyh[i][0] - x) + abs(xyh[i][1] - y)
                        if height != xyh[i][2] + abs(xyh[i][0] - x) + abs(xyh[i][1] - y):
                            flag = False
                            break
                    else:
                        if abs(xyh[i][0] - x) + abs(xyh[i][1] - y) < height:
                            flag = False
                            break
                if flag and height:
                    X = x
                    Y = y
        
        
    H = xyh[0][2] + abs(xyh[0][0] - X) + abs(xyh[0][1] - Y)
    
    print(X, Y, H)

### FIXED CODE ###

from collections import defaultdict
if __name__ == '__main__':
    N = int(input())
    xyh = [None]*N
    for i in range(N):
        xyh[i] = list(map(int, input().split()))
    
    H = 0
    for i in range(N):
        if xyh[i][2] >= H:
            X = xyh[i][0]
            Y = xyh[i][1]
            H = xyh[i][2]
            I = i
    
    flag = True
    for i in range(0, N):
        if xyh[i][2] != max(H - abs(xyh[i][0] - X) - abs(xyh[i][1] - Y), 0):
            flag = False
            break
    
        
    if not flag:
        for x in range(0, 101):
            for y in range(0, 101):
                flag = True
                height = 0
                for i in range(0, N):
                    if xyh[i][2] != 0:
                        if height == 0:
                            height = xyh[i][2] + abs(xyh[i][0] - x) + abs(xyh[i][1] - y)
                        if height != xyh[i][2] + abs(xyh[i][0] - x) + abs(xyh[i][1] - y):
                            flag = False
                            break
                    else:
                        if abs(xyh[i][0] - x) + abs(xyh[i][1] - y) < height:
                            flag = False
                            break
                if flag and height:
                    X = x
                    Y = y
    
    H = xyh[I][2] + abs(xyh[I][0] - X) + abs(xyh[I][1] - Y)
     
    print(X, Y, H)
a=input("")
b=input("")
print(a*b),(2*a+2*b)


### FIXED CODE ###

x,y = input().split()
a = int(x)
b = int(y)
print(a*b,2*a+2*b)
import numpy as np
n = int(input())
a = [int(i) for i in input().split()]
a = np.array(a, dtype='int64')
a.sort()
print(a)
for i in range(n):
    if a[i] > 0:
        k = i
        print(i)
        break
a = np.absolute(a)
a.sort()

if k % 2 == 0:
    print(np.sum(a))
else :
    print(np.sum(a)- a[0]*2)

### FIXED CODE ###

import numpy as np
n = int(input())
a = [int(i) for i in input().split()]
a = np.array(a, dtype='int64')
k = np.sum(a < 0)
a = np.absolute(a)
a.dtype ='uint64'
a.sort()

if k % 2 == 0:
    print(int(np.sum(a)))
else :
    print(int(np.sum(a)- a[0]*2))
import math
from functools import reduce

n = int(input())
t = [int(input()) for _ in range(n)]

ans = reduce(lambda x, y: x * y // math.gcd(x, y), t)
print(ans)


### FIXED CODE ###

import fractions
from functools import reduce

n = int(input())
t = [int(input()) for _ in range(n)]

ans = reduce(lambda x, y: x * y // fractions.gcd(x, y), t)
print(ans)
import sys
input = sys.stdin.buffer.readline

n = int(input())
a = list(map(int, input().split()))
mod = 10**9+7
from fractions import gcd

l = a[0]
for i in range(1,n):
  l = l*a[i]//gcd(l,a[i])

ans = 0
for i in range(n):
  ans += l//a[i]

print(ans%mod)


### FIXED CODE ###

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

if n==m:
  print('Yes')
else:
  print('No')
import sys
from functools import reduce

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

def gcd(a, b):
    while b:
        a, b = b, a%b
    return a
#リストの最小公倍数
def lcm(a):    
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

N = ir()
A = lr()
A.sort()
MOD = 10 ** 9 + 7
l = []
first = A[0]
l = [x//gcd(x, first) for x in A[1:]]
x = lcm(l) #B[0]
answer = x%MOD

for i in range(1, N):
    answer += (first * x // A[i]) % MOD

print(answer%MOD)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 7)

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

def gcd(a, b):
    while b:
        a, b = b, a%b
    return a
#リストの最小公倍数
def lcm(a):    
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

N = ir()
A = lr()
A.sort()
if N == 1:
    print(1)
    exit()
MOD = 10 ** 9 + 7
l = []
first = A[0]
l = [x//gcd(x, first) for x in A[1:]]
x = lcm(l) #B[0]
answer = x%MOD

for i in range(1, N):
    answer += first * x // A[i]

print(answer%MOD)
from collections import deque
H, W = map(int, input().split())
X = [input() for _ in range(H)]
maxloc = -10

def bfs(sx, sy, gx, gy):
  if(X[sx-1][sy-1] == '#' or X[gx-1][gy-1] == '#'):
    return -1
  else:
    dist = [[-1]*W for _ in range(H)]
    dist[sx-1][sy-1] = 0
    q = deque([(sx-1, sy-1)])
    while q:
      u, v = q.popleft()
      for i, j in [(-1, 0), (1, 0), (0, -1), (0, 1)]:
        if not(0 <= u+i < H and 0 <= v+j < W):
          continue
    
        if(dist[u+i][v+j] >= 0 or X[u+i][v+j] == "#"):
          continue

        dist[u+i][v+j] = dist[u][v]+1
        q.append((u+i, v+j))

    return dist[gx-1][gy-1]

for i in range(H):
  for j in range(W):
    sx = i
    sy = j
    for k in range(i+1, H):
      for l in range(j+1, W):
        gx = k
        gy = l
        if(bfs(i+1, j+1, k+1, l+1) > maxloc):
          maxloc = bfs(i+1, j+1, k+1, l+1)
          
print(maxloc)


### FIXED CODE ###

s = "abcdefghijklmnopqrstuvwxyz"
C = input()
for i in range(len(s)):
  if(s[i] == C):
    print(s[i+1])
import sys
sys.setrecursionlimit(10000)
INF = 1000000007
n,m= map(int,input().split())
a = [0]*m
for i in range(m):
    a[i] = int(input())

def step(x):
    if x < 0:
        return 0
    if x == 0:
        return 1
    if x == 1:
        return 1
    if x == 2:
        return 2
    if x >= 3:
        return step(x-1)+step(x-2)

l = [a[0]-1]
for i in range(1,m):
    l.append(a[i]-a[i-1]-2)
l.append(n-a[m-1]-1)

ans = 1

for i in range(m+1):
    ans = ans*step(l[i])
    if ans >= INF:
        ans = ans % INF

print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)
INF = 1000000007
n,m= map(int,input().split())
a = [0]*m
for i in range(m):
    a[i] = int(input())

step = [0]*(n+10)
step[0] =1
step[1] =1
step[2] =2
for i in range(3,n+10):
    step[i] = step[i-1] + step[i-2]
if m != 0:
    l = [a[0]-1]
    for i in range(1,m):
        l.append(a[i]-a[i-1]-2)
    l.append(n-a[m-1]-1)

    ans = 1

    for i in range(m+1):
        if l[i] < 0:
            ans = 0
            break
        ans = ans*step[l[i]]
        if ans >= INF:
            ans = ans % INF
if m == 0:
    ans = step[n] % INF
print(ans)
N = int(input())
A = list(map(int, input().split()))
cnt = 0
for i, a in enumerate(A, 1):
  if a == i:
    if i != len(A) + 1:
      x = A[i - 1]
      y = A[i]
      A[i - 1] = y
      A[i] = x    
      cnt += 1
    else:
      x = A[i - 2]
      y = A[i - 1]
      A[i - 2] = y
      A[i - 1] = x    
      cnt += 1
print(cnt)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
cnt = 0
for i, a in enumerate(A, 1):
  if a == i:
    if i != len(A):
      x = A[i - 1]
      y = A[i]
      A[i - 1] = y
      A[i] = x    
      cnt += 1
    else:
      x = A[i - 2]
      y = A[i - 1]
      A[i - 2] = y
      A[i - 1] = x    
      cnt += 1
print(cnt)
for n in range(1, 10):
    for k in range(1, 10):
        print str(n) + "x" + str(k) + "=" + str(n * k)

### FIXED CODE ###

for n in range(1, 10):
    for k in range(1, 10):
        print str(n) + "x" + str(k) + "=" + str(n * k)
N=int(raw_input().strip())
A=map(int,raw_input().split())

A.sort()
Auni=list(set(A))
Auni.reverse()

num=[]
for i in Auni:
    num.append(A.count(i))

edge=[0,0]
for j in range(2):
    for i in range(len(num)):
        if num[i]>=2:
            num[i]=num[i]-2
            edge[j]=Auni[i]
            break
print edge[0]*edge[1]

### FIXED CODE ###

x,a,b=map(float,raw_input().split())
AX=abs(a-x)
BX=abs(b-x)
if AX>BX:
    print "B"
else:
    print "A"
import sys


for line in sys.stdin:
    xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2 = tuple(map(float, line.split(' ')))
    if (xa1 <= xb1 <= xa2 or xb1 <= xa1 <= xb2) and (yb1 <= ya2 <= yb2 or ya1 <= yb2 <= ya2):
        print 'YES'
    else:
        print 'NO'

### FIXED CODE ###


import sys


for line in sys.stdin:
    xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2 = map(float, line.strip().split(' '))
    if ((xb1<=xa1 and xa1<=xb2) or (xa1<=xb1 and xb1<=xa2)) and ((yb1<=ya2 and ya2<=yb2) or (ya1<=yb2 and yb2<=ya2)):
        print 'YES'
    else:
        print 'NO'
n = int(input())
a = list(map(int, input().split()))
if len(set(a)) == 1:
    if set(a)[0] != 1:
        print(-1)
        exit()
    else:
        print(0)
        exit()

x = 1
count = 0
for i in a:
    if i == x:
        x+=1
    else:
        count+=1
if count == n:
    print(-1)
else:
    print(count)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
if n == 1:
	if a[0] == 1:
		print (0)
		exit()
	else:
		print (-1)
		exit()
if len(set(a)) == 1 and a[0] != 1:
	print (-1)
	exit()
 
x = 1
cnt = 0
for i in a:
	if i == x:
		x += 1
	else:
		cnt += 1
if cnt == n:
	print (-1)
else:
	print(cnt)
k,s=map(int,input().split())
ans=0
for i in range(k):
  for j in range(k):
    fpr h in range(k):
      if i+j+h==s:
        ans+=1
print(ans)

### FIXED CODE ###

k,s=map(int,input().split())
ans=0
def als(n):
  if 0<=n<=k:
    return n+1
  elif k+1<=n<=2*k:
    return 2*k+1-n
  else:
    return 0
for i in range(k+1):
  ans+=als(s-i)
print(ans)
N = int(input())
S = input()

MOD = 1e9 + 7
L = {}
for i in S:
  if i in L:
    L[i] += 1
  else:
    L[i] = 1

Ans = 2 ** N - 1
t = 0
k = 1
for i in L.values():
  N -= i
  if i != 1:
    t += k * (2 ** N)
  k *= i + 1

Ans -= t

print(int(Ans % MOD))

### FIXED CODE ###

N = int(input())
S = input()

MOD = 1e9 + 7
L = {}
for i in S:
  if i in L:
    L[i] += 1
  else:
    L[i] = 1

Ans = 1
for i in L.values():
  Ans = Ans * (i + 1) % MOD

Ans -= 1
if Ans < 0:
  Ans += MOD

print(int(Ans))
n = input()
if 9 in n:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

n = input()
if "9" in n:
    print("Yes")
else:
    print("No")
a = list(map(int, input().split()))

print(list.index("0"))

### FIXED CODE ###

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

print(a.index(0)+1)
pi = math.pi
r = float(input())
print("(:.010f),(;.010f)".format(r**2*pi,2*r*pi))


### FIXED CODE ###

from math import pi
r = float(input())
print("{:.010f} {:.010f}".format(r * r * pi, 2 * pi * r))
N = str(input())
ans = "None"
for l in "abcdefghijklmnopqrstuvwxyz":
    if l not in N:
        ans = letter
        break
print(ans)

### FIXED CODE ###

N = str(input())
ans = None
for l in "abcdefghijklmnopqrstuvwxyz":
    if l not in N:
        ans = l
        break
print(ans)
def form_check(t):
    plus = t.index('+')
    equal = t.index('=')
    if len(t[:plus]) > 1 or len(t[plus + 1:equal]) > 1 or len(t[equal + 1:]  > 1):
        return False
    return True

def check(t):
    equal = t.index('=')
    if eval(t[:equal]) == eval(t[equal + 1:]):
        return True
    else:
        return False

while True:
    try:
        line = raw_input()
    except EOFError:
        break

    if form_check(line):
        nums = range(0, 10)
    else:
        nums = range(1, 10)
    a = -1
    for num in nums:
        if check(line.replace('X', str(num))):
            a = num
    if a >= 0:
        print a
    else:
        print 'NA'

### FIXED CODE ###

def form_check(t):
    plus = t.index('+')
    equal = t.index('=')
    n = [t[:plus], t[plus + 1:equal], t[equal + 1:]]
    for a in n:
        if len(a) > 1 and a[0] == 'X':
            return False
    return True

def check(t):
    if eval(t.replace('=', ' == ')):
        return True
    else:
        return False

while True:
    try:
        line = raw_input()
    except EOFError:
        break

    if form_check(line):
        nums = range(0, 10)
    else:
        nums = range(1, 10)
    a = -1
    for num in nums:
        if check(line.replace('X', str(num))):
            a = num
    if a >= 0:
        print a
    else:
        print 'NA'
import fractions import gcd
N,X = map(int,input().split())
x = list(map(int,input().split()))
x.append(X)
x.sort()
m = x[1]-x[0]

for i in range(1,N+1):
    n = x[i]-x[i-1]
    v = gcd(m,n)
    m = v

print(m)






### FIXED CODE ###

from fractions import gcd
N,X = map(int,input().split())
x = list(map(int,input().split()))
x.append(X)
x.sort()
m = x[1]-x[0]

for i in range(1,N+1):
    n = x[i]-x[i-1]
    v = gcd(m,n)
    m = v

print(m)
n = list(map(int, input().split()))

a,b = (n[2] - n[0]), (n[3] - n[1])

o1,o2 = (n[2] - b), (n[3] + a)
o3,o4 = (o1 - a),(o2 - b)

print(" ".join([o1,o2,o3,o4]))

### FIXED CODE ###

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

a,b = (n[2] - n[0]), (n[3] - n[1])

o1,o2 = (n[2] - b), (n[3] + a)
o3,o4 = (o1 - a),(o2 - b)

print(" ".join(list(map(str, [o1,o2,o3,o4]))))
x, y = [int(_) for _ in input().split(' ')]

M = int(1e9+7)

def modpow(a, n):
    if n == 0:
        return 1
    elif n == 1:
        return a
    elif n % 2 == 0:
        tmp = modpow(a, n // 2)
        return (tmp * tmp) % M
    else:
        tmp = modpow(a, n // 2)
        return (tmp * tmp * a) % M

def modinv(a):
    return modpow(a, M - 2)


if (x + y) % 3 == 0:
    a, b = (-x + 2 * y) // 3, (2 * x - y) // 3

    f = [1] * (a + b + 1)
    for i in range(1, a + b + 1):
        f[i] = f[i - 1] * i % M

    answer = (f[a + b] * modinv(f[a]) * modinv(f[b])) % M
    print(answer)
else:
    print(0)


### FIXED CODE ###

x, y = [int(_) for _ in input().split(' ')]

M = int(1e9+7)

def modpow(a, n):
    if n == 0:
        return 1
    elif n == 1:
        return a
    elif n % 2 == 0:
        tmp = modpow(a, n // 2)
        return (tmp * tmp) % M
    else:
        tmp = modpow(a, n // 2)
        return (tmp * tmp * a) % M

def modinv(a):
    return modpow(a, M - 2)

if (x + y) % 3 == 0:
    a, b = (-x + 2 * y) // 3, (2 * x - y) // 3

    if a >= 0 and b >= 0:
        f = [1] * (a + b + 1)
        for i in range(1, a + b + 1):
            f[i] = f[i - 1] * i % M

        answer = (f[a + b] * modinv(f[a]) * modinv(f[b])) % M
        print(answer)
    else:
        print(0)
else:
    print(0)
import math ##the version before 3.4 : import fractions

d = [int(x) for x in input().split()]
print(d[1] - d[0] + 1 - (int(d[1] // d[2]) - int((d[0] - 1) // d[2]) + int(d[1] // d[3]) - int((d[0] - 1) // d[3]) - int(d[1] // (d[2] * d[3] // math.gcd(d[2], d[3]))) - int((d[0] - 1) // (d[2] * d[3]// math.gcd(d[2], d[3])))))


### FIXED CODE ###

import fractions

d = [int(x) for x in input().split()]
lcm = int(d[2] * d[3] // fractions.gcd(d[2], d[3]))
b = d[1] - int(d[1] // d[2]) - int(d[1] // d[3]) + int(d[1] // lcm)
a_1 = d[0] - 1
a = a_1 - int(a_1 // d[2]) - int(a_1 // d[3]) + int(a_1 // lcm)
print(b - a)
def common():
   X = raw_input()
   Y = raw_input()

   for i in range(0, len(Y)+1):
      s[i] = 0

   for j in range(0, len(X)):
      t = s + []
      for k in range(0, len(Y)):
         if X[j] == Y[k]:
            s[k+1] = t[k] + 1
         elif s[k+1] < s[k]:
            s[k+1] = s[k]

   return s[-1]
??????????
q = input()???????? 
for l in range(0, q):
   common()

### FIXED CODE ###

def common():
   X = raw_input()
   Y = raw_input()
  
   s = [0 for i in range(len(Y)+1)]
 
   for j in range(0, len(X)):
      t = s + []
      for k in range(0, len(Y)):
         if X[j] == Y[k]:
            s[k+1] = t[k] + 1
         elif s[k+1] < s[k]:
            s[k+1] = s[k]
  
   print s[-1]
 
q = input()
for l in range(0, q):
   common()
from queue import Queue
s=input().split(' ')
N=int(s[0])
M=int(s[1])
room_from=[]
room_to=[]

for i in range(M):
  s=input().split(' ')

#道は両方向に使える
  room_from.append(int(s[0]))
  room_to.append(int(s[1]))
  room_from.append(int(s[1]))
  room_to.append(int(s[0]))

#for i in range(2*M):
#  print("from=",room_from[i],"to=",room_to[i])


#最小経路の回答を入れる. ansewr[room_from]=room_to


answer={}
todo={}
temp={}
todoq=Queue(N)

for (i,room) in enumerate(room_to): 
  if room_to[i] == 1:
    todo[room_from[i]]=1

answer.update(todo)

while True:
  for a in todo:
    for (i,room) in enumerate(room_to): 
      if room == a and room_from[i] not in temp and room_from[i] not in answer and room_from[i] != 1:
        temp[room_from[i]]=a
  if len(temp)==0:
    break
  else:
    todo.clear()
    todo.update(temp)
    answer.update(temp)
    temp.clear()
print(answer)
if len(answer)== N-1 :
  print ("Yes")
  for n in answer:
    print (answer[n])
else:
  print ("No")

### FIXED CODE ###

N=input()
n=int(N[-1])
if n in [2,4,5,7,9]:
  print("hon")
elif n in [0,1,6,8]:
  print("pon")
else:
  print("bon")