Harryxun/stf_run huggingface dataset:
print("Yes")

### FIXED CODE ###

n = list(input())
m = 0
for i in range(2):
    if n[i]==n[i+1]==n[i+2]:
        m += 1
        print("Yes")
        break
if m==0:
    print("No")
match_num=[0,2,5,5,4,5,6,3,7,6]
N,M=map(int, input().split())
nums=sorted(list(map(int, input().split())),reverse=True)
INF=1000000
#max桁数
dp = [-INF for _ in range(N+1)]
dp[0]=0
usables=[]
for n in nums:
  usables.append(match_num[n])

for i in range(min(usables), N+1):
  tmp=[]
  for u in usables:
    tmp.append(dp[i-u])
  
  dp[i]=max(tmp)+1

remained_maches=N

ans=''  
for i in range(dp[N]):
  for j in range(M):
    if remained_maches-usables[j]>=0 :
      if dp[remained_maches]-1==dp[remained_maches-usables[j]]:
        ans+=str(nums[j])
        remained_maches-=usables[j]
        break
print(ans)



### FIXED CODE ###

match_num=[0,2,5,5,4,5,6,3,7,6]
N,M=map(int, input().split())
nums=sorted(list(map(int, input().split())),reverse=True)
INF=1000000
#max桁数
dp = [-INF for _ in range(N+1)]
dp[0]=0
usables=[]
for n in nums:
  usables.append(match_num[n])

for i in range(min(usables), N+1):
  tmp=[]
  for u in usables:
    if (i-u)>=0:
      tmp.append(dp[i-u])
  
  dp[i]=max(tmp)+1

remained_maches=N

ans=''  
for i in range(dp[N]):
  for j in range(M):
    if (remained_maches-usables[j])>=0:
      if dp[remained_maches]-1==dp[remained_maches-usables[j]]:
        ans+=str(nums[j])
        remained_maches-=usables[j]
        break
        
print(ans)
a=int(input())
k=0
while x<a:
  x=2**k
  k+=1
print(x)

### FIXED CODE ###

a=int(input())
k=0
x=0
while x<=a:
  x=2**k
  k+=1
print(int(x/2))
n=int(input())
ans=61
for i in range(n-3):
    ans*=4
    ans-=14
    ans%=mod
print(ans)


### FIXED CODE ###

mod=10**9+7
n=int(input())
memo=[{} for i in range(n+1)]

def ok(last4):
    for i in range(4):
        t=list(last4)
        if i>=1:
            t[i-1],t[i]=t[i],t[i-1]
        if "".join(t).count("AGC")>=1:
            return 0
    return 1

def dfs(cur,last3):
    if last3 in memo[cur]:
        return memo[cur][last3]
    if cur==n:
        return 1
    ret=0
    for c in "ACGT":
        if ok(last3+c):
            ret=(ret+dfs(cur+1,last3[1:]+c))%mod
    memo[cur][last3]=ret
    return ret
print(dfs(0,"TTT"))
n = int(input())
ans = [0 for _ in range(10050)]

for x in range(1,100+1):
    for y in range(1,100+1):
        for z in range(1,100+1):
            tmp=x**2+y**2+z**2+x*y+y*z+z*x
            ans[v]+=1

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

### FIXED CODE ###

n = int(input())
ans = [0 for _ in range(10001)]

for x in range(1,100+1):
    for y in range(1,100+1):
        for z in range(1,100+1):
            tmp=x**2+y**2+z**2+x*y+y*z+z*x
            if tmp<=10000:
                ans[tmp]+=1

for i in range(n):
    print(ans[i+1])
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for _ in range(M)]

BC.sort(key=lambda x: x[1], reverse=True)
A.sort()
s = 0
for B, C in BC:
    mn = A[0]
    if mn >= C:
        s += sum(A)
        break
    n = len(A)
    if B > n:
        B = n
    if A[B - 1] <= C:
        s += B * C
        if B == n:
            break
        A = A[B:]
    else:
        error
        for a in A[1:B]:
            if a >= C:
                i = A.index(a)
                s += i * C
                s += sum(A[i:])
                break
        break
else:
    s += sum(A)
print(s)

### FIXED CODE ###

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

