Harryxun/stf_run huggingface dataset:
import sys
input = sys.stdin.readline
from scipy.special import comb

N, K = map(int,input().split())
MOD = 10**9+7
for i in range(1,K+1):
    val1 = comb(K-1, i-1, exact=True)%MOD
    val2 = comb(N-K-1, i, exact=True)%MOD
    val3 = comb(N-K-1, i-1, exact=True)%MOD
    val4 = comb(N-K-1, i-2, exact=True)%MOD
    print((val1*(val2+2*val3+val4))%MOD)


### FIXED CODE ###

import sys
input = sys.stdin.readline
from scipy.misc import comb

N, K = map(int,input().split())
MOD = 10**9+7
for i in range(1,K+1):
    if i==1 and N==K:
        print(1)
        continue
    val1 = comb(K-1, i-1, exact=True)%MOD
    val2 = comb(N-K-1, i, exact=True)%MOD
    val3 = comb(N-K-1, i-1, exact=True)%MOD
    val4 = comb(N-K-1, i-2, exact=True)%MOD
    res = (val1*(val2+2*val3+val4))%MOD
    print(res)
mod = 10**9+7
 
n = int(input())
a = [[int(x) for x in input().split()] for _ in range(n)]
 
dp = [-1 for __ in range(1 << n)]
dp[0] = 1
 
 
def dfs(bit, i):
    if dp[bit] != -1:
        return dp[bit]
    else:
        tmp = 0
        for j in range(n):
            if bit & (1 << j) and a[i][j]:
                tmp += dfs(bit ^ (1 << j), i+1)
    dp[bit] = tmp % mod
    return dp[bit]
 
 
print(dfs(2**n-1, 0))

### FIXED CODE ###

mod = 10**9+7
 
n = int(input())
a = [[int(x) for x in input().split()] for _ in range(n)]
 
dp = [-1 for __ in range(1 << n)]
dp[0] = 1
 
 
def dfs(bit, i):
    if dp[bit] != -1:
        return dp[bit]
    else:
        tmp = 0
        for j in range(n):
            if bit & (1 << j) and a[i][j]:
                tmp += dfs(bit ^ (1 << j), i+1)
    dp[bit] = tmp % mod
    return dp[bit]
 
 
print(dfs(2**n-1, 0))
input()

if B+C <= 20
print(0)

else B+C > 20
print(C-A+B)

### FIXED CODE ###

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

answer = C-A+B

if answer >= 0:
	print(answer)

else :
	print(0)
ProNum = int(input())
time = input()
time = time.split()
TotalTime = 0

for t in time:
  TotalTime += t

DrinkNum = int(input())

for d in range(DrinkNum):
  line = input()
  line = line.split()
  diff = int(line[1]) - int(time(int(line[0])))
  print(TotalTime+diff)

### FIXED CODE ###

ProNum = int(input())
time = input()
time = (time.split())
TotalTime = 0

for t in time:
  TotalTime += int(t)
                  
DrinkNum = int(input())

for d in range(DrinkNum):
  line = input()
  line = line.split()
  diff = int(line[1]) - int(time[int(line[0])-1])
  print(TotalTime+diff)
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N, X = MAP()

def rec(a, b):
    if a == b:
        return a
    a, b = min(a, b), max(a, b)
    return a*2 + rec(a, b-a)

print(N+rec(X, N-X))


### FIXED CODE ###

# -*- coding: utf-8 -*-

import sys
if sys.version_info.minor >= 5: from math import gcd
else: from fractions import gcd

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N, X = MAP()

print((N-gcd(N, X))*3)
N = int(input())
S = [*input()]

a = [chr(i) for i in range(65, 65+26)]
b = [chr(i) for i in range(65+N, 65+26)]
for i in range(N):
    b.append(a[i])

a_dict = {}
for i in range(len(a)) :
    a_dict[a[i]] = b[i]
for i in range(len(S)) :
    S[i] = a_dict[S[i]]

print(''.join(S))

### FIXED CODE ###

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

