Harryxun/stf_run huggingface dataset:
t=input()
n=len(t)
a=[0]*n
for i in range(n):
    a[i]=t[i]

for i in range(n):
    if a[i]=="?":
        if a[i-1]=="D" and a[i+1]=="?":
            a[i]=="p"
        elif a[i-1]=="P" and a[i+1]=="?":
            s[i]=="D"
        elif a[i-1]=="P":
            a[i]=="D"
        else:
            a[i]=="D"
    #print(a)

s=''.join(a)
print(s)


### FIXED CODE ###

t=input()
n=len(t)
a=[0]*n
for i in range(n):
    a[i]=t[i]

for i in range(n):
    if a[i]=="?":
        if i!=n-1:
            if a[i-1]=="D" and a[i+1]=="?":
                a[i]="P"
            elif a[i-1]=="P" and a[i+1]=="?":
                a[i]="D"
            elif a[i-1]=="D" and a[i+1]=="D":
                a[i]="P"
            else:
                a[i]="D"
        else:
            a[i]="D"
    #print(a)

s=''.join(a)
print(s)
from functools import reduce
from collections import Counter
n = int(input())
d = [int(s) for s in input().split()]
c = Counter(d)
ds = [0] * (max(c.keys()) + 1)
for k, v in c.items():
  ds[k] = v
print(reduce(lambda x, y: x * y, (x ** y for x, y in zip(ds[:-1], ds[1:])), 1) if ds[0] == 1 and d[0] = 0 else 0)



### FIXED CODE ###

from collections import Counter
from functools import reduce
n = int(input())
d = (int(s) for s in input().split())
if next(d) != 0:
    print(0)
    quit(0)
c = Counter(d)
if c[0] != 0:
    print(0)
    quit(0)
print(reduce(lambda x, y: x * y, (c[k - 1] ** x if k > 1 else 1 for k, x in c.items()), 1) % 998244353)
n,m=map(int(input().split()))
print(max(-1,n-sum(list(map(int,input().split())))))

### FIXED CODE ###

n,m=map(int,input().split())
print(max(-1,n-sum(list(map(int,input().split())))))
n,m=map(int,input().split())

li=[1]*(n+1)

se=set()
se.add(1)
for  i in range(m):
	x,y=map(int,input().split())
	li[x]-=1
	li[y]+=1
	print(li)
	if x in se:
		se.add(y)
	if li[x]==0:
		se.remove(x)
print(len(se))

### FIXED CODE ###

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

li=[1]*(n+1)

se=set()
se.add(1)
for  i in range(m):
	x,y=map(int,input().split())
	li[x]-=1
	li[y]+=1
	if x in se:
		se.add(y)
		if li[x]==0:
			se.remove(x)
print(len(se))
N,K=mapp(int,input().split())

print(min(N%K,abs(N%K-K)))

### FIXED CODE ###

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

print(min(N%K,abs(N%K-K)))
import collections

#文字列を一文字ずつ取得したいとき
def inputStrOnebyOne():
    s = list(input())
    return s

#整数を一つずつリストに入れる
def inputOnebyOne_Int():
    a = list(int(x) for x in input().split())
    return a

def main():
    a,b = input().split()
    c,d = input().split("-")
    if a == str(len(c)) and b == str(len(d)):
        print("Yes")
    else:
        print("No")

if __name__=='__main__':
    main()

### FIXED CODE ###

import collections

#文字列を一文字ずつ取得したいとき
def inputStrOnebyOne():
    s = list(input())
    return s

#整数を一つずつリストに入れる
def inputOnebyOne_Int():
    a = list(int(x) for x in input().split())
    return a

def main():
    a,b = input().split()
    s = input()
    if s.count("-") == 1:
        c,d = s.split("-")
        if a == str(len(c)) and b == str(len(d)):
            print("Yes")
        else:
            print("No")
    else:
        print("No")

if __name__=='__main__':
    main()
import fractions
n = int(input())
mod = 10**9 + 7
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, n):
    ans = ans * a[i] // fractions.gcd(ans, a[i])