BC.sort(key=lambda x: x[1], reverse=True)
A.sort()
l, r = 0, N
for B, C in BC:
    if A[l] >= C:
        break
    a, b = l, r
    if A[r - 1] >= C:
        while a + 1 < b:
            i = a + (b - a) // 2
            if A[i] >= C:
                b = i
            else:
                a = i
        r = b
    n = B + l
    if n > r:
        n = r
        B = n - l
    if n <= b:
        A[l:n] = [C] * B
        l = n
    else:
        A[l:b] = [C] * B
        l = b
    if l == r:
        break

print(sum(A))
x = input()
print x*x*x

### FIXED CODE ###

x=int(input())
print(x**3)
n = int(input())
a = [int(i) for i in input().split() if i % 2 == 0]
for i in a:
    if a % 3 != 0 and a % 5 != 0:
            print("DENIED")
            exit()
print("APPROVED")

### FIXED CODE ###

n = int(input())
a = [int(i) for i in input().split() if int(i) % 2 == 0]
for i in a:
    if i % 3 != 0 and i % 5 != 0:
            print("DENIED")
            exit()
print("APPROVED")
def rate(n):
    if n < 1200:
        print('ABC')
    elif 1200 <= n <2800:
        print('ARC')
    else:
        print('AGC')

rate(input())

### FIXED CODE ###

def rate(n):
    if n < 1200:
        print('ABC')
    elif 1200 <= n <2800:
        print('ARC')
    else:
        print('AGC')

rate(int(input()))
n,m=map(int,input().split())
d={}
dp={}

for _ in range(m):
	x,y=map(int,input().split())
	try:
		d[x].append(y)
	except:
		d[x]=[y]

def lp(a):
	if a in dp:
		return dp[a]
	if a not in d:
		dp[a]=1
		return 1
	ans=0
	for i in d[a]:
		ans=max(ans,1+lp(i))
	dp[a]=ans
	return ans

print(lp(x))


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**8)

n,m=map(int,input().split())
d={}
dp={}
n=[]

for _ in range(m):
	x,y=map(int,input().split())
	n.append(x)
	try:
		d[x].append(y)
	except:
		d[x]=[y]

def lp(a):
	if a in dp:
		return dp[a]
	if a not in d:
		dp[a]=1
		return 1
	ans=0
	for i in d[a]:
		ans=max(ans,1+lp(i))
	dp[a]=ans
	return ans

p=0
for i in n:
	p=max(p,lp(i))
print(p-1)
I,*U=N,*D=9**9,
P,*L='x+y,',
M,*R='x-y,',
for t in[*open(0)][1:]:*z,u=t.split();exec(u+'+=[*map(int,z)],')
for*A,S in(D,U,'x,y,'),(L,R,'y,x,'),(U,R,P+M),(L,D,P+M),(L,U,M+P),(D,R,M+P):
 for x,y,r in eval('sorted((%sQ)for Q,P in enumerate(A)for x,y in P)'%S):
  if r:n,p=x,y
  elif x==n:N=min(N,y-p)
print(N%I*5or'SAFE')

### FIXED CODE ###

d=[[],[],[],[]]
for t in[*open(0)][1:]:*z,u=t.split();d[ord(u)%5]+=[*map(int,z)],
I=N=9**9
P,M='x+y,','x-y,'
for*A,S in(3,0,'x,y,'),(1,2,'y,x,'),(0,2,P+M),(1,3,P+M),(1,0,M+P),(3,2,M+P):
 n=p=-I
 for x,y,r in eval('sorted((%sQ)for Q,P in enumerate(A)for x,y in d[P])'%S):
  if r:n,p=x,y
  elif x==n:N=min(N,y-p)
print(N%I*5or'SAFE')
n = int(input())
XY = []
for i in range(n):
    a = int(input())
    xy = []
    for j in range(a):
        x, y = map(int, input().split())
        xy.append([x, y])
    XY.append(xy)
ans = 0
for i in range(2 ** n):
    s = [0] * n
    cnt = 0
    case = True
    for j in range(n):
        if (i >> j) & 1:
            s[j] = 1
            cnt += 1
    for k in range(n):
        if s[k] == 1:
            for l in range(len(XY[l])):
                if s[XY[k][l][0] - 1] != XY[k][l][1]:
                    case = False
                    break
    if case is True:
        ans = max(ans, cnt)
print(ans)

### FIXED CODE ###

n = int(input())
XY = []
for i in range(n):
    a = int(input())
    xy = []
    for j in range(a):
        x, y = map(int, input().split())
        xy.append([x, y])
    XY.append(xy)
