Harryxun/stf_run huggingface dataset:
l = int(input())
a = input()
b = input()

if len(a) > len(b):
    k = b
    b = a
    a = k

mina = None
maxa = None

f = [None] * (l + 1)

f[0] = ''
#print(f)
for i in range(l):
    tmpa = None
    tmpb = None
    if i + 1 >= len(a) and f[i + 1 - len(a)] is not None:
        tmpa = a + f[i + 1 - len(a)]
    if i + 1 >= len(b) and f[i + 1 - len(b)] is not None:
        tmpb = b + f[i + 1 - len(b)]
    if tmpa is None and tmpb is None:
        continue
    if tmpa is None and tmpb is not None:
        f[i+1] = tmpb
        continue
    if tmpb is None and tmpa is not None:
        f[i+1] = tmpa
        continue
    if tmpa < tmpb:
        f[i+1] = tmpa
    else:
        f[i+1] = tmpb
print(f[l])

### FIXED CODE ###

l = int(input())
a = input()
b = input()

if len(a) > len(b):
    k = b
    b = a
    a = k

mina = None
maxa = None
"""
f = [None] * (l + 1)

f[0] = ''
#print(f)
for i in range(l):
    tmpa = None
    tmpb = None
    if i + 1 >= len(a) and f[i + 1 - len(a)] is not None:
        tmpa = a + f[i + 1 - len(a)]
    if i + 1 >= len(b) and f[i + 1 - len(b)] is not None:
        tmpb = b + f[i + 1 - len(b)]
    if tmpa is None and tmpb is None:
        continue
    if tmpa is None and tmpb is not None:
        f[i+1] = tmpb
        continue
    if tmpb is None and tmpa is not None:
        f[i+1] = tmpa
        continue
    if tmpa < tmpb:
        f[i+1] = tmpa
    else:
        f[i+1] = tmpb
print(f[l])

def less(a, b):
    if a < b:
        if not b.startswith(a):
            return True
        else:
            c = b
            while c.startswith(a):
                c = c[len(a):]
            if a < c:
                return True
            else:
                return False

"""
for i in range(l+ 1) :
    if i * len(a) > l:
        break
    if (l - i * len(a)) % len(b) == 0:
        if mina is None:
            mina = i
            maxb = (l - i * len(a)) // len(b)
        maxa = i
        minb = (l - i * len(a)) // len(b)


ans1 = a * maxa + b * minb
ans2 = b * maxb + a * mina

if ans1 < ans2:
    print(ans1)
else:
    print(ans2)
N = int(input())
A = [0] * N
B = [0] * N
for i in range(N):
    A[i], B[i] = map(int, input().split())

c = 0

if A == B:
    print(c)
    exit()

# A[i] < B[i]のところはA[i] == 0になるまで追いつけない
for i in range(N):
    if A[i] < B[i]:
        c += A[i]
        B[i] -= A[i]
        A[i] = 0

while A != B:
    x = 0
    for i in range(N):
        if A[i] == 0:
            continue
        x = i
        if A[i] < B[i]:
            break
    A[x] -= 1
    y = 0
    for i in range(N):
        if A[i] == B[i]:
            continue
        y = i
        if A[i] < B[i]:
            break
    B[y] -= 1
    candy += 1

print(candy)


### FIXED CODE ###

N = int(input())

same = True
sum_a = 0
min_b = None

for _ in range(N):
    a, b = map(int, input().split())
    # Aの総和を求める
    sum_a += a
    # AとBが等しいどうかを調べる
    if a != b:
        same = False
    # Ai > Biの中で最小のbを求める
    if a > b and (min_b is None or b < min_b):
        min_b = b

# 初めから同じなら手数なし
if same:
    print(0)
    exit()

# Ai > Biの中で最小のbを求める
if min_b is None:
    min_b = 0

print(sum_a - min_b)
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

ab = []
res = []
x, y, z, k = na()
a_li = na()
b_li = na()
c_li = na()
for a in a_li:
    for b in b_li:
        ab.append((a * b))
list.sort(ab, reverse=True)
list.sort(c_li, reverse=True)
for a_b in ab:
    for c in c_li:
        res.append(a_b * c)
for num in sorted(res,reverse=True)[-k:]:
    print(num)

### FIXED CODE ###

import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

li = []
for i in range(5):
    li.append(int(input()))
k = int(input())
for i in range(5):
    li
