Harryxun/stf_run huggingface dataset:
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    H,W,h,w = LI()
    if W%w != 0:
        s = [0]+[1000]*(w-1)
        for i in range(W-w+1):
            s.append(s[-w]-1)
        a = [s[i]-s[i-1] for i in range(1,W+1)]
        print("Yes")
        for i in range(H):
            print(*a)
    elif H%h != 0:
        H,W,h,w = W,H,w,h
        s = [0]+[1000]*(w-1)
        for i in range(W-w+1):
            s.append(s[-w]-1)
        a = [s[i]-s[i-1] for i in range(1,W+1)]
        print("Yes")
        ans = [[a[i]]*W for i in range(H)]
        for i in range(H):
            print(*ans[i])
    else:
        print("No")
    return

#Solve
if __name__ == "__main__":
    solve()


### FIXED CODE ###

#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    H,W,h,w = LI()
    if W%w != 0:
        s = [0]+[100000]*(w-1)
        for i in range(W-w+1):
            s.append(s[-w]-1)
        a = [s[i]-s[i-1] for i in range(1,W+1)]
        print("Yes")
        for i in range(H):
            print(*a)
    elif H%h != 0:
        H,W,h,w = W,H,w,h
        s = [0]+[100000]*(w-1)
        for i in range(W-w+1):
            s.append(s[-w]-1)
        a = [s[i]-s[i-1] for i in range(1,W+1)]
        print("Yes")
        ans = [[a[i]]*H for i in range(W)]
        for i in range(W):
            print(*ans[i])
    else:
        print("No")
    return

#Solve
if __name__ == "__main__":
    solve()
s = input()
ans = 'x' * len(s)
print(len(input()) * 'x')

### FIXED CODE ###