ans = 0
for i in range(2 ** n):
    s = [0] * n
    cnt = 0
    case = 0
    for j in range(n):
        if (i >> j) & 1:
            s[n - 1 - j] = 1
            cnt += 1
    for k in range(n):
        if s[k] == 1:
            for l in range(len(XY[k])):
                if s[XY[k][l][0] - 1] != XY[k][l][1]:
                    case = 1
    if case == 0:
        ans = max(ans, cnt)
print(ans)
string = input().split();
if (string[2] == string[3]):
  if (string[4] == string[5]):
    print("Yes");
  else:
    print("No");
else:
  print("No");

### FIXED CODE ###

string = list(input());
if (string[2] == string[3]):
  if (string[4] == string[5]):
    print("Yes");
  else:
    print("No");
else:
  print("No");
n = int(input())
# l = sort(map(int, input().split()))
l = sort(int(x) for x in input().split())
l_sum = 0
for i in range(n-1):
	l_sum += l[i]
if l_sum > l[n-1]:
	print('Yes')
else:
	print('No')

### FIXED CODE ###

n = int(input())
l = [int(x) for x in input().split()]
l.sort()
# print(l)
l_sum = 0
for i in range(n-1):
	l_sum += l[i]
if l[n-1] < l_sum:
	print('Yes')
else:
	print('No')
a,b,c=map(int,input().split()))
if a<b<c:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

a,b,c=map(int,input().split())
if a<b<c:
    print('Yes')
else:
    print('No')
N = int(input())
A = list(map(int, input().split()))
LIST = [0]*(10001)
Q = int(input())


b =[0]*Q
c =[0]*Q
for i in range(Q):
    b[i], c[i] = map(int, input().split())

for i in A:
    LIST[i]+=1

s = sum(A)

for i in range(Q):
    s += LIST[b[i]]*(c[i]-b[i])
    LIST[c[i]]+=LIST[b[i]]
    LIST[b[i]] = 0
    print(s)


### FIXED CODE ###

n = int(input())
a = [int(i) for i in input().split()]
q = int(input())
num = [0] * 100010
b = [0] * q
c = [0] * q
for i in range(q):
    b[i], c[i] = map(int, input().split())

for i in a:
    num[i] += 1

s = sum(a)

for i in range(q):
    s += (c[i]-b[i])*num[b[i]]
    num[c[i]] += num[b[i]]
    num[b[i]] = 0
    print(s)
while True:
    H, W =[int(i) for i in input().split ]
    if H == W == 0:
       break

    for h in range(H):
        for w in range(W):
            if h == 0 or h == h -1 or w == 0 or w == W - 1:
               print('#', end='')
            else:
                print('*', end='')

        print()

    print()

### FIXED CODE ###

while True:
    H, W = [int(i) for i in input().split()]
    if H == W == 0:
        break
     
    for h in range(H):
        for w in range(W):
            if h == 0 or h == H-1 or w == 0 or w == W - 1:
                print('#', end='')
            else:
                print('.', end='')
        print()
     
    print()
H, W, K = map(int, input().split())

result = list()

l = list()
kk = 0
nls = list()
for hh in range(H):
    ll = input()
    s = [(i, x) for i, x in enumerate(ll) if x == '#']
    ln = len(s)
    nl = list()
    if ln == 0:
        nls.append(hh)
    elif ln == 1:
        kk += 1
        nl = [kk] * W
    else:
        for p, _ in s:
            kk += 1
            nl.extend([kk] * (1 if p == 0 else p))
    l.append(nl)

for i in nls:
    for j in range(W):
        l[i].append(l[(i - 1 if i > 0 else i + 1)][j])

for h in l:
    print(' '.join(map(str, h)))

### FIXED CODE ###

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

result = list()

l = list()
kk = 0
nls = list()
for hh in range(H):
    ll = input()
    s = [i+1 for i, x in enumerate(ll) if x == '#']
    ln = len(s)
    nl = list()
    if ln == 0:
        nls.append(hh)
    elif ln == 1:
        kk += 1
        nl = [kk] * W
    else:
        pre = 0
        for i, p in enumerate(s):
            kk += 1
            pp = p - (s[i-1] if i > 0 else 0)
            nl.extend([kk] * (1 if pp == 0 else pp))
            pre = p
    if len(nl) < W:
        nl.extend([kk] * (W - len(nl)))
    l.append(nl)