b = []
for i in range(n):
    an = ans / a[i]
    b.append(an)

print(int(sum(b) % mod))

### FIXED CODE ###

import fractions
n = int(input())
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, n):
    ans = ans * a[i] // fractions.gcd(ans, a[i])
b = []
b_sum = 0
mod = 10**9+7
for i in range(n):
    b_sum += (ans // a[i])

print(b_sum % mod)
from sys import stdin
import math
import fractions
from collections import deque
from collections import Counter
import itertools

INF = 10 ** 10


# N個の部屋とM本の通路
N, M = [int(x) for x in stdin.readline().rstrip().split()]

route = [[] for _ in range(M+1)]

for _ in range(M):
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    route[A].append(B)
    route[B].append(A)


kyori_to_1 = [INF for _ in range(N+1)]
kyori_to_1[1] = 0

miti = [0 for _ in range(N+1)]
miti[0] = -1
miti[1] = -1

is_visited = [False for _ in range(N+1)]

# 幅優先探索
# 試すべき位置をキューで管理
que = deque([1])

# キューが空じゃなければ
while len(que) != 0:
    now = que.popleft()
    
    if is_visited[now]:
        continue

    is_visited[now] = True

    for place in route[now]:
        que.append(place)

        if kyori_to_1[now]+1 < kyori_to_1[place]:
            kyori_to_1[place] = kyori_to_1[now]+1
            miti[place] = now

if 0 in miti:
    print("No")
else:
    for i in range(1, N+1):
        if i == 1:
            print("Yes")
        else:
            print(miti[i])


### FIXED CODE ###

from sys import stdin
import math
import fractions
from collections import deque
from collections import Counter
import itertools

INF = 10 ** 10


# N個の部屋とM本の通路
N, M = [int(x) for x in stdin.readline().rstrip().split()]

route = [[] for _ in range(N+1)]

for _ in range(M):
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    route[A].append(B)
    route[B].append(A)


kyori_to_1 = [INF for _ in range(N+1)]
kyori_to_1[1] = 0

miti = [0 for _ in range(N+1)]
miti[0] = -1
miti[1] = -1

is_visited = [False for _ in range(N+1)]

# 幅優先探索
# 試すべき位置をキューで管理
que = deque([1])

# キューが空じゃなければ
while len(que) != 0:
    now = que.popleft()
    
    if is_visited[now]:
        continue

    is_visited[now] = True

    for place in route[now]:
        que.append(place)

        if kyori_to_1[now]+1 < kyori_to_1[place]:
            kyori_to_1[place] = kyori_to_1[now]+1
            miti[place] = now

if 0 in miti:
    print("No")
else:
    for i in range(1, N+1):
        if i == 1:
            print("Yes")
        else:
            print(miti[i])
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 16 19:31:10 2019
ABC118D
@author: maezawa
"""

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

nmatch = [2,5,5,4,5,6,3,7,6]
rmatch = list(reversed(nmatch))

a_n = [(ai, nmatch[ai-1]) for ai in a]
a_n.sort(key = lambda x: x[0], reverse=True)
a_n.sort(key = lambda x: x[1])
a_n2 = [ai[1] for ai in a_n]
#print(a_n)

for j in range(1, m):
    number = a_n[0][0]
    n_order = n // a_n[0][1] - j
    rem = n % a_n[0][1] + a_n[0][1]*j
    ans = str(number) * n_order
    
    if rem in a_n2:
        one = a_n[a_n2.index(rem)][0]
        if number > one:
            ans = ans+str(one)
        else:
            ans = str(one)+ans
        break
            
print(ans)




### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sat Feb 16 19:31:10 2019
ABC118D
@author: maezawa
"""
import copy

n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort(reverse=True)

nmatch = [2,5,5,4,5,6,3,7,6]
rmatch = list(reversed(nmatch))
nmdic = dict([(i+1,nmatch[i]) for i in range(9)])
#nums = [[],[],[1],[7],[4],[2,3,5],[6,9],[8]]
nums = [[] for _ in range(10)]
for  i in a:
    nums[nmdic[i]].append(i)
        
#print(nmdic)
#print(nums)

dp = [[-1,[]] for _ in range(n+1)]
dp[0] = [0, []]
#print(dp)

for i in range(1, n+1):
    cnds = []
    for k in a:
        j = nmdic[k]
        if i-j < 0:
            continue
        if dp[i-j][0] == -1:
            continue
        cndo = dp[i-j][0]+1
        cndos = copy.copy(dp[i-j][1])
        cndos.append(max(nums[j]))
        cnds.append([cndo, cndos])
        #print(i, i-j, cnds, cndos)
    if cnds == []:
        continue
    dp[i] = max(cnds, key=lambda x: x[0])

ans = ''.join(map(str, sorted(dp[n][1], reverse=True)))
print(ans)
h,a=[int(i)for i in input().split()]
if h%a==0:
  print(h//a)
else:
  print(''h//a+1)

### FIXED CODE ###

h,a=[int(i)for i in input().split()]
if h%a==0:
  print(h//a)
else:
  print(h//a+1)
n = int(input())
a_array = [int(x) for x in input().split()]
sum_a = sum(a_array)
if sum_a % 2 == 0:
    sum_a = int(sum_a/len(a_array))
    ans = 0
    for a in a_array:
        ans += abs(sum_a-a)**2
    print(sum_a)
    print(int(ans))
else:
    sum_a1 = int(sum_a/len(a_array))
    sum_a2 = int(sum_a/len(a_array))+1
    ans1 = 0
    ans2 = 0
    for a in a_array:
        ans1 += abs(sum_a1-a)**2
        ans2 += abs(sum_a2-a)**2
    print(int(min(ans1, ans2)))

n = int(input())
a_array = [int(x) for x in input().split()]
ans = float("inf")
for i in range(-100, 101):
    tmp = 0
    for a in a_array:
        tmp += abs(a-i)**2
    ans = min(ans, tmp)
print(ans)

### FIXED CODE ###

num = int(input())

val = [int(x) for x in input().split()]

val2 = [int(x) for x in range(min(val), max(val))]


array = []
for i in val2:
    res = 0
    for j in val:
        res += pow(abs(i - j), 2)
    array.append(res)
print(min(array) if len(array) != 0 else 0)
a = input(int())

print(a*(a+1)/2)

### FIXED CODE ###

n=int(input())
     
sum=n*(n+1)/2
     
print(int(sum))
from pprint import pprint
import heapq

def solve(n, a, b):
    b_pq = []
    b_rev = {}
    delete = []
    for i, b_i in enumerate(b):
        if b_i == a[i]:
            delete.append(i)
            continue
        heapq.heappush(b_pq, (-1 * b_i, i))

    for i in sorted(delete, reverse=True):
        a.pop(i)

    count = 0
    while b_pq:
        tmp = heapq.heappop(b_pq)
        # pprint(tmp)
        b_i = tmp[0] * -1
        i_b = tmp[1]
        # print(i_b, b_i)
        i_a = (i_b - 1 + n) % n
        i_c = (i_b + 1) % n
        b_cand = b_i
        if b_cand - b[i_a] - b[i_c] < a[i_b]:
            continue

        #while b_cand - b[i_a] - b[i_c] >= a[i_b]:
        #    b_cand = b_cand - b[i_a] - b[i_c]
        #    count += 1
        tmp_count =  (b_cand - a[i_b]) // (b[i_a] + b[i_c])
        b_cand -= (b[i_a] + b[i_c]) * tmp_count
        count += tmp_count

        b[i_b] = b_cand
        heapq.heappush(b_pq, (-1 * b_cand, i_b))
        # print("count: ", count)
        # pprint(b)
        if b_cand == a[i_b] and b == a:
            return count
    
    return -1


if __name__ == '__main__':

    n = int(input().strip())
    a = list(map(int, input().strip().split(" ")))
    b = list(map(int, input().strip().split(" ")))
    print(solve(n, a, b))

### FIXED CODE ###

from pprint import pprint
import heapq

def solve(n, a, b):
    b_pq = []
    b_rev = {}
    delete = []
    for i, b_i in enumerate(b):
        if b_i == a[i]:
            continue
        heapq.heappush(b_pq, (-1 * b_i, i))

    count = 0
    while b_pq:
        tmp = heapq.heappop(b_pq)
        # pprint(tmp)
        b_i = tmp[0] * -1
        i_b = tmp[1]
        # print(i_b, b_i)
        i_a = (i_b - 1 + n) % n
        i_c = (i_b + 1) % n
        b_cand = b_i
        if b_cand - b[i_a] - b[i_c] < a[i_b]:
            continue

        #while b_cand - b[i_a] - b[i_c] >= a[i_b]:
        #    b_cand = b_cand - b[i_a] - b[i_c]
        #    count += 1
        tmp_count =  (b_cand - a[i_b]) // (b[i_a] + b[i_c])
        b_cand -= (b[i_a] + b[i_c]) * tmp_count
        count += tmp_count

        b[i_b] = b_cand
        if b_cand != a[i_b]:
            heapq.heappush(b_pq, (-1 * b_cand, i_b))
        # print("count: ", count)
        # pprint(b)
         

        if b_cand == a[i_b] and b == a:
            return count
    
    return -1


if __name__ == '__main__':

    n = int(input().strip())
    a = list(map(int, input().strip().split(" ")))
    b = list(map(int, input().strip().split(" ")))
    print(solve(n, a, b))
from itertools import accumulate
N,K=map(int,input().split())
A=list(map(int,input().split()))
imos=[0 for i in range(N+1)]
ANS=[str(N)]*N
if K>=40:
  ans=" ".join(ANS)
  print(ans)
else:
  for t in range(K):
    for i in range(N):
      l=max(0,i-A[i])
      r=min(N,i+A[i]+1)
      imos[l]+=1
      imos[r]-=1
    imos=lisT(accumulate(imos))
    for i in range(0,N):
      A[i]=imos[i]
    imos=[0 for i in range(N+1)]
  for i in range(N):
    A[i]=str(A[i])
  ans=" ".join(A)
  print(ans)  

### FIXED CODE ###

N,K=map(int,input().split())
A=list(map(int,input().split()))
imos=[0 for i in range(N+1)]
ANS=[str(N)]*N
if K>=50:
  ans=" ".join(ANS)
  print(ans)
else:
  for t in range(K):
    for i in range(N):
      l=max(0,i-A[i])
      r=min(N,i+A[i]+1)
      imos[l]+=1
      imos[r]-=1
    for i in range(0,N):
      imos[i+1]+=imos[i]
      A[i]=imos[i]
    imos=[0 for i in range(N+1)]
  for i in range(N):
    A[i]=str(A[i])
  ans=" ".join(A)
  print(ans)
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

def main():
    
    x, y = map(int, readline().split())
    if (x+y)%3!=0:
        print(0)
        return
    n = (x+y)//3
    o = cmb(n, min((2*y-x)//3, (2*x-y)//3))
    o = o % (10**9+7)
    print(o)

if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def main():
    
    x, y = map(int, readline().split())
    if (x+y)%3!=0:
        print(0)
        return
    n = (x+y)//3
    a, b = (2*y-x)//3, (2*x-y)//3
    if a<0 or b<0:
        print(0)
        return
    o = cmb(n, a)
    o = o % (10**9+7)
    print(o)

if __name__ == "__main__":
    main()
S = str(input())

def plus(a,b,c):
    x = a[0:b+1] + c + a[b+1:len(a)]
    return(x)
A = [S]
while len(A) != 2**(len(S)):
    for i in range(len(S)-1):
        for j in range(len(A)):
            x = A[j]
            y = plus(x,i,'+')
            A.append(y)
s = 0
for i in range(len(A)):
    x = A[i]
    p = 0
    q = 0
    for j in range(len(x)):
        if x[j] == '+':
            q = j - 1
            m = x[p:q]
            s += int(m)
            p = j + 1
        elif j == len(x):
            q = len(x)
            m = x[p:q]
            s += int(m)
print(s)
            
        
        
    
    

### FIXED CODE ###

S = input()
n = len(S)
ans = 0
for i in range(2**(n-1)):
    s = S[0]
    for j in range(n-1):
        if (i >> j) & 1:
            s += '+'
        s += S[j+1]
    ans += eval(s)
print(ans)
n = int(input())
a = [int(i) for i in input().split()]
s0 = a[0]
count=0

i=0
while a[i]!=0and i!=n-1:i++
if a[i]>0:
  s0+=1
  count+=1
else:
  s0-=1
  count+=1
  

  for i in range(1,n):
  s1 = s0+a[i]
  if s0*s1>=0:
    if s1>0:
      a[i]-=(abs(s1)+1)
      count+=(abs(s1)+1)
    elif s1<0:
      a[i]+=(abs(s1)+1)
      count+=(abs(s1)+1)
    elif s1==0:
      if s0>0:
        a[i]-=1
        count+=1
      elif s0<0:
        a[i]+=1
        count+=1
  s0 += a[i]
print(count)

### FIXED CODE ###

import copy
n = int(input())
a = [int(i) for i in input().split()]
b=a.copy()
s0p = a[0]
s0n = b[0]
countp = 0
countn = 0

if a.count(0)==n:
  print(2*n-1)
  exit()

if s0p<=0:
  s0p+=(abs(a[0])+1)
  countp+=(abs(a[0])+1)
  
if s0n>=0:
  s0n-=(abs(b[0])+1)
  countn+=(abs(b[0])+1)

for i in range(1,n):
  s1 = s0p+a[i]
  if s0p*s1>=0:
    if s1>0:
      a[i]-=(abs(s1)+1)
      countp+=(abs(s1)+1)
    elif s1<0:
      a[i]+=(abs(s1)+1)
      countp+=(abs(s1)+1)
    elif s1==0:
      if s0p>0:
        a[i]-=1
        countp+=1
      elif s0p<0:
        a[i]+=1
        countp+=1
  s0p += a[i]

for i in range(1,n):
  s1 = s0n+b[i]
  if s0n*s1>=0:
    if s1>0:
      b[i]-=(abs(s1)+1)
      countn+=(abs(s1)+1)
    elif s1<0:
      b[i]+=(abs(s1)+1)
      countn+=(abs(s1)+1)
    elif s1==0:
      if s0n>0:
        b[i]-=1
        countn+=1
      elif s0n<0:
        b[i]+=1
        countn+=1
  s0n += b[i]
  
print(countp if countp<=countn else(countn))
#python3
cnt = 0
s = 1
def main():
    n = int(input())
    a = [int(i) for i in input().split()]

    def solve(ar):
        global cnt
        global s
        idx = 0
        f = False
        for i in range(len(ar)):
            if s == ar[i]:
                idx = i
                cnt += 1
                f = True
                break
        if (not f) or (idx>n):
            return 
        s += 1
        solve(ar[idx+1:])
        return cnt

    p = solve(a)
    print(n-p) if p else print(-1)
main()


### FIXED CODE ###

#python3
def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    k = 1
    for i in range(n):
        if a[i] == k:
            k += 1
    k -= 1
    print(n - k) if k else print(-1)  

main()
x=int(input())
c=1
for i in range(1,x):
  for j in range(2,x):
    if b**j<=x:
      c=max(c,b**j)
    else:
      break
print(c)

### FIXED CODE ###

x=int(input())
c=1
for i in range(1,x):
  for j in range(2,x):
    if i**j<=x:
      c=max(c,i**j)
    else:
      break
print(c)
a,b=input().split()
c=input()
c[b-1]=c[b-1].upper()
print(c)


### FIXED CODE ###

n,k=map(int,input().split())
s=input()
print(s[:k-1]+s[k-1].lower()+s[k:])
n,m = map(int,input().split())
ts = [list(map(int,input().split()))[::-1]]

count += 0
t = 0

for i in range(m):
  if ts[i][1]>=t:
    count+=1
    t = ts[i][0]
    
print(count)

### FIXED CODE ###

n,m = map(int,input().split())
ts = [list(map(int,input().split()))[::-1] for j in range(m)]

ts.sort()

count = 0
t = 0

for j in range(m):
  if ts[j][1]>=t:
    count+=1
    t = ts[j][0]
    
print(count)
def score(x):
    s=0;t=1
    for _ in[0]*10:
        a=2;b=3
        if x[t]==10:a=1
        elif x[t]+x[t+1]!=10:b=2
        s+=sum(x[t:t+b]);t+=a
    return x[0],s

while 1:
    n=int(input())
    if n==0:break
    A=sorted([score(map(int,input().split())) for _ in [0]*n])
    for a,b in sorted(A,key=lambda x:-x[1]):print(a,b)

### FIXED CODE ###

def score(x):
    s=0;t=1
    for _ in[0]*10:
        a=2;b=3
        if x[t]==10:a=1
        elif x[t]+x[t+1]!=10:b=2
        s+=sum(x[t:t+b]);t+=a
    return x[0],s

while 1:
    n=int(input())
    if n==0:break
    A=sorted([score(list(map(int,input().split()))) for _ in [0]*n])
    for a,b in sorted(A,key=lambda x:-x[1]):print(a,b)
R,G = map(float, input().split())

X = 2*G - R
print(int(X))

### FIXED CODE ###

R = int(input())
G = int(input())
X = 2*G - R
print(X)
n=int(input())
A=list(input(int,input().split()))
 
dp=list(range(0,n))
dp[0]=0
dp[1]=abs(A[1]-A[0])
for i in range(n-2):
  temp1=dp[i]+abs(A[i+2]-A[i])
  temp2=dp[i+1]+abs(A[i+2]-A[i+1])
  dp[i+2]=min(temp1,temp2)
 
print(dp[n-1])

### FIXED CODE ###

n=int(input())
A=list(map(int,input().split()))
 
dp=list(range(0,n))
dp[0]=0
dp[1]=abs(A[1]-A[0])
for i in range(n-2):
  temp1=dp[i]+abs(A[i+2]-A[i])
  temp2=dp[i+1]+abs(A[i+2]-A[i+1])
  dp[i+2]=min(temp1,temp2)
 
print(dp[n-1])
N = int(input())
rest = {}
cities = []
for i in range(N):
    k,s = input().split()
    if k not in rest:
        rest[k] = []
        cities.append(k)
    rest[k].append([int(s),i+1])
print(sorted(rest))
cities = cities.sort()
for k in cities:
    rest[k].sort(reverse = True)
    for i in rest[k]:
        print(i[1])

### FIXED CODE ###

a, b = map(int, input().split()) 
print((3*a + b) // 2)
N = int(input())
S = int(input())


def f(b, n):
    s = 0
    while n > 0:
        s += n % b
        n //= b
    return s


num = -1
for i in range(2, int(N ** 0.5) + 1):
    if f(i, N) == S:
        num = i
        break


if num == -1:
    for i in range(int(N ** 0.5) + 1, 0, -1):
        if (N - S) % i == 0:
            b = (N - S) // i + 1
            if f(b, N) == S:
                num = b
                break

print(num)


### FIXED CODE ###

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


def f(b, n):
    if n < b:
        return n
    else:
        return f(b, n // b) + n % b


if N == S:
    print(N + 1)
    exit()
elif N < S:
    print(-1)
    exit()

num = -1
for i in range(2, int(N ** 0.5) + 1):
    if f(i, N) == S:
        num = i
        break


if num == -1:
    for i in range(int(N ** 0.5) + 1, 0, -1):
        if (N - S) % i == 0:
            b = (N - S) // i + 1
            if f(b, N) == S:
                num = b
                break

print(num)
N,M = map(int, input().split())
A = [[int(a) for a in input().split()] for _ in range(N)]

L = [0]*(M+1)
I = [0]*N
ans = N
flag = True
while flag:
    cnt = [0]*(M+1)
    for i in range(N):
        while I[i] < N and L[A[i][I[i]]] == 1:
            I[i] += 1
        if I[i] == N:
            flag = False
            break
        cnt[A[i][I[i]]] += 1
        I[i] += 1
    num = max(cnt)
    ans = min(ans, num)
    for i in range(1, M+1):
        if cnt[i] == num:
            L[i] = 1
    if sum(L) == M:
        flag = False

print(ans)

### FIXED CODE ###

N,M = map(int, input().split())
A = [[int(a) for a in input().split()] for _ in range(N)]

L = [0]*(M+1) #L[i]:0ならスポーツiを含める、1なら含めない
I = [0]*N #A[i][I[i]]:人iが参加するスポーツ
ans = N
flag = True
while flag:
    cnt = [0]*(M+1)
    for i in range(N):
        while I[i] < N and L[A[i][I[i]]] == 1:
            I[i] += 1
        if I[i] == N:
            flag = False
            break
        cnt[A[i][I[i]]] += 1
    if flag:
        num = max(cnt)
        ans = min(ans, num)
        for i in range(1, M+1):
            if cnt[i] == num:
                L[i] = 1
    if sum(L) == M:
        flag = False

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

int cnt=0

while True:
    exist_odd = False
    for a in A:
        if a % 2 == 0:
            continue
        else:
            exist_odd = True
            break 
    if exist_odd: 
        break
    A = [a/2 for a in A]
    cnt = cnt + 1
print(cnt)

### FIXED CODE ###

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

# n = 5
# A = [2,4, 6]

cnt = 0

flag=True
while flag:
    for a in A:
        if a % 2 == 0:
            continue
        else:
            flag=False
            break 
    if not flag: 
        break
    A = [a/2 for a in A]
    cnt = cnt + 1
print(cnt)
h=(int)input()
w=(int)input()
n=(int)input()

if h < w:
    a =w
else:
    a=h

ans=n/a
if n%a > 0:
    ans+=1

print(ans)

### FIXED CODE ###

h = int(input())
w = int(input())
n = int(input())

a = 0
ans = 0

if h < w:
    a = w
else:
    a = h

ans = n // a
# int(ans)
if n % a > 0:
    ans += 1

print(ans)
H, W = map(int, input().split())
S = [list(map(str,input())) for i in range(H)]

if S[0][0] == '#' and S[0][1] == S[1][0] == '.':
    print('No')
elif S[0][H-1] == '#' and S[0][H-2] == S[1][H-1] == '.':
    print('No')
elif S[W-1][0] == '#' and S[W-2][0] == S[W-1][1] == '.':
    print('No')
elif S[W-1][H-1] == '#' and S[W-2][H] == S[W][H-2] == '.':
    print('No')
else:
    print('Yes')

### FIXED CODE ###

H, W = map(int, input().split())

#H x Wのマスを全て"."の行列で覆う （H+2 x W+2） 
S1 = [list(map(str,input())) for i in range(H)]
for i in range(H):
    S1[i].insert(0,'#')
    S1[i].append('#')
S = S = [['#'] * (W + 2)] + S1 + [['#'] * (W + 2)]

cnt = 0

for i in range(1,H):
    for j in range(1,W):
        if S[i][j] == '#':
            if S[i-1][j] == S[i][j-1] == S[i][j+1] == S[i+1][j] == '.':
                cnt += 1
if cnt == 0:
    print('Yes')
else:
    print('No')
i = [int(input()) for i in range(3)]

if i[0]==1:
  print("Hello World")
else:
  print(i[1]+i[2])

### FIXED CODE ###

n = int(input())
if n==1:
  print("Hello World")
else:
  i = [int(input()) for i in range(2)]
  print(i[0]+i[1])