if max(li)-min(li) <= k:
    print('Yay!')
else:
    print(":(")
x = int(input())

for i in range(-100, 100):
    for j in range(-100, 100):
        if i ** 5 - j ** 5 == x:
            a=i
            b=j

print(a, b)

### FIXED CODE ###

x = int(input())

for i in range(200):
    for j in range(-200, 200):
        if i ** 5 - j ** 5 == x:
            a=i
            b=j

print(a, b)
N = int(input())
A = [int(input(i)) for i in range(N)]
sum  = 1
for i in A:
    sum = sum * i
if(sum > (10**18)):
    print(-1)
else:
    print(sum)


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
sum  = 1
flag = 0
for i in A:
    if(i == 0):
        print(0)
        flag=2
        break
if(flag==0):
    for i in A:
        sum = sum * i
        if(sum > 10**18):
            flag=1
            break
if(flag==0):
    print(sum)
elif(flag==1):
    print(-1)
S = input()

flag = False
if S[0] != 'A':
    print('WA')
    quit()
elif S.count('C') != 1:
    print('WA')
    quit()
elif S[2] == 'C' or S[-2] == 'C':
    c_index = S.index('C')
    if c_index == 2:
        disc = S[1] + S[3:]
    else:
        disc = S[1:len(S) - 1] + S[-1]
alpha = 'abcdefghijklmnopqrstuvwxyz'
for i in range(len(disc)):
    if not disc[i] in alpha:
        print('WA')
        quit()
    else:
        continue
print('AC')
#print(disc)

### FIXED CODE ###

S = input()

C_S = S[2 : len(S) - 1]

#flag = True
if S[0] != 'A':
    #flag = False
    print('WA')
    quit()
    #break
if not 'C' in C_S and C_S.count('C') != 1:
    #flag = False
    #break
    print('WA')
    quit()
c_index = S.index('C')
alpha = 'abcdefghijklmnopqrstuvwxyz'
for i in range(len(S)):
    if i == 0 or i == c_index:
        continue
    elif S[i] not in alpha:
        #flag = False
        #break
        print('WA')
        quit()
    else:
        continue
print('AC')
n=int(input())
odd=0
even=0
a=list(map(int,input().split()))
for i in range(n):
  if a[i]%2=1:
    odd+=1
  else:
    even+=1
if odd%2==1:
  print("NO")
else:
  print("YES")

### FIXED CODE ###

n=int(input())
odd=0
even=0
a=list(map(int,input().split()))
for i in range(n):
  if a[i]%2==1:
    odd+=1
  else:
    even+=1
if odd%2==1:
  print("NO")
else:
  print("YES")
S = input()
l = []
for i in range(len(S) - 2):
    num = abs(int(S[i + i+3] - 753))
    l.append(num)
print(min(l))

### FIXED CODE ###

S = input()
l = []
for i in range(len(S) - 2):
    num = abs(int(S[i:i+3]) - 753)
    l.append(num)
print(min(l))
s = []
ans = 0
flag = True
N, M = map(int, input().split())
for i in range(M):
    a = list(map(int, input().split()))
    if a not in s:
        s.append(a)
S = sorted(s)

for i in range(len(S)-1):
    if S[i][0]==S[i+1][0] and S[i][1]!=S[i+1][1]:
        flag = False

if N>1 and S[0]==[1,0]:
    flag = False

if flag == True:
    for i in range(len(S)):
        for j in range(N+1):
            if S[i][0]==j:
                ans+=S[i][1]*10**(N-j)
    if N==3 and ans<100:
        ans+=100
    elif N ==2 and ans<10:
        ans+=10
        
    print(ans)
            
else:
    print('-1')

### FIXED CODE ###

s = []
ans = 0
flag = True
N, M = map(int, input().split())
if M ==0:
    if N==1:
        print(0)
    elif N ==2:
        print(10)
    else:
        print(100)
else:
    for i in range(M):
        a = list(map(int, input().split()))
        if a not in s:
            s.append(a)
    S = sorted(s)

    for i in range(len(S)-1):
        if S[i][0]==S[i+1][0] and S[i][1]!=S[i+1][1]:
            flag = False

    if N>1 and S[0]==[1,0]:
        flag = False

    if flag == True:
        for i in range(len(S)):
            for j in range(N+1):
                if S[i][0]==j:
                    ans+=S[i][1]*10**(N-j)
        if N==3 and ans<100:
            ans+=100
        elif N ==2 and ans<10:
            ans+=10
        
        print(ans)
            
    else:
        print('-1')
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