a = [chr(i) for i in range(65, 65+26)]
b = [chr(i) for i in range(65+N, 65+26)]
for i in range(N):
    b.append(a[i])

a_dict = {}
for i in range(len(a)) :
    a_dict[a[i]] = b[i]
for i in range(len(S)) :
    S[i] = a_dict[S[i]]

print(''.join(S))
N, M = map(int,input().split())
L = [0] * M
R = [0] * M
for i in range(M):
    L[i], R[i] = map(int, input().split())

if min(R) >= max(L):
    print(min(R) - max(L) + 1)
else:
    print(0)

### FIXED CODE ###

A, B = map(int,input().split())
if A > 12:
    print(B)
elif 6 <= A and A <= 12:
    print(int(B/2))
else:
    print(0)
def calculate(arr,M):
    sum = 0
    for i in range(M):
        index = 0
        value = 0
        for j in range(len(arr)):
            lastDay = i + arr[j][0]
            if lastDay <= M:
                if arr[j][1] > value:
                    index = j
                    value = arr[j][1]

                if (arr[j][1] == value) and (arr[index][0] < arr[j][0]):
                        index = j
                        value = arr[j][i]

        if len(arr) > 0:
            sum += value
            arr.pop(index)

        if len(arr) == 0:
            break

    return sum

N, M = map(int, input().split())
arr = []
for i in range(N):
    day, mount = map(int, input().split())
    arr.append([day,mount])
result = calculate(arr,M)
print(result)

### FIXED CODE ###

from heapq import heappush, heappop
n, m = map(int, input().split())
jobs = {}
for _ in range(n):
  a, b = map(int, input().split())
  if a > m:
    continue
  if a in jobs:
    jobs[a].append(b)
  else:
    jobs[a] = [b]
result = 0
candidates = []
for a in range(1, m + 1):
  if a in jobs:
    for b in jobs[a]:
      heappush(candidates, -b)
  else:
    if len(candidates) == 0:
      continue
  result += -heappop(candidates)
print(result)
r,d,x0 = map(int,input().split())

xlist = []

xlist.append(r*x0-d)

for i in range(9):
    xlist.append(r*xlist[i]-d)
    print(int(xlist[i]))




### FIXED CODE ###


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

if a<=5:
    ans = 0
elif 6<=a and a<=12:
    ans = b/2
else:
    ans = b

print(int(ans))
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
    n,w=map(int,input().split())
    W=[0]*(n+1); V=[0]*(n+1)
    for i in range(1,n+1):
        a,b=map(int,input().split())
        W[i]=a; V[i]=b
    # dp[i][c] iまでの品物で、重さがc以下
    dp=[[-1]*(w+1) for _ in range(n+1)]
    # メモ化再帰
    def solve(i,c):
        if(dp[i][c]!=-1): return dp[i][c]
        if(i==0):
            dp[i][c]=0
            return dp[i][c];
        if(c-W[i]>=0):
            dp[i][c]=max(solve(i-1,c-W[i])+V[i],solve(i-1,c))
            return dp[i][c]
        else:
            dp[i][c]=solve(i-1,c)
            return dp[i][c]
    print(solve(n,w))
resolve()

### FIXED CODE ###

import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
    n,W=map(int,input().split())
    w,v=[0]*n,[0]*n
    for i in range(n):
        w[i],v[i]=map(int,input().split())
    V=sum(v)
    dp=[INF]*(V+1)
    dp[0]=0
    for i in range(n):
        newdp=dp[:]
        for x in range(V+1):
            if(x+v[i]<V+1):
                newdp[x+v[i]]=min(newdp[x+v[i]],dp[x]+w[i])
        dp=newdp
    for i in range(V,-1,-1):
        if(dp[i]<=W):
            print(i)
            return
resolve()
n , m  = map(int, input().split())
l_1 = [] #左から1桁目の数字のりすと
l_2 = [] #左から2桁目の数字のりすと
l_3 = [] #左から3桁目の数字のりすと
nocounter = 0
answer = 100  
 