s = input()
ans = 'x' * len(s)
print(ans)
from math import gcd
a,b,c,d=map(int,input().split())
e=c*d//gcd(c,d)
print(b-(a-1)+(a-1)//c-b//c+(a-1)//d-b//d+b//e-(a-1)//e)


### FIXED CODE ###

import math
a,b,c,d=map(int,input().split())
x=b-b//c-b//d+b//(c*d//math.gcd(c,d))
y=(a-1)-(a-1)//c-(a-1)//d+(a-1)//(c*d//math.gcd(c,d))
print(x-y)
n,m=map(int,input().split()):
  if n==m
  print(yes)
  if n!=m
  print(no)

### FIXED CODE ###

N,M=map(int,input().split())
if N==M:
  print("Yes")
else:
  print("No")
#????????§??\????????\??????????????????
list1 = [int(i) for i in input().split()]
print("{0} {1}",.format(list1[0]+list[1],list1[0]*list1[1]))

### FIXED CODE ###

item = [int(i) for i in input().split()]
print(item[0]*item[1],2*(item[0]+item[1]))
N = int(input())
if N == 1:
  print("Hallo World")
  else:
    list = []
    for _ in range(N):
      list.append(int(input()))
    A,B = list
    print(A+B)
    
    

### FIXED CODE ###

#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
if N == 1:
    print('Hello World')
else:
    A,B = [int(input()),int(input())]
    print(A +B)
a = input()
if a.count(5)==2 and a.count(7)==1:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a = list(map(int, input().split()))
b = a.count(5)
c = a.count(7)
if b==2 and c==1:
  print("YES")
else:
  print("NO")
a = input()
for i in range(len(s_l)):
	if a == s_l[i]:
        try:
            print(s_l[i+1])
        except:
            print(s_l[-1])
        break

### FIXED CODE ###

s_l = ['Sunny', 'Cloudy', 'Rainy' ]
a = input()
for i in range(len(s_l)):
    if a == s_l[i]:
        try:
            print(s_l[i+1])
        except:
            print(s_l[0])
        break
n,k = map(int(), input().split())
s = input()

b = ""
for i in range(n):
  if i == k-1:
    b += s[i].lower
  else:
    b += s[i]
    
print(b)

### FIXED CODE ###

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

b = ""
for i in range(n):
  if i == k-1:
    b += s[i].lower()
  else:
    b += s[i]
    
print(b)
from sys import stdin
n = int(stdin.readline().rstrip())
li = list(int(stdin.readline().rstrip()) for _ in range(n))
one = max(li)
two = sorted(li)[-2]
for i in range(n):
    if max(li) == li[i]:
        print(two)
    else:
        print(max(one))

### FIXED CODE ###

n = int(input())
a = [int(input()) for _ in range(n)]
a_m = max(a)
a_i = a.index(a_m)
a.sort()
for i in range(len(a)):
  if i == a_i:
    print(a[-2])
  else:
    print(a_m)
for a in input().upper().split():
print(a[0] end="")

### FIXED CODE ###

s = list(input().upper().split())
print(s[0][0]+s[1][0]+s[2][0])
s=input()
c=0
ans=0
for i in range(n):
  if s[i]=='T':
    c+=1
  if s[i]='S':
    c-=1
  ans = max(ans,c)
print(ans*2)

### FIXED CODE ###

s=input()
c=0
ans=0
for i in range(len(s)):
  if s[i]=='T':
    c+=1
  if s[i]=='S':
    c-=1
  ans = max(ans,c)
print(ans*2)
a,b = map(int,input())

print((a-1)*(b-1))

### FIXED CODE ###

a,b = map(int,input().split())
 
print((a-1)*(b-1))
n = int(input())
v = list(map(int, input().split()))

odd = [[0, i] for i in range(10001)]
even = [[0, i] for i in range(10001)]

for i in range(0, n, 2):
  odd[v[i]][0] += 1
for i in range(1, n, 2):
  even[v[i]][0] += 1

odd.sort()
even.sort()

if odd[-1][1] != even[-1][1]:
  print(n - odd[-1][0] - even[-1][0])
else:
  print(n - max(odd[-2][0] + even[-1][0], odd[-1][0] + even[-2][0]))

### FIXED CODE ###

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

odd = [[0, i] for i in range(100001)]
even = [[0, i] for i in range(100001)]

for i in range(0, n, 2):
  odd[v[i]][0] += 1
for i in range(1, n, 2):
  even[v[i]][0] += 1

odd.sort()
even.sort()

if odd[-1][1] != even[-1][1]:
  print(n - odd[-1][0] - even[-1][0])
else:
  print(n - max(odd[-2][0] + even[-1][0], odd[-1][0] + even[-2][0]))
from decimal import *
import math

i = list(map(int, input().split()))
A = Decimal(i[0])
B = Decimal(i[1])

A_min = A // Decimal("0.08")
A_max = math.ceil(Decimal(A + 1) / Decimal("0.08"))
B_min = B // Decimal("0.1")
B_max = math.ceil(Decimal(B+1) / Decimal(0.1))

if A_max < B_min:
    print(-1)
elif A_min > B_max:
    print(-1)
elif A_min < B_min:
    print(B_min)
else:
    print(A_min)

### FIXED CODE ###

S = str(input())
 
if S[0] == S[1] == S[2]:
  print("No")
else:
  print("Yes")
import math

a, b, c, d = map(int, input().split())
a = a-1
lcm = int(c*d/math.gcd(c, d))
print((b-b//c-b//d+b//lcm)-(a-a//c-a//d+a//lcm))


### FIXED CODE ###

import fractions
a, b, c, d = map(int, input().split())
a = a-1
lcm = int(c*d/fractions.gcd(c, d))
ans = (b-b//c-b//d+b//lcm)-(a-a//c-a//d+a//lcm)
print(ans)
import fractions
import collections
import copy

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

num = 10**3+100

mod = 10**9+7

if n == 1:
    print(1)
    exit()

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

pri_li = []

for i in range(n):
    pri_li.append(collections.Counter(prime_factorize(ai[i])))

com_ab = [0]*(num)

for i in range(n):
    tmp = 1
    #print(len(b_li[i]))
    keys = pri_li[i].keys()
    #print(keys)
    for j in keys:
        com_ab[j] = max(com_ab[j],pri_li[i][j])

"""
for i in range(10**3):
    if com_ab[i] > 0:
        com_num *= pow(i,com_ab[i],mod)
"""
ans = 0

for i in range(n):
    com_ab_new = copy.deepcopy(com_ab)
    #print(com_ab,com_ab_new)
    tmp = [0]*(num)
    keys = pri_li[i].keys()
    for j in keys:
        com_ab_new[j] -= pri_li[i][j]
    kari = 1
    for j in range(num):
        if com_ab_new[j] > 0:
            kari *= pow(j,com_ab_new[j],mod)
    ans += kari
    ans %= mod
    #print(ans)
        
print(ans)


### FIXED CODE ###

import collections
import math
n = int(input())
ai = [int(i) for i in input().split()]

mod = 10**9+7

if n == 1:
    print(1)
    exit()
    
    
# 素因数分解、辞書で返すやつ
# mathをimportする
def prime(n):
    factor = {}
    tmp = int(math.sqrt(n)) + 1
    for num in range(2, tmp):
        while n % num == 0:
            n //= num
            if not num in factor.keys():
                factor[num] = 1
            else:
                factor[num] += 1
        if num > n:
            break
    if n != 1:
        if not n in factor.keys():
            factor[n] = 1
        else:
            factor[n] += 1
    return factor


dic = {}
for a in ai:
    pr = prime(a)
    for num, count in pr.items():
        if not num in dic.keys():
            dic[num] = count
        else:
            if dic[num] < count:
                dic[num] = count

kari = 1
for num,count in dic.items():
    kari *= pow(num,count,mod)
    kari %= mod

kari_old = kari
ans = 0

for i in range(n):
    kari = kari_old
    #com_ab_new = copy.deepcopy(com_ab)
    #print(com_ab,com_ab_new)
    #kari = 1
    #for j in range(kosu):
    #kari *= pow(sosu_li[j][0],com_ab[sosu_li[j][0]],mod)
    kari *= pow(ai[i],mod-2,mod)
    ans += kari
    ans %= mod
    #print(ans)
    #print(ans)
        
print(ans)
# -*- coding: utf-8 -*-
# 文字列の入力
a = int(input())
li = list(map(int, input().split()))
li2 = []

for i in range(a):
    li2.append(li[i])

if len(li2) != len(set(li2)):
    print('NO')
else:
    print('YES')


### FIXED CODE ###

# -*- coding: utf-8 -*-
# 整数の入力
a, b = map(str, input().split())
# スペース区切りの整数の入力
c, d = map(int, input().split())
# 文字列の入力
e = str(input())

if a == e:
    c = c - 1
elif b ==e:
    d = d - 1
    
# 出力
print("{} {}".format(c, d))
A=int(input())
B=int(input())
C=int(input())
X=int(input())
cnt=0

for i in range(0,A+1):
  for j in range(0,B+1):
    for k in range(0,C+1):
      if 500*i+100*j+50*K==X:
        cnt +=1
print(cnt)

### FIXED CODE ###

A=int(input())
B=int(input())
C=int(input())
X=int(input())
cnt=0

for i in range(0,A+1):
  for j in range(0,B+1):
    for k in range(0,C+1):
      if 500*i+100*j+50*k==X:
        cnt +=1
print(cnt)
a,b,k = map(int,input().split())

nums = list(range(a,b+1))
n = len(nums)
if k>n: k=n

for i in range(0,k): print(nums[i])
if (k-1<n-k):
    for i in range(n-k,n): print(nums[i])
else:
    for i in range(k,n): print(nums[i])


### FIXED CODE ###

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

n=b-a+1

if (k-1>=n-k):
    for i in range(a,b+1): print(i)

else:
    for i in range(a,a+k): print(i)
    for i in range(b-k+1,b+1): print(i)
n=int(input())
dat = list(map(int, input().split()))

for e in dat:
    e = str(bin(e))

for e in dat:
    e = e.rfind('1')

print(min(dat)-1)



### FIXED CODE ###

import sys

def main():
    N = int(input())
    A = [int(_) for _ in input().split()]

    t = 0
    while True:
        for i in range(N):
            if A[i] % 2 == 0:
                A[i] //= 2
            else:
                print(t)
                sys.exit()
        t += 1

main()
import sys

for s in sys.stdin:
  a,b = map(int,s.split())
  print len(str(a+b))

### FIXED CODE ###

import sys

for s in sys.stdin:
  a,b = map(int,s.split())
  print(len(str(a+b)))
S = int(input())
print('AC' if S[0] == 'A' and S[2:-1].count('C') == 1 and S[1:].replace('C','').islower() else 'WA')
  

### FIXED CODE ###

S = input()
print('AC' if S[0] == 'A' and S[2:-1].count('C') == 1 and S[1] != 'C' and S[1:].replace('C','').islower() else 'WA')
def main():
      a, v = map(int,input().split())
  b, w = map(int,input().split())
  t = int(input())
  ans = True
  vect = v - w
  if vect <= 0:
    ans = False
  else:
    if vect * t > abs(a - b):
      ans = True
    else:
      if (a + w * t > 10 ** 9 and b + v * t > 10 ** 9 and b > a):
        ans = True
      elif (a - w * t < -10 ** 9 and b - v * t < 10 ** 9 and b < a):
        ans = True
      else:
        ans = False
  if ans:
    print("YES")
  else:
    print("NO")   
            


main()


### FIXED CODE ###

def main():
  a, v = map(int,input().split())
  b, w = map(int,input().split())
  t = int(input())
  ans = True

  if v - w < 0: 
    ans  = False
  elif (v - w) * t >= abs(a - b):
    ans = True
  else:
    ans = False
      
  if ans:
    print("YES")
  else:
    print("NO")            


main()
s = int(input())
maxcount = int(s / 3)
amari = s % 3
count = 0
if amari == 0 and maxcount > 0:
    count = 1

for i in range(maxcount):
    amari = s - (i + 1) * 3
    count += comb(amari + i, i, exact=True)
    count %= 1000000007
print(count)

### FIXED CODE ###

from scipy.special import comb

s = int(input())
maxcount = int(s / 3)
amari = s % 3
count = 0
if amari == 0 and maxcount > 0:
    count = 1

for i in range(maxcount):
    amari = s - (i + 1) * 3
    if amari != 0:
        count += comb(amari + i, i, exact=True)
    count %= 1000000007
print(count)
n = int(input())
AS = list(map(int,input().split()))

def func(m,AS):
  ans = 0
  for a in AS:
    ans += (m % a)
  return ans
    
  
ans = 0
for i in range(2,10**5+1):
  a = func(i,AS)
  if a > ans:
    ans = a
print(ans)


### FIXED CODE ###

As = sorted(list(map(int,input().split())))
print(abs(As[0]-As[1]) + abs(As[1] - As[2]))
a,b,c = map(int,input().split())
if b+C > a:
  print((b+c-a)
else:
  print("0")

### FIXED CODE ###

a,b,c = map(int,input().split())
if b+c > a:
  print(b+c-a)
else:
  print("0")
N = int(input())
A = list(map(int,input().split()))
xorValue = 0
sumValue = A[0] + A[1]
for i in range(2,N):
    xorValue ^= A[i]
if sumValue % 2 != xorValue % 2:
    print(-1)
else:
    Base = (sumValue - xorValue) // 2
    if Base > A[0]:
        print(-1)
    else:
        strXOR = bin(xorValue)[2:]
        minStoneMovement = A[0] - Base
        strBase = bin(Base)[2:]
        lenStrXOR = len(strXOR)
        cannotMove = False
        for i in range(-1,-1 * min(len(strXOR),len(strBase)) - 1,-1):
            if Base[i] == '1' and strXOR[i] == '1':
                cannotMove = True
                break
        if not cannotMove:
            for i in range(lenStrXOR):
                if strXOR[i] == '1' and minStoneMovement >= 2 ** (lenStrXOR - 1 - i):
                    minStoneMovement -= 2 ** (lenStrXOR - 1 - i)
        if minStoneMovement == A[0] or cannotMove:
            print(-1)
        else:
            print(minStoneMovement)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
xorValue = 0
sumValue = A[0] + A[1]
for i in range(2,N):
    xorValue ^= A[i]
if sumValue % 2 != xorValue % 2:
    print(-1)
else:
    Base = (sumValue - xorValue) // 2
    if Base > A[0]:
        print(-1)
    else:
        strXOR = bin(xorValue)[2:]
        minStoneMovement = A[0] - Base
        strBase = bin(Base)[2:]
        lenStrXOR = len(strXOR)
        cannotMove = False
        if Base < 0:
            cannotMove = True
        for i in range(-1,-1 * min(len(strXOR),len(strBase)) - 1,-1):
            if strBase[i] == '1' and strXOR[i] == '1':
                cannotMove = True
                break
        if not cannotMove:
            for i in range(lenStrXOR):
                if strXOR[i] == '1' and minStoneMovement >= 2 ** (lenStrXOR - 1 - i):
                    minStoneMovement -= 2 ** (lenStrXOR - 1 - i)
        if minStoneMovement == A[0] or cannotMove:
            print(-1)
        else:
            print(minStoneMovement)
n = input()
p = [int(i) for i in input().split()]
ans = 0
for i in range(n-1):
  if p[i+1] == max(p[i], p[i+1], p[i+2]) or min(p[i], p[i+1], p[i+2]):
    ans += 0
  else:
    ans += 1

print(ans)

### FIXED CODE ###

n = int(input())
p = [int(i) for i in input().split()]
ans = 0
for i in range(n-2):
  if p[i+1] == max(p[i], p[i+1], p[i+2]) or p[i+1] == min(p[i], p[i+1], p[i+2]):
    ans += 0
  else:
    ans += 1
print(ans)
a = int(input(a))
b = int(input(b))
c = a*b

if c%2 == 0:
  print ("Even")
else:
  print ("Odd")

### FIXED CODE ###

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

if c % 2 == 0:
    print("Even")
else:
    print("Odd")
import sys
input = sys.stdin.readline


def main():
    x, n = [int(i) for i in input().split()]
    p = set([int(i) for i in input().split()])

    for i in range(1, 101):
        if i in p:
            continue

        if i <= x:
            ans = i
        elif x - ans > i - x:
            ans = i
    else:
        print(ans)


if __name__ == '__main__':
    main()

### FIXED CODE ###

# import numpy as np
import sys
input = sys.stdin.readline


def main():
    x, n = [int(i) for i in input().split()]
    p = set([int(i) for i in input().split()])

    ans = x
    for i in range(-1, 102):
        if i in p:
            continue

        if i <= x:
            ans = i
        else:
            if x - ans > i - x:
                ans = i
            break

    print(ans)


if __name__ == '__main__':
    main()
n, m = map(int, input().split())
S = input()
T = input()

def gcd(x, y):
    while y > 0:
        x, y = y, x%y
    return x

def lcm(x, y):
    return (x * y) // gcd(x, y)

l = lcm(n, m)
memoS = [0] * (l + 1)
memoT = [0] * (l + 1)

numS = [1]
numT = [1]

for i in range(1, n):
    num = i * l // n + 1
    numS.append(num)

for i in range(1, m):
    num = i * l // m + 1
    numT.append(num)
    
dictS = {}
dictT = {}

for i in range(n):
    dictS[numS[i]] = S[i]
    memoS[numS[i]] = 3

for i in range(m):
    dictT[numT[i]] = T[i]
    memoT[numT[i]] = 1

ans = l
for i in range(l):
    if memoS[i] - memoT[i] == 2:
        if dictS[i] != dictT[i]:
            ans = -1
            break
                
print(ans)

### FIXED CODE ###

def gcd(x, y):
    while y != 0:
        x, y = y, x%y
    return x

def lcm(x, y):
    return (x * y) // gcd(x, y)

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

l = lcm(n, m)
        
if S[::n // gcd(n, m)] == T[::m // gcd(n, m)]:
    print(l)
else:
    print(-1)
A,B,N = map(int,input().split())
S =[]
if B>N:
    print(int(A*N/B)-A*(int(N/B)))
else:
    print(int(A*N/(B-1))-A*(int((B-1)/B)))

### FIXED CODE ###

A,B,N = map(int,input().split())
if B>N:
    print(int(A*N/B)-A*(int(N/B)))
else:
    print(int(A*(B-1)/B)-A*(int((B-1)/B)))
def op(x,y,i):
    if i==0:
        return x+y
    elif i==1:
        return x-y
    elif i==2:
        return x*y

def check(x, n):
    a1,a2,a3,a4 = x[0],x[1],x[2],x[3]
    s='+-*'
    for i1 in range(3):
        a1 = op(x[0],x[1],i1)
        for i2 in range(3):
            a2 = op(a1,x[2],i2)
            for i3 in range(3):
                a3 = op(a2,x[3],i3)
                if a3==n:
                    b1,b2,b3 = s[i1],s[i2],s[i3]
                    s0 = '((({0} {1} {2}) {3} {4}) {5} {6})'
                    eq = s0.format(x[0],b1,x[1],b2,x[2],b3,x[3])
                    return eq
            a2 = op(x[2],x[3],i2)
            for i3 in range(3):
                a3 = op(a1,a2,i3)
                if a3==n:
                    b1,b2,b3 = s[i1],s[i3],s[i2]
                    s0 = '((({0} {1} {2}) {3} ({4} {5} {6}))'
                    eq = s0.format(x[0],b1,x[1],b2,x[2],b3,x[3])
                    return eq
    return ''

def permutations(L):
    if L == []:
        return [[]]
    else:
        return [[h]+t for i,h in enumerate(L)
                      for t   in permutations(L[:i]+L[i+1:])]

n=10
op='+-*'
while True:
    x = map(int,raw_input().split())
    if x==[0,0,0,0]:break
    x = permutations(x)
    for e in x:
        s = check(e,n)
        if s!='':
            print s
            break
    else:
        print ('0')

### FIXED CODE ###

import itertools
def op(x,y,i):
    if i=="+": return x+y
    elif i=="-": return x-y
    elif i=="*": return x*y

e0 = "((({} {} {}) {} {}) {} {})"
e1 = "(({} {} {}) {} ({} {} {}))"
def check(A, n):
    w,x,y,z = A
    S="+-*"
    for i in S:
        a = op(w,x,i)
        for j in S:
            b1,b2 = op(a,y,j),op(y,z,j)
            for k in S:
                if op(b1,z,k)==n: return e0.format(w,i,x,j,y,k,z)
                if op(a,b2,k)==n: return e1.format(w,i,x,k,y,j,z)
    return 0

n = 10
while 1:
    x = map(int,raw_input().split())
    if x==[0,0,0,0]: break
    for e in itertools.permutations(x):
        s = check(e,n)
        if s: break
    print s
n = int(input())
def f(x):
    for k in range(2, int(sqrt(x)) + 1):
        if x % k == 0:
            continue
        return False
    return True
i = n
while 1:
    if f(i):
        print(i)
        break
    i += 1

### FIXED CODE ###

#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')


def primes(n):
    """ 
    Input n>=6, Returns a list of primes, 2 <= p < n 
    6以上の数であれば p (素数) <= n のlistを返す 
    :param int n:
    :rytpe list:
    """
    n, correction = n-n%6+6, 2-(n%6>1)
    sieve = [True] * (n//3)
    for i in range(1,int(n**0.5)//3+1):
        if sieve[i]:
            k=3*i+1|1
            sieve[      k*k//3      ::2*k] = [False] * ((n//6-k*k//6-1)//k+1)
            sieve[k*(k-2*(i&1)+4)//3::2*k] = [False] * ((n//6-k*(k-2*(i&1)+4)//6-1)//k+1)
    return [2,3] + [3*i+1|1 for i in range(1,n//3-correction) if sieve[i]]

#solve
def solve():
    x = II()
    p = primes(10 ** 6)
    print(p[bisect_left(p, x)])
    return


#main
if __name__ == '__main__':
    solve()
N,M,X=map(int,input().split())
l=[]
for i in range (N):
  l.append(list(map(int,input().split())))
ans=0
for i in range(2**N):
  score=[0]*M
  coin=0
  for j in range(N):
    if i>=2**(N-1-j):
      for p in range(M):
        score[p]+=l[j][p+1]
        coin+=l[j][0]
      i-=2**(N-1-j)
  flag=0
  for q in range(M):
    if score(q)<X:
      flag=1
  if flag==0:
    if ans<coin:
      ans=coin
print(coin)

### FIXED CODE ###

N,M,X=map(int,input().split())
l=[]
for i in range (N):
  l.append(list(map(int,input().split())))
ans=10000000
for i in range(2**N):
  score=[0]*M
  coin=0
  for j in range(N):
    if i>=2**(N-1-j):
      for p in range(M):
        score[p]+=l[j][p+1]
      coin+=l[j][0]
      i-=2**(N-1-j)
  flag=0
  for q in range(M):
    if score[q]<X:
      flag=1
  if flag==0:
    if ans>coin:
      ans=coin
if ans==10000000:
  print("-1")
else:
  print(ans)
x= int(input())

def prime_check(num,count):
    if (num % count) != 0:
        if num <= count**2:
            return num
        else:
            return prime_check(num,count+1)
    else :
        return prime_check(num+1,2)

if x==2 :
    print (2)
else:
    print(prime_check(x,2))


### FIXED CODE ###

X = int(input())

def get_sieve_of_eratosthenes_new(n):
    import math
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]

prime = get_sieve_of_eratosthenes_new(10**6)
for num in prime:
    if num >= X:
        print(num)
        break