Harryxun/stf_run huggingface dataset:
n = int(input())
lengths = list(map(int, input().split()))

truth = True
for i in range(len(lengths)):
	curr = lengths[:i]+lengths[i+1:]
	if curr < lengths[i]:
		truth = False
		break
	
print(["No","Yes"][truth])

### FIXED CODE ###

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

truth = True
for i in range(len(lengths)):
	curr = lengths[:i]+lengths[i+1:]
	if sum(curr) <= lengths[i]:
		truth = False
		break
	
print(["No","Yes"][truth])
n = int(input())
l = [list(map(int,input().split())) for _ in range(n)]
p = [list(map(int,input().split())) for _ in range(n)]

maxi = -10**10

for i in range(1,2 ** 10):
    num = [0]*10
    for j in range(10):
        if ((i >> j) & 1):
            for k in range(n):
                num[k] += l[k][j]
    benefit = 0
    for m in range(n):
        benefit += p[m][num[m]]
    maxi = max(maxi,benefit)
print(maxi)

### FIXED CODE ###

n = int(input())
l = [list(map(int,input().split())) for _ in range(n)]
p = [list(map(int,input().split())) for _ in range(n)]

maxi = -10**10

for i in range(1,2**10):
    num = [0]*n
    for j in range(10):
        if ((i >> j) & 1):
            for k in range(n):
                num[k] += l[k][j]
    benefit = 0
    for m in range(n):
        benefit += p[m][num[m]]
    maxi = max(maxi,benefit)
print(maxi)
d = {'A': True, 'B': False, 'C': False}

while True:
    try:
        line = input()
    except:
        break
    a, t = line.split().split(',')
    d[a], d[t] = d[t], d[a]

for k, v in d.items():
    if v:
        print(k)

### FIXED CODE ###

d = {'A': True, 'B': False, 'C': False}

while True:
    try:
        a, t = input().split(',')
        d[a], d[t] = d[t], d[a]
    except:
        for k, v in d.items():
            if v:
                print(k)
        break
a, b = int(input().split())
if(a*b & 1 == 0):
    print("Even")
else:
    print("Odd")


### FIXED CODE ###

a, b = map(int, input().split())
if(a*b%2 == 0):
    print("Even")
else:
    print("Odd")
a,b,c=(int(x) for x in input().split())

sum =a+b+c
if sum>=22:
  print(bust)
else:
  print(win)


### FIXED CODE ###

a,b,c=(int(x) for x in input().split())

sum =a+b+c
if sum>=22:
  print("bust")
else:
  print("win")
from collections import deque

N, M = map(int, input().split())
AB = [map(int, input().split()) for _ in range(M)]
print(AB)
links = [[] for _ in range(N + 1)]
for a, b in AB:
    links[a].append(b)
    links[b].append(a)
print(AB)
print(links)
result = [-1] * (N + 1)
q = deque([1])
print(q)
while q:
    i = q.popleft()
    for j in links[i]:
        if result[j] == -1:
            result[j] = i
            q.append(j)
            print(q)
print('Yes')
print('\n'.join(str(i) for i in result[2:]))

### FIXED CODE ###

from collections import deque

N, M = map(int, input().split())
AB = [map(int, input().split()) for _ in range(M)]
#print(AB)
links = [[] for _ in range(N + 1)]
for a, b in AB:
    links[a].append(b)
    links[b].append(a)
#print(AB)
#print(links)
result = [-1] * (N + 1)
q = deque([1])
#print(q)
while q:
    i = q.popleft()
    for j in links[i]:
        if result[j] == -1:
            result[j] = i
            q.append(j)
            #print(q)