if m == 0:
  print(0)
else:
  for i in range(m):
    a, b = map(int, input().split())
    if a == 1:
      l_1.append(b)
    elif a == 2:
      l_2.append(b)
    else:
      l_3.append(b)
  pv = l_1[0]
  for j in range(len(l_1)):
    if not pv  == l_1[j]:
      nocounter += 1
    if l_1[j] == 0:
      nocounter += 1
  pv = l_2[0]
  for j in range(len(l_2)):
    if not pv  == l_2[j]:
      nocounter += 1
  pv = l_3[0]
  for j in range(len(l_3)):
    if not pv  == l_3[j]:
      nocounter += 1
  if nocounter > 0:
    print(-1)
  else:
    if n == 1:
      print(l_3[0])
    elif n == 2 and len(l_2)*lemn(l_1) == 1:
      print(10*l_1[0] + l_2[0])
    elif n == 2 and len(l_1) == 0:
      print(10 + l_2[0])
    elif n == 2 and len(l_2) == 0:
      print(10*l_1[0])
    elif len(l_1)*len(l_2)*len(l_3) == 1:
      print(100*l_1[0] + 10*l_2[0] + l_3[0])
    elif len(l_1) == 0:
      print(100 + 10*l_2[0] + l_3[0])
    elif len(l_2) == 0:
      print(100*l_1[0] + l_3[0])
    else:
      print(100*l_1[0] + 10*l_2[0])

### FIXED CODE ###

n , m  = map(int, input().split())
l_1 = [] #左から1桁目の数字のりすと
l_2 = [] #左から2桁目の数字のりすと
l_3 = [] #左から3桁目の数字のりすと
nocounter = 0
 
if m == 0:
  if n == 1:
    print(0)
  elif n == 2:
    print(10)
  else:
    print(100)
else:
  for i in range(m):
    a, b = map(int, input().split())
    if a == 1:
      l_1.append(b)
    elif a == 2:
      l_2.append(b)
    else:
      l_3.append(b)
  if len(l_1) > 0:
    pv = l_1[0]
    for j in range(len(l_1)):
      if not pv  == l_1[j]:
        nocounter += 1
      if l_1[j] == 0 and n > 1:
        nocounter += 1
  if len(l_2) > 0:
    pv = l_2[0]
    for j in range(len(l_2)):
      if not pv  == l_2[j]:
        nocounter += 1
  if len(l_3) > 0:
    pv = l_3[0]
    for j in range(len(l_3)):
      if not pv  == l_3[j]:
        nocounter += 1
  if nocounter > 0:
    print(-1)
  else:
    if n == 1:
      print(l_1[0])
    elif n == 2 and len(l_2)*len(l_1) > 0:
      print(10*l_1[0] + l_2[0])
    elif n == 2 and len(l_1) == 0:
      print(10 + l_2[0])
    elif n == 2 and len(l_2) == 0:
      print(10*l_1[0])
    elif len(l_1)*len(l_2)*len(l_3) > 0:
      print(100*l_1[0] + 10*l_2[0] + l_3[0])
    elif len(l_1) == 0 and len(l_2) == 0:
      print(100 + l_3[0])
    elif len(l_1) == 0 and len(l_3) == 0:
      print(100 + 10*l_2[0])
    elif len(l_1) == 0:
      print(100 + 10*l_2[0] + l_3[0])
    elif len(l_2) == 0 and len(l_3) == 0:
      print(100*l_1[0])
    elif len(l_2) == 0 :
      print(100*l_1[0] + l_3[0])
    else:
      print(100*l_1[0] + 10*l_2[0])
N = int(input())
XYH = [list(map(int, input().split())) for _ in range(N)]
H_list= [XYH[i][2] for i in range(N)]
H_max = max(H_list)
H_min = min(H_list)
H_diff = H_max - H_min
ans = []