for i in nls:
    if i > 0 and l[i-1] not in nls:
        l[i] = l[i-1]
    else:
        for j in range(i + 1, H):
            if j in nls:
                continue
            l[i] = l[j]
            break

for h in l:
    print(' '.join(map(str, h)))
import copy
import numpy as np
def cyclic(n, l, v):
    ans = []
    v.add(n)
    for i in  l[n]:
        if i in v:
            return True, v
    for i in l[n]:
        v2 = copy.deepcopy(v)
        t, vv = cyclic(i, l, v2)
        #v.remove(i)
        if t:
            ans.append(vv)
        if ans:
            return True, ans
    return False, v
def main():
    N, M  = map(int, input().split())
    l = [[] for _ in range(N)]
    r = []
    for _ in range(M):
        a, b = map(int, input().split())
        l[a-1].append(b-1)
    for i in range(N):
        v = set()
        t, vv = cyclic(i, l, v)
        if t:
            r.extend(np.ndarray.flatten(np.array(vv)).tolist())
    if r:
        m = 100000
        rr = None
        for i in r:
            if m > len(i):
                m = len(i)
                rr = i
        print(m)
        for i in rr:
            print(i+1)
    print(-1)
    return -1
main()


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
def main():
    N, M = map(int, input().split())
    l = [[] for _ in range(N)]
    for _ in range(M):
        a, b = map(int, input().split())
        l[a-1].append(b-1)
    c = [0] * N
    loop = []
    def cyclic(n):
        if c[n] == 2:
            return False
        if c[n] == 1:
            loop.append(n)
            return True
        c[n] = 1
        for i in l[n]:
            if cyclic(i):
                loop.append(n)
                return True
        c[n] = 2
        return False
    for i in range(N):
        if cyclic(i):
            break
    if len(loop) == 0:
        print(-1)
        return
    print(0)
    return
main()
A, B = map(int, raw_input().split())
x = A * B
if x % 2 == 0:
    print('No')
else:
    print('Yes')

### FIXED CODE ###

A, B = map(int, input().split())
x = A * B
if x % 2 == 0:
    print('No')
else:
    print('Yes')
S = input()

if S[0] == S[1] or S[1] == S[2] or S[2] == S[3]:
  r = 'Bad'
else:
  r - 'Good'

print(r)

### FIXED CODE ###

S = input()
 
if S[0] == S[1] or S[1] == S[2] or S[2] == S[3]:
  r = 'Bad'
else:
  r = 'Good'
 
print(r)
x = 800*N

y = 0
if N % 15 ==0:
  y = y + 200

print(x-y)

### FIXED CODE ###

N = int(input())

x = N * 800
y = 0

for i in range(1,N+1):
    if i % 15 == 0:
        y = y + 200

ans = x-y        
print(ans)
n=int(input())
import bisect
import itertools
l=len(str(n))
ans=[]
num=[]
for k in range(3,l+1):
    m=list(itertools.product(x, repeat=k))
    num.extend(m)
for i in range(len(num)):
    y=num[i]
    if '3' in y and '5' in y and '7' in y:
        number=''
        for j in range(len(y)):
            number+=y[j]
        ans.append(int(number))
ans.sort()
print(bisect.bisect_left(ans, n))

### FIXED CODE ###

n=int(input())
import bisect
import itertools
l=len(str(n))
ans=[]
num=[]
x=['3', '5', '7']
for k in range(3,l+1):
    m=list(itertools.product(x, repeat=k))
    num.extend(m)
for i in range(len(num)):
    y=num[i]
    if '3' in y and '5' in y and '7' in y:
        number=''
        for j in range(len(y)):
            number+=y[j]
        ans.append(int(number))
ans.sort()
print(bisect.bisect_right(ans, n))
n = int(input())
arr = list(map(int,input().split()))
cur=1000
for i in range(n-1):
  p=0
  if arr[i] < arr[i+1]:
    p=cur // a[i]
  cur += (arr[i+1] - arr[i])*cur
print(cur)

### FIXED CODE ###

n = int(input())
arr = list(map(int,input().split()))
cur=1000
for i in range(n-1):
  p=0
  if arr[i] < arr[i+1]:
    p=cur // arr[i]
  cur += (arr[i+1] - arr[i])*p