x = list[a,b,c,d,e]
y = sorted(x)

if k >= y[4] -y[0]:
    print('Yay!')

else:
    print(':(')

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if k >= max(a,b,c,d,e) - min(a,b,c,d,e):
    print('Yay!')

else:
    print(':(')
while 1:
    s=input()
    if s=='#':break
    p=0
    e=[[],[]]
    for x in s:
        if x=='b':e[p]+=['b']
        elif x=='/':p+=1
        else:
            for j in range(int(x)):e[p]+=['.']
    ans=''
    a,b,c,d=map(int,input().split())
    e[a-1][b-1]='.'
    e[c-1][d-1]='b'
    for i in range(2):
        if i:ans+='/'
        a=0
        for j in e[i]:
            if j=='b':
                if a:ans+=str(a)
                ans+='b'
                a=0
            else:a+=1
        if a:ans+=str(a)
    print(ans)

### FIXED CODE ###

while 1:
    s=input()
    if '#' in s:break
    p=0
    e=[[]*2 for _ in range(10)]
    for x in s:
        if x=='b':e[p]+=['b']
        elif x=='/':p+=1
        else:e[p]+='.'*int(x)
    ans=''
    a,b,c,d=map(int,input().split())
    e[a-1][b-1],e[c-1][d-1]=e[c-1][d-1],e[a-1][b-1]
    for i in range(p+1):
        if i:ans+='/'
        a=0
        for j in e[i]:
            if j=='b':
                if a:ans+=str(a)
                ans+='b'
                a=0
            else:a+=1
        if a:ans+=str(a)
    print(ans)
N,K = map(int,input().split())
P = [ i-1 for i in list(map(int,input().split())) ]
C = list(map(int,input().split()))

g = [ [] for _ in range(N) ]
for i in range(N):
  g[i].append(P[i])

def dfs(i):
  global cycle
  nei = g[i][0]
  if nei in cycle: return
  cycle.append(nei)
  dfs(nei)

cycles = []

for i in range(N):
  cycle = []
  dfs(i)
  c = [ C[j] for j in cycle ]
  cycles.append(c) 

ans = -float('inf')
for i in range(N):
  c = cycles[i]
  cum = c[::]
  for j in range(1,len(c)):
    cum[j] = cum[j-1] + cum[j]

  if cum[-1] < 0:
    ans = max(ans, max(cum[0:K]))
  else:
    t = K//len(c)
    r = K - t*len(c)
    cum = [0]+cum[::]
    ans = max(ans, cum[-1]*t+max(cum[:r+1]))

print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

N,K = map(int,input().split())
P = [ i-1 for i in list(map(int,input().split())) ]
C = list(map(int,input().split()))
ans = -float('inf')