# 高さH,中心座標を(Cx, Cy)として総当たりで試す
for H in range(H_max - (200 - H_diff), H_max + (201 - H_diff)):
    for Cx in range(0, 101):
        for Cy in range(0, 101):
            count = 0
            for X, Y, h in XYH:
                if h == max(H - abs(X - Cx) - abs(Y - Cy), 0):
                    count += 1
                else:
                    break

            if count == N:
                ans = [str(Cx), str(Cy), str(H)]

print(' '.join(ans))




### FIXED CODE ###

N = int(input())
if N == 1:
  print('Hello World')
else:
  A = int(input())
  B = int(input())
  print(A + B)
N, M = map(int, input().split())
Ls = []
Rs = []
for _ in range(M):
    L, R = map(int, input().split())
    Ls.append(L)
    Rs.append(R+1)
L_max = max(Ls)
R_min = min(Rs)
print(max(R_min - L_max, 0)

### FIXED CODE ###

N, M = map(int, input().split())
Ls = []
Rs = []
for _ in range(M):
    L, R = map(int, input().split())
    Ls.append(L)
    Rs.append(R+1)
L_max = max(Ls)
R_min = min(Rs)
print(max(R_min - L_max, 0))
n=[]
line=''
i=0
while line != '0':
    line=input()
    if line != '0'
        n.append(int(line))
        i+=1
        print(i)
for x in range(len(n)):
    print('Case %d: %d'%(x, n[x]))

### FIXED CODE ###

n=[]
line=''
while line != '0':
    line=input()
    if line != '0': n.append(int(line))
for x in range(len(n)): print('Case %d: %d'%(x+1, n[x]))
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 30 01:08:52 2020

@author: liang
"""
N, M = map(int,input().split())
sets = list()

for i in range(M):
    s, t = map(int,input().split())
    for st in sets:
        if s in st or t in st:
            st.add(s)
            st.add(t)
            break
    sets.append({s,t})

ans = max([len(st) for st in sets])
print(ans)

### FIXED CODE ###

class UnionFind():
    def __init__(self,n):
        self.n = n
        self.par = [-1]*(n+1)
    
    def find(self,x):
        if self.par[x] < 0:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]
    
    def union(self,x,y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.par[x] > self.par[y]:
            x, y = y, x
        self.par[x] += self.par[y]
        self.par[y] = x

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

for i in range(M):
    a, b = map(int,input().split())
    uf.union(a,b)

ans = -min(uf.par)
print(ans)
K X = map(int,input().split())
if 500*K >= X:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

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

if 500*K >= X:
  print('Yes')
else:
  print('No')
N,M = map(int,input().split())
A = [[] for i in range(N+1)]
B = []
d = {}
for i in range(M):
    p,y = map(int,input().split())
    B.append((p,y))
    A[p].append(y)
for i in range(N+1):
    A[i].sorted
    n = len(A[i])
    for j in range(n):
        d[A[i][j]] = j+1
for i in range(M):
    p,y = B[i]
    q = d[y]
    m = 6 - len(str(p))
    n = 6 - len(str(q))
    ans = "0"*m + str(p) + "0"*m + str(q)

### FIXED CODE ###

N,M = map(int,input().split())
A = [[] for i in range(N+1)]
B = []
d = {}
for i in range(M):
    p,y = map(int,input().split())
    B.append((p,y))
    A[p].append(y)
for i in range(N+1):
    A[i].sort()
    n = len(A[i])
    for j in range(n):
        d[A[i][j]] = j+1
for i in range(M):
    p,y = B[i]
    q = d[y]
    m = 6 - len(str(p))
    n = 6 - len(str(q))
    ans = "0"*m + str(p) + "0"*n + str(q)
    print(ans)
n = map(int, input())
a = map(int, input())
if n%500 < a:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

n = int(input())
a = int(input())
if n % 500 <= a:
  print("Yes")
else:
  print("No")
S = input()
k = S.size()
l = 15 - k
m =S.count("○")
if m + l>= 8:
    print("YES")
else:
    print("NO")


### FIXED CODE ###

S = input()
k = len(S)
l = 15 - k
m =S.count("o")
if m + l>= 8:
    print("YES")
else:
    print("NO")
s=input()
k=int(input())
a2n = lambda c: ord(c) - ord('a') + 1
n2a = lambda c: chr(c+64).lower()
ls=list(s)
i=0
while k>0 and i<len(ls):
  a=(1-a2n(ls[i]))%26
  if k>=a:
    ls[i]='a'
    k-=a
  i+=1
if k>0:
  ls[-1]=n2a(a2n(ls[-1])+k)
print(''.join(ls))

### FIXED CODE ###

s=input()
k=int(input())
a2n = lambda c: ord(c) - ord('a') + 1
n2a = lambda c: chr(c+64).lower()
ls=list(s)
i=0
while k>0 and i<len(ls):
  a=(1-a2n(ls[i]))%26
  if k>=a:
    ls[i]='a'
    k-=a
  i+=1
if k>0:
  ls[-1]=n2a(a2n(ls[-1])+k%26)
print(''.join(ls))
n,m = map(int,input().split())
max_int = 1000000007
a = [0] * m
for i in range(m):
    a[i] = int(input())
piv = 0
b = [1] * (n+1)
if a[0] == 1:
    piv += 1
    b[1] = 0
for i in range(2,n+1):
    if piv == m:
        b[i] = b[i-1] + b[i-2]
        b[i] %= max_int
    elif i == a[piv]:
        piv += 1
        b[i] = 0
    else:
        b[i] = b[i-1] + b[i-2]
        b[i] %= max_int

print(b[n]%max_int)


### FIXED CODE ###

n,m = map(int,input().split())
max_int = 1000000007
a = [-1] * (m+1)
for i in range(m):
    a[i] = int(input())
piv = 0
b = [1] * (n+1)
if a[0] == 1:
    piv += 1
    b[1] = 0
for i in range(2,n+1):
    if i == a[piv]:
        piv += 1
        b[i] = 0
    else:
        b[i] = b[i-1] + b[i-2]
        b[i] %= max_int

print(b[n]%max_int)
n,m,k=map(int,input().split())
arr=list(map(int,input().split()))
brr=list(map(int,input().split()))

sumA=sum(arr)
bpointer=0
ans=0
sumB=0
for i in range(len(arr),-1,-1):
    if i<n:
        sumA-=arr[i]
    if sumA<=k:
        while bpointer<m and sumA+sumB+brr[bpointer]<=k:
            sumB+=brr[bpointer]
            bpointer+=1
    	ans=max(ans,i+bpointer)
print(ans)


### FIXED CODE ###

n,m,k=map(int,input().split())
arr=list(map(int,input().split()))
brr=list(map(int,input().split()))

sumA=sum(arr)
bpointer=0
ans=0
sumB=0
for i in range(len(arr),-1,-1):
    if i<n:
        sumA-=arr[i]
    if sumA<=k:
        while bpointer<m and sumA+sumB+brr[bpointer]<=k:
            sumB+=brr[bpointer]
            bpointer+=1
        ans=max(ans,i+bpointer)
print(ans)
n,m=map(int,input().split())
a=[[] for _ in range(n)]
ans=[None]*n

for i in range(m):
  p,y=map(int,input().split())
  a.append((y,i))
  
for i,b in enumerate(a):
  b.sort()
  for j,(y,k) in b:
    ans[k]='%06d%06d' % (i+1,j+1)
    
print(*ans,sep='\n')

### FIXED CODE ###

n,m=map(int,input().split())
a=[[] for _ in range(n)]
ans=[None]*m

for i in range(m):
  p,y=map(int,input().split())
  a[p-1].append((y,i))
  
for i,b in enumerate(a):
  b.sort()
  for j,(y,k) in enumerate(b):
    ans[k]='%06d%06d' % (i+1,j+1)
    
print(*ans,sep='\n')
num = input().split(' ')
print((int(num[0]) - 1)＊(int(num[1]) - 1)

### FIXED CODE ###

num = input().split(' ')
a = int(num[0]) - 1
b = int(num[1]) - 1
print(a*b)
a=input()
l=[int(i) for i in list(str(a))]
s=0
for i in l:
  s+=i
if a % s==0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a=int(input())
l=[int(i) for i in list(str(a))]
s=0
for i in l:
  s+=i
if a % s==0:
  print("Yes")
else:
  print("No")
def comb(n, r):
  if n <= 0 or r < 0:
    raise ValueError
  r = min(r, n - r)
  if r == 0:
    return 1
  return (n - r + 1) * comb(n, r - 1) // r

N, K = list(map(int, input().split()))
for i in range(K):
  if N - K + 1 < i + 1:
    print('0')
    continue
  print(comb(N - K + 1, i + 1) * comb(K - 1, i) % (10 ** 9 + 7))

### FIXED CODE ###

def comb(n, r):
  if n < 0 or r < 0:
    raise ValueError
  r = min(r, n - r)
  if n == 0 or r == 0:
    return 1
  return (n - r + 1) * comb(n, r - 1) // r

N, K = list(map(int, input().split()))
for i in range(K):
  if N - K + 1 < i + 1:
    print('0')
    continue
  print(comb(N - K + 1, i + 1) * comb(K - 1, i) % (10 ** 9 + 7))
def main():
  x = int(input())
  sosu = [2]
  tgt = 2
  is_sosu = True
  while(1):
    for i in sosu:
      if tgt % i = 0:
        flag = False
        break
    if tgt < x:
      sosu.append(tgt)
      tgt += 1
    else:
      print(tgt)
      break

if __name__ == "__main__":
  main()

### FIXED CODE ###

def main():
  x = int(input())
  sosu = []
  tgt = 2
  is_sosu = True
  while(1):
    for i in sosu:
      if tgt % i == 0:
        is_sosu = False
        break
    if is_sosu:
      sosu.append(tgt)
    if tgt >= x and is_sosu:
      print(tgt)
      break
    else:
      tgt += 1
      is_sosu = True

if __name__ == "__main__":
  main()
h,w  = map(int,input().split())
n = int(input())
a = list(map(int,input().split()))
res = []
for _ in range(h):
    res.append("")
line = 0

def insert(res,i,l):
    if l %2 == 0:
        res[l] = res[l] + str(i+1)
    else:
        res[l] = str(i+1) + res[l]

for i in range(0,n):
    ammount=a[i]
    while len(res[line]) < w and ammount > 0:
        insert(res,i,line)
        ammount -= 1
    if len(res[line]) == w:
        line += 1
    while ammount >= w:
        res[line] = str(i+1) * w
        ammount -= w
        line += 1
    if ammount > 0:
        res[line] = str(i+1) * ammount

print('\n'.join(map(str, res)))

### FIXED CODE ###

h,w  = map(int,input().split())
n = int(input())
a = list(map(int,input().split()))
res = []
for _ in range(h):
    res.append([])
line = 0

def insert(res,i,l):
    if l %2 == 0:
        res[l].append(str(i+1))
    else:
        res[l].insert(0,str(i+1))

for i in range(0,n):
    ammount=a[i]
    while len(res[line]) < w and ammount > 0:
        insert(res,i,line)
        ammount -= 1
    if len(res[line]) == w:
        line += 1
    while ammount >= w:
        res[line] = [str(i+1) for _ in range(w)]
        ammount -= w
        line += 1
    if ammount > 0:
        res[line] = [str(i+1) for _ in range(ammount)]

for i in range(0,h):
    print(' '.join(res[i]))
n = int(input())
sl = [i for i in input().split()]
print(["Three", "Four"][len(set(sl)) == 4]

### FIXED CODE ###

n = int(input())
sl = [i for i in input().split()]
print(["Three", "Four"][len(set(sl)) == 4])
N = int(input())
Hs = [int(i) for i in input().split()]

ans = []
cnt = 0
for i in range(1, N):
    if Hs[i-1] >= Hs[i]:
        cnt += 1
    else:
        ans.append(cnt)
        cnt = 0
if cnt != 0:
    ans.append(cnt)
print(max(ans))


### FIXED CODE ###

N = int(input())
Hs = [int(i) for i in input().split()]

ans = []
cnt = 0
for i in range(1, N):
    if Hs[i-1] >= Hs[i]:
        cnt += 1
    else:
        ans.append(cnt)
        cnt = 0
if cnt != 0:
    ans.append(cnt)
if N == 1:
    ans = [0]
print(max(ans))
def main():
    N, M = map(int, input().split())
    P = {tuple(map(int, input().split())) for _ in range(M)}
    P = sorted(P)
    ans = [0 for _ in range(N)]

    if N > 1 and (1, 0) in P:
        print(-1)
        return

    if N > 1 and P[0][0] != 1:
        ans[0] = 1

    for i in range(len(P) - 1):
        if P[i][0] == P[i + 1][0]:
            print(-1)
            return

    for p in P:
        ans[p[0] - 1] = p[1]

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


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    N, M = map(int, input().split())
    P = {tuple(map(int, input().split())) for _ in range(M)}
    P = sorted(P)
    ans = [0 for _ in range(N)]

    if N == 1 and M == 0:
        print(0)
        return

    if N == 2 and M == 0:
        print(10)
        return

    if N == 3 and M == 0:
        print(100)
        return

    if N > 1 and (1, 0) in P:
        print(-1)
        return

    if N > 1 and P[0][0] != 1:
        ans[0] = 1

    for i in range(len(P) - 1):
        if P[i][0] == P[i + 1][0]:
            print(-1)
            return

    for p in P:
        ans[p[0] - 1] = p[1]

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


if __name__ == "__main__":
    main()
N = int(input())
S = str(input())
lst_for_ans = []
for i in range(len(S)):
       I_count = S[:i].count("I")
       D_count = S[:i].count("D")
       lst_for_ans.append(I_count - D_count)

       print(max(lst_for_ans,0))

### FIXED CODE ###

N = int(input())
S = str(input())
lst_for_ans = []
for i in range(len(S)+1):
       I_count = S[:i].count("I")
       D_count = S[:i].count("D")
       lst_for_ans.append(I_count - D_count)

print(max(max(lst_for_ans),0))
N = int(input())
a = map(int, input().split())
a.sort()
print(sum(a[0::2])-sum(a[1::2]))

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
print(sum(a[0::2])-sum(a[1::2]))
N = int(input())
A = list(map(int,input.split()))
Sum = 0

for i in range(N-1):
  Sum += A[i+1] - A[i]
 
print(Sum)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
Sum = 0

for i in range(N-1):
  if(A[i] - A[i+1] > 0):
    Sum += A[i] - A[i+1]
    A[i+1] += A[i] - A[i+1]
 
print(Sum)
N = int(input())
 
ans = [0 for _ in range(10050)]
for x in range(1,int(N**0.5)):
  for y in range(1,int(N**0.5)):
    for z in range(1,int(N**0.5)):
      n = x**2 + y**2 + z**2 + x*y + y*z + z*x
      ans[n] += 1

for i in range(N):
  print(ans[i+1])

### FIXED CODE ###

n = int(input())
a = [0]*(n+1)
for i in range(1, 102):
    for j in range(1, 102):
        for k in range(1, 102):
            if (i*i + j*j + k*k + i*j + j*k + i*k) <= n:
                a[i*i + j*j + k*k + i*j + j*k + i*k] +=1
                
for x in a[1:]:
    print(x)
s = input()
n = s.count("o")
print(100 × n + 700)

### FIXED CODE ###

s = input()
n = s.count("o")
print(100 * n + 700)
n=int(input())
def f(k):
  m=len(str(k))
  a=0
  for i in range(m):
    a+=str(k)[i]
  return a
if n%f(n)==0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n=int(input())
def f(k):
  m=len(str(k))
  a=0
  for i in range(m):
    a+=int(str(k)[i])
  return a
if n%f(n)==0:
  print("Yes")
else:
  print("No")