print('Yes')
print('\n'.join(str(i) for i in result[2:]))
S = input()
for i in range(len(S) -1,-1,-1):
  if i % 2 != 0:
    continue
  if s[:i // 2] == s[i // 2:i]:
    print(i)
    break



### FIXED CODE ###

s = input()

for l in range(len(s) -1, 1, -1):
    if l % 2 != 0:
        continue
    if s[:l // 2] == s[l // 2:l]:
        print(l)
        break
def main():
    A, B, X = list(map(int, input().split()))
    if A >= X or B >= X:
        N = 0
    elif X > 1e9 and afford(A, B, 1e9, X):
        N = int(1e9)
    else:
        limmin = 0
        limmax = 10 ** 9 + 1
        while limmax - limmin > 1:
            m = (limmax + limmin) // 2
            if afford(A, B, m, X):
                limmin = m
            else:
                limmax = m
        N = limmin
    print(N)


def afford(a, b, n, x):
    y = a * n + b * len(str(n))
    return y <= x


if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    dow = ['SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
    s = input()
    i = dow.index(s) + 1
    print(i)


if __name__ == "__main__":
    main()
n = int(input())
a = list(map(int, input().split()))
s = 1
for i in a:
  s *= i
  if s => 10 ** 18:
    s = -1
    break
if 0 in n:
  s = 0
print(s)
 

### FIXED CODE ###

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

ans = 1
for i in a :
  ans *= i
  if ans > 10**18 :
    ans = -1
    break
if 0 in a :
  ans = 0

print(ans)
import collections
n=int(input())
xyh=[list(map(int,input().split())) for i in range(n)]
xyh.sort()
p=xyh[-1]
q=xyh[-2]
for cx in range(0,101):
    for cy in range(0,101):
      if abs(p[0]-cx)+abs(p[1]-cy)==abs(q[0]-cx)+abs(q[1]-cy)+p[2]-q[2]:
        ax=cx
        ay=cy
H=p[2]+abs(p[0]-ax)+abs(p[1]-ay)
print(ax,ay,H)



### FIXED CODE ###

n=int(input())
xyh=[list(map(int,input().split())) for i in range(n)]
xyh.sort(key=lambda f:f[2])
p=xyh[-1]
for cx in range(0,101):
  for cy in range(0,101):
    h=p[2]+abs(p[0]-cx)+abs(p[1]-cy)
    for u in xyh:
      if u[2]!=max(0,h-abs(u[0]-cx)-abs(u[1]-cy)):
        break
    else:
      print(cx,cy,h)
import sys
input = sys.stdin.readline

N = int(input())
S = list(input().rstrip())
ord_a = ord("a")

# N: 処理する区間の長さ
INF = 2**31-1

LV = (N-1).bit_length()
N0 = 2**LV
data = [[0]*(2*N0) for _ in range(26)]
lazy = [[0]*(2*N0) for _ in range(26)]

def gindex(l, r):
    L = (l + N0) >> 1; R = (r + N0) >> 1
    lc = 0 if l & 1 else (L & -L).bit_length()
    rc = 0 if r & 1 else (R & -R).bit_length()
    for i in range(LV):
        if rc <= i:
            yield R
        if L < R and lc <= i:
            yield L
        L >>= 1; R >>= 1

# 遅延伝搬処理
def propagates(k, *ids):
    for i in reversed(ids):
        v = lazy[k][i-1]
        if not v:
            continue
        lazy[k][2*i-1] += v; lazy[k][2*i] += v
        data[k][2*i-1] += v; data[k][2*i] += v
        lazy[k][i-1] = 0

# 区間[l, r)にxを加算
def update(l, r, x, k):
    *ids, = gindex(l, r)
    propagates(k, *ids)

    L = N0 + l; R = N0 + r
    while L < R:
        if R & 1:
            R -= 1
            lazy[k][R-1] += x; data[k][R-1] += x
        if L & 1:
            lazy[k][L-1] += x; data[k][L-1] += x
            L += 1
        L >>= 1; R >>= 1
    for i in ids:
        data[k][i-1] = max(data[k][2*i-1], data[k][2*i])

# 区間[l, r)内の最大値を求める
def query(l, r, k):
    propagates(k, *gindex(l, r))
    L = N0 + l; R = N0 + r

    s = -INF
    while L < R:
        if R & 1:
            R -= 1
            s = max(s, data[k][R-1])
        if L & 1:
            s = max(s, data[k][L-1])
            L += 1
        L >>= 1; R >>= 1
    return s

for j in range(N):
    u = S[j]
    update(j, N, 1, ord(u) - ord_a)

Q = int(input())

for _ in range(Q):
    q = input().rstrip().split()
    if q[0] == "2":
        l, r = int(q[1]) - 1, int(q[2]) - 1
        cnt = 0
        for i in range(26):
            if l == 0:
                cnt += int(query(r, r + 1, i) > 0)
            else:
                cnt += int((query(r, r + 1, i) - query(l - 1, l, i) > 0))
        print(cnt)
    else:
        i, c = int(q[1]) - 1, q[2]
        update(l, N, -1, ord(S[i]) - ord_a)
        S[i] = c
        update(l, N, 1, ord(S[i]) - ord_a)

### FIXED CODE ###

import sys
input = sys.stdin.readline

N = int(input())
S = list(input().rstrip())
ord_a = ord("a")

class Bit:
    def __init__(self, n):
        self.size = n
        self.tree = [0] * (n + 1)
 
    def sum(self, i):
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i & -i
        return s
 
    def add(self, i, x):
        while i <= self.size:
            self.tree[i] += x
            i += i & -i

bits = [Bit(N) for _ in range(26)]

for i in range(N):
    s = S[i]
    bits[ord(s) - ord_a].add(i + 1, 1)

Q = int(input())

for _ in range(Q):
    query = input().rstrip().split()
    if query[0] == "1":
        i, c = int(query[1]), query[2]
        bits[ord(S[i - 1]) - ord_a].add(i, -1)
        S[i - 1] = c
        bits[ord(S[i - 1]) - ord_a].add(i, 1)
    else:
        l, r = int(query[1]), int(query[2])
        res = 0
        for bit in bits:
            if l != 1:
                res += int(bit.sum(r) - bit.sum(l - 1) > 0)
            else:
                res += int(bit.sum(r) > 0)
        print(res)
N, X = map(int, input().split())

a, p = [1], [1]
for i in range(N):
　a.append(a[i] * 2 + 3)
　p.append(p[i] * 2 + 1)

def f(N, X): # X <= 0 や X > a_N を許容し解説本文から簡略化
　if N == 0:
　　return 0 if X <= 0 else 1
　elif X <= 1 + a[N-1]:
　　return f(N-1, X-1)
　else:
　　return p[N-1] + 1 + f(N-1, X-2-a[N-1])

print(f(N, X))

### FIXED CODE ###

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

a, p = [1], [1]
for i in range(N):
  a.append(a[i] * 2 + 3)
  p.append(p[i] * 2 + 1)

def f(N, X): # X <= 0 や X > a_N を許容し解説本文から簡略化
  if N == 0:
    return 0 if X <= 0 else 1
  elif X <= 1 + a[N-1]:
    return f(N-1, X-1)
  else:
    return p[N-1] + 1 + f(N-1, X-2-a[N-1])

print(f(N, X))
a,b,c,d=map(int,input().split())
ans=False
if abs(a-c)<=d:
  ans=True
if abs(a-b)<=d&&abs(b-c)<=d:
  ans=True
if ans:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a,b,c,d=map(int,input().split())
ans=False
if abs(a-c)<=d:
  ans=True
if abs(a-b)<=d and abs(b-c)<=d:
  ans=True
if ans:
  print("Yes")
else:
  print("No")
N = int(input())
A = list(map(int, input().split()))
 
ans = 1
 
for i in A:
  ans *= i
  
  if ans > 10 ** 18:
  print(-1)
  return 
  
 
  
print(ans)

### FIXED CODE ###

def main():
    N = int(input())
    A = list(map(int, input().split()))
 
    if 0 in A:
        print(0)
        return
    
    ans = 1
 
    for i in A:
        ans *= i
      
        if ans > 10 ** 18:
            print(-1)
            return 
      
    print(ans)  

main()
N = input()
A = [int(i) for input().split()]
int(max) = 0
int(min) = 0
for i in N:
  if int(max) < A[i]:
    max = A[i]
for i in N:
  if int(min) > A[i]:
    min = A[i]

abs = max - min
print(int(abs))

### FIXED CODE ###

n = input()
A = list(map(int, input().split()))
print(int(max(A)) - int(min(A)))
def resolve():
    s = int(input())
    ans = [s]
    count = 0
    while True:
        if ans[count]%2 == 0:
            ans.append(ans[count]//2)
        else:
            ans.append(ans[count]*3+1)
        count += 1
        for i in range(count):
            if ans[i] == ans[count]:
                print(k+1)
                exit()
resolve()

### FIXED CODE ###

def resolve():
    s = int(input())
    ans = [s]
    count = 0
    while True:
        if ans[count]%2 == 0:
            ans.append(ans[count]/2)
        else:
            ans.append(ans[count]*3+1)
        count += 1
        for i in range(count):
            if ans[i] == ans[count]:
                print(count+1)
                exit()
resolve()
h,w=map(int,input().split())

li=[]
for i in range(h):
    li.append(list(input()))

new_li=[[0]*w for i in range(h)]

#＃の位置をリストに集める
sharp_li=[]
for i in range(h):
    for j in range(w):
        if li[i][j]=='#':
            sharp_li.append([i,j])

            
for k in range(len(sharp_li)):
    x=sharp_li[k][0]
    y=sharp_li[k][1]
    
    #tryの例外処理だとうまくいかなかったので、端の場合を自力で書いて場合わけする
    if x==0:
        xli=[0,1]
    elif x==w-1:
        xli=[w-2,w-1]
    else:
        xli=[x-1,x,x+1]
    
    if y==0:
        yli=[0,1]
    elif y==h-1:
        yli=[h-2,h-1]
    else:
        yli=[y-1,y,y+1]
        
        
    for l in xli:
        for m in yli:
            new_li[l][m]+=1
           
        
ans=[]             
for n in range(h):
    stred=list(map(str,new_li[n]))
    ans.append(stred)

#もともとの爆弾の部分を＃に戻す

for o in range(len(sharp_li)):
    ans[sharp_li[o][0]][sharp_li[o][1]]='#'


for p in range(h):
    tans=''.join(ans[p])
    print(tans)

### FIXED CODE ###

h,w=map(int,input().split())

li=[]
for i in range(h):
    li.append(list(input()))

new_li=[[0]*w for i in range(h)]

#＃の位置をリストに集める
sharp_li=[]
for i in range(h):
    for j in range(w):
        if li[i][j]=='#':
            sharp_li.append([i,j])   

for k in range(len(sharp_li)):
    #y行X列を扱う
    y=sharp_li[k][0]
    x=sharp_li[k][1]
    
    #tryの例外処理だとうまくいかなかったので、端の場合を自力で書いて場合わけする
    if x==0:
        if w!=1:             #1行や1列の場合がエラーの原因なので、無理やりif文で処理
            xli=[0,1]
        else:
            xli=[0]
    elif x==w-1:
        xli=[w-2,w-1]
    else:
        xli=[x-1,x,x+1]
    
    if y==0:
        if h!=1:
            yli=[0,1]
        else:
            yli=[0]
    elif y==h-1:
        yli=[h-2,h-1]
    else:
        yli=[y-1,y,y+1]
        
        
    for l in xli:
        for m in yli:
            new_li[m][l]+=1           #m行l列なので
           
        
ans=[]             
for n in range(h):
    stred=list(map(str,new_li[n]))
    ans.append(stred)
#もともとの爆弾の部分を＃に戻す

for o in range(len(sharp_li)):
    ans[sharp_li[o][0]][sharp_li[o][1]]='#'


for p in range(h):
    tans=''.join(ans[p])
    print(tans)
N,M=map(int,input().split())

def dfs(num):
    visited[num]=1
    for item in way[num]:
        if visited[item]==0:
            dfs(item)
    return 

mem=[-1]*M
way=[[] for i in range(N)]
visited=[0]*N
for n in range(N):
    temp=list(map(int,input().split()))
    
    for i in range(temp[0]):
        if mem[temp[i+1]-1]==-1:
            mem[temp[i+1]-1]=n
        else:
            way[mem[temp[i+1]-1]].append(n)
            way[n].append(mem[temp[i+1]-1])

for i in range(N):
    way[i]=list(set(way[i]))

dfs(0)

if visited.count(0)==0:
    print("Yes")
else:
    print("No")



    

### FIXED CODE ###

import sys

sys.setrecursionlimit(10**9)

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

def dfs(num):
    visited[num]=1
    for item in way[num]:
        if visited[item]==0:
            dfs(item)
    return 

mem=[-1]*M
way=[[] for i in range(N)]
visited=[0]*N
for n in range(N):
    temp=list(map(int,input().split()))
    
    for i in range(temp[0]):
        if mem[temp[i+1]-1]==-1:
            mem[temp[i+1]-1]=n
        else:
            way[mem[temp[i+1]-1]].append(n)
            way[n].append(mem[temp[i+1]-1])

for i in range(N):
    way[i]=list(set(way[i]))

dfs(0)

if visited.count(0)==0:
    print("YES")
else:
    print("NO")
n, k = map(int, input().split())
p = list(map(int, input().split()))

p.sort()
print(sum(p[0:k])

### FIXED CODE ###

n, k = map(int, input().split())
j=0
p=0
fruits= list(map(int, input().split()))
fruits.sort()
for j in range(k):
	p+=fruits[j]
print(p)
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==0:
            a[i]="D"
        elif a[i-1]=="D" and a[i+1]=="D":
            a[i]="P"
        elif a[i-1]=="D" and a[i+1]=="?":
            a[i]="P"    
        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)
N, K = map(int, input().split())

ans = 0

for i in range(N):
    t = 0
    p = i + 1
    while K > p:
        t += 1
        p *= 2
    ans += (0.5 ** t) / N
print(ans)

### FIXED CODE ###

N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
ans = 0

for i in range(N):
    d = V[i] - C[i]
    if d > 0:
        ans += d

print(ans)
from collections import deque

n,m=map(int,input().split())
l=list(map(int,input().split()))
l=[i/2 for i in l]
if n==1:
  if (m//l[0])%2==0:
    print(int((m//l[0])/2))
  else:
    print(int((m//l[0]+1)/2))

def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a

l=set(l)
a1=l.pop()
a2=l.pop()
g=gcd(a1,a2)
lcm=g*(a1/g)*(a2/g)
d=1
while l:
  a=s.pop()
  d=gcd(g,a)
  lcm=d*(a/d)*(g/d)
  g=lcm
  

if lcm>m:
  print(0)
  exit()
for a in l:
  if (lcm/a)%2==0:
    print(0)
    break
else:
  if (m//lcm)%2==0:
    print(int((m//lcm)/2))
  else:
    print(int((m//lcm+1)/2))

### FIXED CODE ###

#import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
import heapq
from fractions  import gcd
#input=sys.stdin.readline
#import bisect
n,m=map(int,input().split())
a=list(map(int,input().split()))

def lcm(a,b):
    g=math.gcd(a,b)
    return b*(a//g)
l=a[0]//2
for i in range(n):
    r=a[i]//2
    l=lcm(l,r)
for i in range(n):
    if (l//(a[i]//2))%2==0:
        print(0)
        exit()
res=m//l
print((res+1)//2)
N,M = map(int,input().split())
A = [map(int,input().split())]
print(max(-1,N-sum(A)))

### FIXED CODE ###

N,M = map(int,input().split())
A = list(map(int,input().split()))
print(max(-1,N-sum(A)))
x = list(map(int,inpt().split()))
for i in range(5):
  if x[i] ==0:
    ans = i
    
print(ans)

### FIXED CODE ###

x = list(map(int,input().split()))
for i in range(5):
    if x[i] ==0:
        ans = i+1
    
print(ans)
S=input()
S=int(S)
h=S/3600
h=int(h)
m=(S-3600*h)/60
m=int(m)
s=S-h*3600-m*60
s=int(s)
print(h:m:s)
 

### FIXED CODE ###

S=input()
S=int(S)
h=S/3600
h=int(h)
m=(S-3600*h)/60
m=int(m)
s=S-h*3600-m*60
s=int(s)
h=str(h)
m=str(m)
s=str(s)
print(h+':'+m+':'+s)
N, K = map(int, raw_input().split())
r = N % K
if r == 0:
  print(0)
else:
  print(1)


### FIXED CODE ###

N, K = map(int, input().split())
r = N % K
if r == 0:
  print(0)
else:
  print(1)
s = sorted(input())
t = sorted(input(), reverse=True)

for i in range(len(s)):
    if ord(s[i]) < ord(t[i]):
        print('Yes')
        exit()
    elif ord(s[i]) > ord(t[i]):
        print('No')
        exit()
if len(s) < len(t):
    print('Yes')
else:
    print('No')

### FIXED CODE ###

s = input()
t = input()
min_s = sorted(s)
max_t = sorted(t, reverse=True)
if min_s < max_t:
    print('Yes')
else:
    print('No')
A = [int(input()) for _ in range(5)]
B = [a%10 for a in A]
C = [10 - b for b in B]
while (10 in C):
  C.remove(10)
C.remove(max(C))
print(sum(A) + sum(C))


### FIXED CODE ###

A = [int(input()) for _ in range(5)]
B = [a%10 for a in A]
C = [10 - b for b in B]
while (10 in C):
  C.remove(10)

if (len(C)):
  C.remove(max(C))
print(sum(A) + sum(C))
import math
from fractions import gcd
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
def gcd(*numbers):
    return reduce(math.gcd, numbers)
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
print(gcd_list(a))

### FIXED CODE ###

import fractions
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
print(reduce(fractions.gcd,a))
import math
def get_primenumber(number):
    prime_list = []
    search_list = list(range(2,number+1))
    while True:
      if search_list[0] > math.sqrt(number):
        prime_list.extend(search_list)
        break
      else:
        head_num = search_list[0]
        prime_list.append(head_num)
        search_list.pop(0)
        search_list = [num for num in search_list if num % head_num != 0]
    return prime_list


n,m=map(int,input().split())
A=get_primenumber(m//n)
ans=2
for i in A:
    if m%i==0:ans=i
print(ans if m%n!=0 else m//n)

### FIXED CODE ###

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

ans = 1
for i in range(1,int(M ** 0.5) + 1):
    if M % i == 0:
        if i >= N:
            ans = max(ans, M // i)
        if M // i >= N:
            ans = max(ans, i)
print(int(ans))
s=input()
baks=s[:]
s="".join(list(filter(lambda x:x!="x",s)))
revs="".join(list(reversed(s)))
i=0 
j=len(s-1)
ans=0
while i<=j:
  if s[i]==s[j]:
    i+=1
    j-=1
  elif s[i]=="x":
    ans+=1
    i+=1
  elif s[j]=="x":
    ans+=1
    j-=1
  else:  break
if i <=j :
  print(-1)
  exit(0) 
else: print(ans)
  

  

### FIXED CODE ###

s=input()

i=0 
j=len(s)-1
ans=0
while i<=j:
  if s[i]==s[j]:
    i+=1
    j-=1
  elif s[i]=="x":
    ans+=1
    i+=1
  elif s[j]=="x":
    ans+=1
    j-=1
  else:  break
if i <=j :
  print(-1)
  exit(0) 
else: print(ans)
n = input()
f = [for i in range(2000)]
f = []
f[1] = 1
for i in range(n):
  A = map(int, raw_input().split())
  j = 2000
  while 0 < j:  
    if(j + A < 2000 && f[j + 1] == 1):
      f[j + A + 1] == 1
    j- = 1
 
Q = input()
for i in range(Q)
  m = map(int, raw_input().split())
  if(f[m] == 1):
    print "yes"
  else:
    print "no"

### FIXED CODE ###

n = int(raw_input())
A = map(int,raw_input().split())
Q = int(raw_input())
m = map(int,raw_input().split())

def s(i, m):
  if m == 0:
    return True
  if i >= n or m > sum(A):
    return False
  r = s(i + 1, m) or s(i + 1, m - A[i])
  return r

for j in range(Q):
  if s(0, m[j]):
    print "yes"
  else:
    print "no"
s = input()
a = z =  ''
for i, v in enumerate(s):
    if not a:
        if v == 'A':
            a = i
    if not z:
        if s[len(s) - i -1] == 'Z':
            z = len(s) - i
            
    if a >= 0 and z >= 0:
        print(z - a)
        exit()

### FIXED CODE ###

s = input()
for i, a in enumerate(s):
    if a == 'A':
        l = i
        break
for i, z in enumerate(s[::-1]):
    if z == 'Z':
        r = len(s) - i
        break
print(r - l)
from math import ceil

N,K,*A = map(int, open(0).read().split())
left = 1
right = max(A)
while left != right:
    mid = (left+right) // 2
    temp = 0
    for x in A:
        temp += ceil(x/mid) - 1
        if temp > K:
            left = mid + 1
            break
    else:
        right = mid
for i in range(left-1,left+2):
    temp = 0
    for x in A:
        temp += ceil(x/i) - 1
        if temp > K:
            break
    else:
        print(i)
        break

### FIXED CODE ###

from math import ceil

N,K,*A = map(int, open(0).read().split())
left = 1
right = max(A)
while left != right:
    mid = (left+right) // 2
    temp = 0
    for x in A:
        temp += ceil(x/mid) - 1
        if temp > K:
            left = mid + 1
            break
    else:
        right = mid
for i in range(max(1,left-1),left+2):
    temp = 0
    for x in A:
        temp += ceil(x/i) - 1
        if temp > K:
            break
    else:
        print(i)
        break
def f(x):
    return x * (x + 1) // 2


if __name__ == "__main__":
    N = int(input())
    sum_ = [(i, f(i)) for i in range(0, N + 1) if f(i) >= N]

    l = list(range(1, sum_[0][0] + 1))
    remove = sum_[0][1] - N
    l.remove(remove)
    print(*l, sep="\n")



### FIXED CODE ###

def f(x):
    return x * (x + 1) // 2


if __name__ == "__main__":
    N = int(input())
    for i in range(0, N + 1):
        if f(i) >= N:
            x, sum_ = i, f(i)
            break

    r = sum_ - N
    for i in range(1, x + 1):
        if i != r:
            print(i)
n,p= map(int,input().split())
if n==1:
    print(p)
    exit
if n==2:
    import math
    sqrt=math.sqrt(p)
    if sqrt==int(sqrt):
        print(int(sqrt))
 
else :print(1)

### FIXED CODE ###

s = input()

cnt=0
for c in s:
    if c =="2":
        cnt+=1
print(cnt)
a, b = map(int, input.split())
if a < 10 and b < 10:
  print(a*b)
else:
  print(-1)

### FIXED CODE ###

a, b = map(int, input().split())
if a < 10 and b < 10:
  print(a*b)
else:
  print(-1)
def inserrtionsort(l,n):
  for i in range(1,n):
    print(" ".join(l))
    v=l[i]
    j=i-1
    while v<l[j] and j>=0:
      l[j+1]=l[j]
      j-=1
    l[j+1]=v
  print(" ".join(l))
m=int(input())
n=list(map(int,input().split()))
inserrtionsort(n,m)


### FIXED CODE ###

def inserrtionsort(l,n):
  for i in range(1,n):
    print(" ".join(l))
    v=l[i]
    j=i-1
    while int(v)<int(l[j]) and j>=0:
      l[j+1]=l[j]
      j-=1
    l[j+1]=v
  print(" ".join(l))
m=int(input())
n=list(input().split())
inserrtionsort(n,m)
import sys
a = []
for l in sys.stdin:
    a.append(int(l))

A,B,K = a[0], a[1], a[2]

if A > K:
  print(A-K, B)
elif A+B > K:
  print(0, A+B-K)
else:
  print("0 0")


### FIXED CODE ###

import sys

def stdin_parse_int():
    a = list(map(int,input().split()))
    return a

list = stdin_parse_int()
A = list[0]
B = list[1]
K = list[2]

if A > K:
    print(str(A-K) + " " + str(B))
elif A+B > K:
    print(str(0) + " " + str(A+B-K))
else:
    print("0 0")