for i in range(N):
  cycle = []
  tot = 0
  nex = i
  while True:
    nex = P[nex]
    cycle.append(C[nex])
    tot += C[nex]
    if nex == i: break

  l = len(cycle)
  t = 0
  for j in range(l):
    t += cycle[j]
    if j+1 > K: break
    now = t
    if tot > 0:
      now += tot*((K-(j+1))//l)
    ans = max(ans, now)

print(ans)
def cos_per_find(count, cost, skills):
    if count == N:
        if min(skills) >= X:
            return cost
        else:
            return INF
    improved_skills = [a+b for a, b in zip(skills, contents[count])]
    return min(cos_per_find(count+1, cost, skills), cos_per_find(count+1, cost+price[count], improved_skills))

INF = float(inf)
N, M, X = map(int, input().split())
price = []
contents = []
for i in range(N):
    C, *A = map(int, input().split())
    price.append(C)
    contents.append(A)
if (ans := cos_per_find(0, 0, [0]*M)) == INF:
    print(-1)
else:
    print(ans)

### FIXED CODE ###

def cos_per_find(count, cost, skills):
    if count == N:
        if min(skills) >= X:
            return cost
        else:
            return INF
    improved_skills = [a+b for a, b in zip(skills, contents[count])]
    return min(cos_per_find(count+1, cost, skills), cos_per_find(count+1, cost+price[count], improved_skills))

INF = float('inf')
N, M, X = map(int, input().split())
price = []
contents = []
for i in range(N):
    C, *A = map(int, input().split())
    price.append(C)
    contents.append(A)
if (ans := cos_per_find(0, 0, [0]*M)) == INF:
    print(-1)
else:
    print(ans)
import sys
sys.setrecursionlimit(10**18)

N = int(input())
memo={0:1,1:1,2:2}

def func(n):
    if n in memo:
        return memo[n]
    memo[n] = n*func(n-2)
    return memo[n]

f = list(str(func(N)))  
ans = 0

for i in range(1,len(f)):
    if f[-i]== "0":
        ans += 1
    else:
        break
print(ans)

### FIXED CODE ###

N = int(input())
ans = 0
if N%2 == 1:
    print(0)
else:
    for i in range(1,len(str(N))+100):
        ans += N//(2*5**i)
    print(ans)
a=int(input())
tem = 1

if a != 0:
    b=input().split(" ")
    for i in range(a):
        tem = tem * int(b[i])
    if len(tem)> 10**18:
        tem = -1
print(tem)

### FIXED CODE ###

n = int(input())
b = list( map (int , input().split() ) )
b.sort()
ans = 1
for i in range(n):
    ans*=b[i]
    if ans>10**18:
      print(-1)
      exit()

print(ans)
key = input()
s = []
for i in key:
  if i == '0' or i == '1':
    s.append(i)
  else:
    len(s) > 0:
      s.pop(-1)
print(s)


### FIXED CODE ###

key = input()
s = []
for i in key:
  if i == '0' or i == '1':
    s.append(i)
  else:
    if len(s) > 0:
      s.pop(-1)
print(''.join(s))
a, b = map(int, input().split())
s = a+b
t = a-b
u = a*b

if s >= t:
    if t >= u:
        print(s)
    elif s <= u:
        print(u)
else:
    if s >= u:
        print(t)
    elif:
        t <= u:
        print(u)

### FIXED CODE ###

a, b = map(int, input().split())
s = a+b
t = a-b
u = a*b

if s >= t:
    if s >= u:
        print(s)
    else:
        print(u)
elif t >= u:
    if t >= s:
        print(t)
    else:
        print(s)
elif u >= s:
    if u >= t:
        print(u)
    else:
        print(t)
import numpy as np
from scipy.sparse.csgraph import connected_components
N,M = map(int, input().split())
A = [-1 for i in range(M)]
B = [-1 for i in range(M)]

mat = np.zeros((N,N),dtype=np.uint8)

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

for i in range(M):
    mat[A[i]-1][B[i]-1] = 1
    mat[B[i]-1][A[i]-1] = 1


n, labels = connected_components(mat)
print(n-1)

### FIXED CODE ###


N,M = map(int, input().split())
A = [-1 for i in range(M)]
B = [-1 for i in range(M)]
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

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

uf = UnionFind(N)

for i in range(M):
    uf.union(A[i]-1,B[i]-1)

print(uf.group_count()-1)
# -*- coding:utf-8 -*-

l = input().split()
N = int(l[0])
A = int(l[1])
B = int(l[2])

HP = [int(input()) for i in range(N)]


count = 0
check = 0
while(True):
	HP.sort()
	print(HP)

	for i in range(N):
		if i == N-1:
			HP[i] = HP[i] - A
			count = count + 1
		else:
			HP[i] = HP[i] - B

	for i in range(N):
		if HP[N-1] < 0 and HP[N-2] < 0:
			check = 1

	if check == 1:
		break

print("Count: " + str(count))

### FIXED CODE ###

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

N = int(input())
s = [int(input()) for i in range(N)]
s.sort()

sum = 0
for i in range(N):
	sum = sum + s[i]

check = 0
if sum % 10 != 0:
	print(sum)
else:
	for i in range(N):
		if s[i] % 10 != 0:
			print(sum - s[i])
			break
		else:
			check = check + 1

if check == N:
	print(0)
n = int(input())
a = [int(input()) for _ in range(n)]
a.sort()
num = a[-1]-a[-2]
if num%2 == 0:
    print('second')
else:
    print('first')


### FIXED CODE ###

n = int(input())
a = [int(input()) for _ in range(n)]
ans = [x for x in a if x%2 != 0]

if len(ans) == 0:
    print('second')
else:
    print('first')
# -*- coding: utf-8 -*-
# abc127/abc127_d
import sys
from operator import itemgetter

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

      


def main():
    N, M = i2nn()
    A = [(1, x) for x in i2nn()]
    S = [0] * M
    for j in range(M):
        S[j] = tuple(i2nn())
    S.extend(A)
    R = sorted(S, key=itemgetter(1))
    sum = 0
    while True:
        p = R.pop()
        if N - p[0] > 0:
            sum += p[0] * p[1]
            N -= p[0]
        else:
            sum += p[1] * N
            break
    print(sum)
    return

main()


### FIXED CODE ###

# -*- coding: utf-8 -*-
# abc127/abc127_a
import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    a,b = i2nn()
    if a >= 13:
        print(b)
    elif a >= 6:
        print(int(b / 2))
    else:
        print(0)

main()
import math
N,K = [int(x) for x in input().split()]
inf = 10**9+7
for i in range(1,K+1):
  k = i-1
  kumi = math.factorial(K-i+k)//(math.factorial(K-i)*math.factorial(k))
  ans = kumi*math.factorial(N-K+1)//(math.factorial(i)*math.factorial(N-K+1-i))
  print(int(ans%inf))
  

### FIXED CODE ###

import math
N,K = [int(x) for x in input().split()]
inf = 10**9+7
for i in range(1,K+1):
  k = i-1
  kumi = math.factorial(K-i+k)//(math.factorial(K-i)*math.factorial(k))%inf
  a = math.factorial(N-K+1)
  b = math.factorial(i)
  if (N-K+1-i)<0:
    print(0)
    continue
  c = math.factorial(N-K+1-i)
  a = a//b
  a = a//c%inf
  ans = kumi*a
  print(int(ans%inf))
n = int(input())
lst = [int(i) for i in input().split()]

dic = {}
for i in range(n):
  a = lst[i]
  if a >= n - 1:
    continue
  if a not in dic:
    dic[a] = set()
  dic[a].add(i)
#print(dic)
count = 0
for a in dic.keys():
  set_ = dic[a]
  for index in set_:
    b = a + index
    if b > n:
      continue
    for j in dic.keys():
      j = b + c
      if c in dic[c]:
        count += 1
print(count)


### FIXED CODE ###

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

dic = {}
count = 0
for i in range(n):
  num = lst[i]
  a = i + num
  if a not in dic:
    dic[a] = 1
  else:
    dic[a] += 1
  b = i - num
  if b in dic:
    count += dic[b]
print(count)
# coding: UTF-8
n = int(raw_input())
value_list = []
diff_indx1 = 0
diff_indx2 = 0
diff = None　#変数の初期化
for i in range(n):
    value_list.append(int(raw_input()))
    if i == 1:# diffの初期化
        diff = value_list[1] - value_list[0]
        diff_indx1 = 1
    if value_list[i] >= value_list[diff_indx1]:#引かれる数の更新
        diff2 = value_list[i] - value_list[diff_indx2]
        if diff <= diff2:
            diff = diff2
            diff_indx2 = diff_indx1
            diff_indx1 = i
    if value_list[diff_indx2] > value_list[i]:#引く数の更新と引かれる数のリセット
        diff_indx2 = i
        diff_indx1 = i
print diff


### FIXED CODE ###

from sys import stdin

N,*datas = [int(i) for i in stdin.readlines()]
now_max = max(datas[1:])
max_index = datas.index(now_max)
diff = now_max - datas[0]

for i in range(1,N-1):
    if i == max_index:
        now_max = max(datas[i+1:])
        max_index = datas.index(now_max,i+1)
    new_diff = now_max - datas[i]
    if diff < new_diff:
        diff = new_diff

print(diff)
a,b,c,X=[int(input()) for i in range(4)]
for a in range(1,A+1):
    Y = X - 500*a
    for b in range(1,B+1):
        Z = Y - 100*b
        for c in range(1,C+1):
            W = Z - 50*c
            if W == 0:
                cnt += 1
print(cnt)

### FIXED CODE ###

a,b,c,X=[int(input()) for i in range(4)]
print([500*x+100*y+50*z for z in range(c+1) for y in range(b+1) for x in range(a+1)].count(X))
import sys
sys.setrecursionlimit(4100000)
N,K=map(int, input().split())
p=list(map(int, input().split()))
kitaiwa=[0]*(N-K+1)
for i in range(N):
    p[i]=(p[i]+1)/2
for i in range(N-K+1):
    kitaiwa[i] = sum(p[i:i+K])
print(max(kitaiwa))

### FIXED CODE ###

S,T=map(str, input().split())
A,B=map(int, input().split())
U=input()

if U==S:
    print(A-1,B)
else:
    print(A,B-1)
n = int(input())
table = input().split()
print("{} {} {}".format(max(table[n]),min(table[n]),sum(table[n])))


### FIXED CODE ###

n = input()
table = list(map(int,input().split()))
print("{} {} {}".format(min(table),max(table),sum(table)))
n,k = map(int,input().split())
a = list(map(int,input().split()))
s = [False]*(k+1)
for i in range(k+1):
  for aj in a:
    if i - aj >=0:
      if s[i-aj] == False:
        s[i] = True
        break
if a[k]==True:
  print("First")
else:
  print("Second")
  
  



### FIXED CODE ###

n,k = map(int,input().split())
a = list(map(int,input().split()))
tf = ["" for _ in range(k+1)]
tf[0] = False
for i in range(1,k+1):
  j = 0
  flag = 0
  while j < n and i - a[j] >= 0:
    if tf[i-a[j]] == False:
      tf[i] = True
      flag = 1
      break
    j += 1
  if flag ==0:
    tf[i] = False
if tf[k]:
  print("First")
else:
  print("Second")
n, k = map(int, input().split())
TD = [[] for i in range(n)]
for i in range(n):
  TD[i] = list(map(int, input().split()))
  
TD.sort(key = lambda x:x[1], reverse = True)

ans = 0
huku = []
su = set([])

for i, j in TD[:k]:
  ans += j
  if i in su:
    huku.append([i,j])
  su.add(i)
ans += len(su)**2

huku.sort(key = lambda x:x[1], reverse = True)

for i,j in TD[k:]:
  if i in su:
    continue
  else:
    su.add(i)
    temp = ans + j - huku.pop()[1] + len(su)**2 -(len(su)-1)**2
    ans = max(ans, temp)

print(ans)

### FIXED CODE ###

n, k = map(int, input().split())
TD = [[] for i in range(n)]
for i in range(n):
  TD[i] = list(map(int, input().split()))
  
TD.sort(key = lambda x:x[1], reverse = True)

ans = 0
huku = []
su = set([])

for i, j in TD[:k]:
  ans += j
  if i in su:
    huku.append([i,j])
  su.add(i)
ans += len(su)**2
huku.sort(key = lambda x:x[1], reverse = True)

ansl = []
ansl.append(ans)
for i,j in TD[k:]:
  if i in su:
    continue
  elif huku == []:
    break
  else:
    temp = ansl[-1] + j - huku.pop()[1] + (len(su)+1)**2 -len(su)**2
    su.add(i)
    ansl.append(temp)

print(max(ansl))
n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(n):
  b.append(a.index(i+1)+1)
for i in range(n):
  print(i+" ")

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
b = [None] * n 
for i in range(n):
  b[a[i]-1] = i+1
print(" ".join(map(str, b)))
A,B,C=map(input().strip())
print(C-A+B)

### FIXED CODE ###

A,B,C=map(int,input().split())
can=(A-B)
if (C-can)>0:
    print(C-can)
else:
    print(0)
import math
x,a,b = map(int,input().split(' '))
c = a-x
d = b-x

e = abs(c)
d = abs(d)

if e<f:
	print('A')
else:
	print('B')


### FIXED CODE ###

x,a,b = map(int,input().split(' '))
c = a-x
d = b-x

if c<0:
	e = -c
else:
	e = c

if d<0:
	f = -d
else:
	f = d


if e<f:
	print('A')
else:
	print('B')
def det(n)
    if n % 4 == 0:
        return 'Yes'
    elif n % 7 == 0:
        return 'Yes'
    elif n < 4 or (5 <= n and n <= 6):
        return 'No'
    seven = range(n//7 + 1)
    for i in seven:
        if (n - seven*7) % 4 == 0:
            return 'Yes'
    return 'No'
n = int(input())
print(det(n))
    

### FIXED CODE ###

def cakes_and_donuts(arg1):
    four = range(( arg1 // 4 ) + 1)
    seven = range(( arg1 // 7 ) + 1)
    for i in seven:
        for p in four:
            if (i*7 + p*4) == arg1:
                return 'Yes'
    return 'No'

N = int(input())
print(cakes_and_donuts(N))