print(cur)
N, s, t = map(int, input().split())
s -= 1
t -= 1
# to = [[] for _ in range(N)]
to = [[] for _ in range(100005)]
for i in range(N-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    to[a].append(b)
    to[b].append(a)

def dfs(dist, v, d=0, p=-1):
    dist[v] = d
    for u in to[v]:
        if u == p:
            continue
        dfs(dist, u, d+1, v)

def calcDist(s):
    dist = [0] * N
    dfs(dist, s)
    return dist

distS = calcDist(s)
distT = calcDist(t)

mx = 0
for i in range(N):
    if distS[i] < distT[i]:
        mx = max(mx, distT[i])
ans = mx - 1
print(ans)


### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

N, s, t = map(int, input().split())
s -= 1
t -= 1
to = [[] for _ in range(N)]
for i in range(N-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    to[a].append(b)
    to[b].append(a)

def dfs(dist, v, d=0, p=-1):
    dist[v] = d
    for u in to[v]:
        if u == p:
            continue
        dfs(dist, u, d+1, v)

def calcDist(s):
    dist = [0] * N
    dfs(dist, s)
    return dist

distS = calcDist(s)
distT = calcDist(t)

mx = 0
for i in range(N):
    if distS[i] < distT[i]:
        mx = max(mx, distT[i])
ans = mx - 1
print(ans)
a, b = map(int, input().split())

d = a // b
r = a % b
f = a / b

print("{:d} {;d} {:.5f}".format(d, r, f))



### FIXED CODE ###

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

d = a // b
r = a % b
f = a / b

print("{:d} {:d} {:.5f}".format(d, r, f))
n = input()
maxv = -1 * 10**9
minv = input()

for j in range(n-1):
  v = input()
  if maxv < v - minv:
    maxv = v - minv
  if minv > v
    minv = v

print maxv

### FIXED CODE ###

n = input()
minv = input()
maxv = -1 * 10**9

for j in range(n-1):
  v = input()
  if maxv < v - minv:
    maxv = v - minv
  if minv > v:
    minv = v

print maxv
N, W = list(map(int, input().split(" ")))

for i in range(0, N):
	for w in range(1, W+1):
        weight, vvalue = list(map(int, input().split(" ")))
		if w >= weight:
			dp[i + 1][w] = max([dp[i][w - weight] + value, dp[i][w]])
		else:
			dp[i + 1][w] = dp[i][w]
print(dp[N][W])


### FIXED CODE ###

import sys

n = int(input())
l = list(map(int, input().split(" ")))
dp= [0]*n
dp[1] = abs(l[1] - l[0])

for i in range(2, n):
	one = dp[i - 1] + abs(l[i] - l[i-1])
	two = dp[i - 2] + abs(l[i] - l[i-2])	
	dp[i] = min([one, two])

print(dp[n-1])
import numpy as np
n,m = map(int,input().split())
A = np.zeros((n,n),dtype=np.bool)
for i in range(m):
    a,b = map(int,input().split())
    A[a-1,b-1] = 1

if 1 in A[np.where(A[0] == 1),n-1]:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

### FIXED CODE ###

import numpy as np
n,m = map(int,input().split())
A1 = np.zeros(n,dtype=bool)
Ai = np.zeros(n,dtype=bool)
for i in range(m):
    a,b = map(int,input().split())
    if a == 1:
        A1[b-1] = True
    if b == n:
        Ai[a-1] = True
if np.any(Ai[A1]):
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')
inputs = map(int, input().split())
print(min(inputs[:2]) + min(inputs[2:]))

### FIXED CODE ###

inputs = [int(input()) for _ in range(4)]
print(min(inputs[:2]) + min(inputs[2:]))
import math

def nCr(n,r):
    f = math.factorial
    return int(f(n) / f(r) / f(n-r))

def nHk(n, k):
    f = math.factorial
    return int(f(n + k - 1) // f(k) // f(n - 1))

N, K = map(int, input().split())
MOD = 10 ** 9 + 7

for i in range(1, K + 1):
#   print('i: ' + str(i))
    # 青玉をi個のグループに並べる並べ方
    blue = 1
#    if i == 1:
#        blue = 1
#    else:
#        blue = nCr(K - 1, i - 1)
#    print('blue: ' + str(blue))
    # 青い玉に合わせた赤い玉の並べ方
    if (N - K) < (i - 1):
        red = 0
#        print('red0: ' + str(red))
    elif i == 1:
        red = (N - K) + 1
#        print('red1: ' + str(red))
    else:
        red = nCr(K - 1, i - 1) * nHk(i + 1, N - K - (i - 1))
#        print('nCr: ' + str(nCr(K - 1, i - 1)))
#        print('nHk: ' + str(nHk(i + 1, N - K - (i - 1))))
#        print('red2: ' + str(red))

    # 解は青の並べ方と赤の並べ方の組み合わせ
    ans = blue * red % MOD
#    print(ans)
    print('ans: ' + str(ans))

### FIXED CODE ###

S = list(input())
s = list(set(S))
ans = 'No'
if len(s) == 2:
    if S.count(s[0]) == 2:
        ans = 'Yes'

print(ans)
s = input().strip()
N = len(s)
x,y = map(int,input().split())
AX = []
AY = []
flag = 0
cnt = 0
for i in range(len(s)):
    if s[i]=="F":
        cnt += 1
    else:
        if flag==0:
            AX.append(cnt)
            cnt = 0
            flag = 1
        else:
            AY.append(cnt)
            cnt = 0
            flag = 0
if cnt>0 and flag==0:
    AX.append(cnt)
if cnt>0 and flag==1:
    AY.append(cnt)
dpX = [[0 for _ in range(2*N+1)] for _ in range(len(AX)+1)]
if s[0]=="F":
    dpX[1][N+AX[0]] = 1
    for i in range(1,len(AX)):
        for j in range(2*N+1):
            if 0<=j+AX[i]<=2*N:
                dpX[i+1][j+AX[i]] = dpX[i+1][j+AX[i]] or dpX[i][j]
            if 0<=j-AX[i]<=2*N:
                dpX[i+1][j-AX[i]] = dpX[i+1][j-AX[i]] or dpX[i][j]
else:
    dpX[0][N] = 1
    for i in range(len(AX)):
        for j in range(2*N+1):
            if 0<=j+AX[i]<=2*N:
                dpX[i+1][j+AX[i]] = dpX[i+1][j+AX[i]] or dpX[i][j]
            if 0<=j-AX[i]<=2*N:
                dpX[i+1][j-AX[i]] = dpX[i+1][j+AX[i]] or dpX[i][j]
dpY[0][N] = 1
for i in range(len(AY)):
    for j in range(2*N+1):
        if 0<=j+AY[i]<=2*N:
            dpY[i+1][j+AY[i]] = dpY[i+1][j+AY[i]] or dpY[i][j]
        if 0<=j-AY[i]<=2*N:
            dpY[i+1][j-AY[i]] = dpY[i+1][j-AY[i]] or dpY[i][j]
if dpX[len(AX)][N+x]==1 and dpY[len(AY)][N+y]==1:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

s = input().strip()
x,y = map(int,input().split())
C = {}
cur = 0
cnt = 0
for i in range(len(s)):
    if s[i]=="F":
        cnt += 1
    else:
        C[cur] = cnt
        cur += 1
        cnt = 0
C[cur] = cnt
AX = []
AY = []
for a in C:
    if a>0 and a%2==0 and C[a]>0:
        AX.append(C[a])
    elif a%2==1 and C[a]>0:
        AY.append(C[a])
cntx = sum(AX)
dpx = [[0 for _ in range(2*cntx+1)] for _ in range(len(AX)+1)]
dpx[0][cntx] = 1
if cntx>0:
    dpx[1][cntx-AX[0]] = 1
    dpx[1][cntx+AX[0]] = 1
    for i in range(2,len(AX)+1):
        for j in range(-cntx,cntx+1):
            if -cntx<=j-AX[i-1]:
                dpx[i][j+cntx] = dpx[i-1][j-AX[i-1]+cntx]
                if j+AX[i-1]<=cntx:
                    dpx[i][j+cntx] = max(dpx[i][j+cntx],dpx[i-1][j+AX[i-1]+cntx])
            elif j+AX[i-1]<=cntx:
                dpx[i][j+cntx] = dpx[i-1][j+AX[i-1]+cntx]
cnty = sum(AY)
dpy = [[0 for _ in range(2*cnty+1)] for _ in range(len(AY)+1)]
dpy[0][cnty] = 1
if cnty>0:
    dpy[1][cnty-AY[0]] = 1
    dpy[1][cnty+AY[0]] = 1
    for i in range(2,len(AY)+1):
        for j in range(-cnty,cnty+1):
            if -cnty<=j-AY[i-1]:
                dpy[i][j+cnty] = dpy[i-1][j-AY[i-1]+cnty]
                if j+AY[i-1]<=cnty:
                    dpy[i][j+cnty] = max(dpy[i][j+cnty],dpy[i-1][j+AY[i-1]+cnty])
            elif j+AY[i-1]<=cnty:
                dpy[i][j+cnty] = dpy[i-1][j+AY[i-1]+cnty]
if C[0]-cntx<=x<=C[0]+cntx and dpx[len(AX)][x-C[0]+cntx]==1 and -cnty<=y<=cnty and dpy[len(AY)][y+cnty]==1:
    print("Yes")
else:
    print("No")
N = int(input())
ga, sa, ba = map(int, input().split())
gb, sb, bb = map(int, input().split())
metal = [(ga, gb), (sa, sb), (ba, bb)]
metal.sort(reverse = True, key = lambda x:x[1]-x[0])
ga, gb = metal[0]
sa, sb = metal[1]
ba, bb = metal[2]
if ba<=bb:
    res = N
    for i in range(N//ga+1):
        for j in range((N-i*ga)//sa+1):
            k = (N-i*ga-j*sa)//ba
            tmp = k*bb+j*sb+i*gb+(N-i*ga-j*sa-k*ba)
            res = max(res, tmp)
elif sa<=sb:
    res = N
    for i in range(N//ga+1):
        j = (N-i*ga)//sa
        tmp = gb*i+sb*j+(N-i*ga-sa*j)
        res = max(res, tmp)
    k = res//bb
    res += (ba-bb)*k
elif ga<=gb:
    i = N//ga
    N+=i*(gb-ga)
    res = N
    for i in range(N//sb):
        print(1/0)
        j = (N-i*sb)//bb
        tmp = N+(sa-sb)*i+(ba-bb)*j
        res = max(res, tmp)
else:
    res = N
    ga, gb = gb, ga
    sa, sb = sb, sa
    ba, bb = bb, ba
    for i in range(N//ga+1):
        for j in range((N-i*ga)//sa+1):
            k = (N-i*ga-j*sa)//ba
            tmp = k*bb+j*sb+i*gb+(N-i*ga-j*sa-k*ba)
            res = max(res, tmp)
print(res)


            


### FIXED CODE ###

N = int(input())
ga, sa, ba = map(int, input().split())
gb, sb, bb = map(int, input().split())
metal = [(ga, gb), (sa, sb), (ba, bb)]
metal.sort(reverse = True, key = lambda x:x[1]-x[0])
ga, gb = metal[0]
sa, sb = metal[1]
ba, bb = metal[2]
if ba<=bb:
    res = N
    for i in range(N//ga+1):
        for j in range((N-i*ga)//sa+1):
            k = (N-i*ga-j*sa)//ba
            tmp = k*bb+j*sb+i*gb+(N-i*ga-j*sa-k*ba)
            res = max(res, tmp)
elif sa<=sb:
    res = N
    for i in range(N//ga+1):
        j = (N-i*ga)//sa
        tmp = gb*i+sb*j+(N-i*ga-sa*j)
        res = max(res, tmp)
    k = res//bb
    res += (ba-bb)*k
elif ga<=gb:
    i = N//ga
    N+=i*(gb-ga)
    res = N
    for i in range(N//sb+1):
        j = (N-i*sb)//bb
        tmp = N+(sa-sb)*i+(ba-bb)*j
        res = max(res, tmp)
else:
    res = N
    ga, gb = gb, ga
    sa, sb = sb, sa
    ba, bb = bb, ba
    for i in range(N//ga+1):
        for j in range((N-i*ga)//sa+1):
            k = (N-i*ga-j*sa)//ba
            tmp = k*bb+j*sb+i*gb+(N-i*ga-j*sa-k*ba)
            res = max(res, tmp)
print(res)
print(ord(input()) in "aiueo" and "vowel" or "consonant")

### FIXED CODE ###

print(input() in "aiueo" and "vowel" or "consonant")
a = raw_input()
print(pow(a, 3))


### FIXED CODE ###

a = int(input())
print(pow(a,3))