Harryxun/stf_run huggingface dataset:
from bisect import bisect_left
n = int(input())
l = list(map(int, input().split()))
sort_l = sorted(l)
count = 0

for a in range(n-1):
    for b in range(i+1, n):
        c = bisect_left(sort_l, sort_l[a] + sort_l[b])
        if c > b:
            count += c - b -1
        else:
            pass     
        

print(count)



### FIXED CODE ###

import bisect
n = int(input())
l = list(map(int, input().split()))
sort_l = sorted(l)
count = 0

for a in range(n):
    for b in range(a+1, n):
        c = bisect.bisect_left(sort_l, sort_l[a] + sort_l[b])
        if c > b:
            count += c - b -1
        else:
            pass     
        

print(count)
N = int(input())
A = list(map(int, input().split())) 
P=round(sum(A)/N)
B=0
for i in range(N):
	B=B+(A[i]-P)**2
print(B)

### FIXED CODE ###

N,R=map(int, input().split()) 
if N>=10:
    print(R)
if 0<=N<10:
    print(R+100*(10-N))
from collections import defaultdict
from scipy.sparse.csgraph import shortest_path
from scipy.sparse import csr_matrix
N, X, Y = map(int, input().split())
edges = [[0 for _ in range(N)] for _ in range(N)]
for i in range(N-1):
    edges[i][i + 1] = 1
    edges[i + 1][i] = 1
X -= 1
Y -= 1
edges[X][Y] = 1
edges[Y][X] = 1
res = shortest_path(csr_matrix(edges))
ans = defaultdict(int)
for i in range(N-1):
    for j in range(i+1, N):
        ans[int(res[i][j])] += 1
for k in range(1, N):
    print(ans[k])

### FIXED CODE ###

from collections import defaultdict
N, X, Y = map(int, input().split())
d = [[0 for _ in range(N)] for _ in range(N)]
for i in range(N-1):
    for j in range(i+1, N):
        d[i][j] = d[i][j-1] + 1
X -= 1
Y -= 1
for i in range(N-1):
    for j in range(i + 1, N):
        diff = abs(X - i) + abs(Y - j) + 1
        if diff < d[i][j]:
            d[i][j] = diff
#print(d)
ans = defaultdict(int)
for i in range(N-1):
    for j in range(i + 1, N):
        ans[d[i][j]] += 1
for k in range(1, N):
    print(ans[k])
n=int(input())
a=[]
for i in range(n):
    a.append(input())
maxv=a[0]
minv=a[0]
for j in range(n):
    maxv=max(maxv,a[j])
    minv=min(minv,a[j])
print(maxv-minv)


### FIXED CODE ###

n=int(input())
a=[]
for i in range(n):
    a.append(int(input()))
maxv=a[1]-a[0]
minv=a[0]
for j in range(1,n):
    maxv=max(maxv,a[j]-minv)
    minv=min(minv,a[j])
print(maxv)
#!/usr/bin/env python

N,K=map(int,raw_input().split())
l=map(int,raw_input().split())
l.sort()
print sum(l[len(l)-K:len(l)])

### FIXED CODE ###

#!/usr/bin/env python

A,B=map(int,raw_input().split())
ans='Impossible'
if A%3==0:
    ans='Possible'
if B%3==0:
    ans='Possible'
if (A+B)%3==0:
    ans='Possible'

print ans
n = int(input())
A = list(map(int, input().split()))
k = [0]*n
mk = [0]*8
for i in range(n):
    k[i] = A[i]//400
    mk[k[i]-1] += 1
r1 = len(set(k))-min(1, mk[-1])
r2 = r1+mk[-1]
print(str(r1)+" "+str(r2))

### FIXED CODE ###

#cant fix re, just copy and paste.
n = int(input())
a = list(map(int, input().split()))
a.sort()
free=0
cset=set()
for rate in a:
    color = int(rate / 400)
    if color >=8:
        free+=1
    else:
        cset.add(color)

colormin=len(cset)
colormax=colormin+free
 
print(str(max(1,colormin)), colormax)
n=int(input())
xy=[]
for i in range(n):
  a=int(input())
  xy.append([list(map(int,input().split())) for j in range(a)])

ans=0
for i in range(2**n):
  honest=[]
  for j in range(n):
    if (i>>j)&1:
      honest.append(1)
    else:
      honest.append(0)
  p=0
  for j,k in enumerate(honest):
    if k==1:
      r=0
      for l in xy[j]:
        if honest[l[0]-1]!=l[1]:
          r=1
          break    
      if r==0:
        p=p+1
  if p==sum(honest):
    ans=p
print(max(ans))

### FIXED CODE ###

a,b,c=map(int,input().split())
print('win' if a+b+c<=21 else 'bust')
a,b=  map(int,input(0.split()))
print(a*b)

### FIXED CODE ###

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

if n%500==0:
    print('Yes')
elif n%500<=a:
    print('Yes')
elif n%500>a:
    print('No')

### FIXED CODE ###

n=int(input())
a=int(input())

if n%500==0:
    print('Yes')
elif n%500<=a:
    print('Yes')
else:
    print('No')
A = input()
B = input()

answer = A - 2B
if answer < 0:
  answer = 0

print(answer)

### FIXED CODE ###

A,B=map(int, input().split()) 
answer = A - 2*B
if answer < 0:
  answer = 0
 
print(answer)
import math
def main():
    r = float[int(i) for i in input().sprit()]
    print ("%f %f" % (r ** 2 * math.pi,  2 * r * math.pi))

if __name__ == '__main__':
    main()

### FIXED CODE ###

import math
r = float(input())

s = r * r * math.pi
l = r * 2 * math.pi

print("{0:.5f} {1:.5f}".format(s, l))
N = int(input())
A = list(map(int, input().split()))

import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

ans = 0

for i in range(N):
    if ans == 0:
        ans = gcd_list([*A[:i], *A[i+1:]])
        
    elif gcd_list([*A[:i], *A[i+1:]]) > ans:
        ans = gcd_list([*A[:i], *A[i+1:]])
        break
        
print(ans)

### FIXED CODE ###

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

import fractions

L = [A[0]]
R = [A[-1]]

for i in range(1, N):
    L.append(fractions.gcd(L[i-1], A[i]))
    R.append(fractions.gcd(R[i-1], A[-(i+1)]))

R.reverse()


ans = 0

for i in range(N):
    if i == 0:
        ans = max(ans, R[1])
    elif i == N-1:
        ans = max(ans, L[-2])
    else:
        ans = max(ans, fractions.gcd(L[i-1], R[i+1]))
    
print(ans)
h,w=map(int,input().split())
s=['#'*(w+2)]+['#'+input()+'#' for _ in [0]*h]+['#'*(w+2)]
l=[[0]*(w+2) for _ in [0]*(h+2)]
for i in range(h+2):
    for j in range(w+2):
        if s[i][j]=='#':
            l[i][j]=-1
def sol(m,n):
    global l
    if l[m][n]>=0:
        for [i,j] in [[m-1,n],[m+1,n],[m,n-1],[m,n+1]]:
            if l[i][j]==0 and [i,j]!=[1,1]:
                l[i][j]=l[m][n]+1
                sol(i,j)
            elif l[i][j]>l[m][n]+1:
                l[i][j]=l[m][n]+1
                sol(i,j)
sol(1,1)
print(h*w-l[h][w]-(sum(x.count('#') for x in s)-2*h-2*w-4)-1)

### FIXED CODE ###

import sys
sys.setrecursionlimit(3000)
h,w=map(int,input().split())
s=['#'*(w+2)]+['#'+input()+'#' for _ in [0]*h]+['#'*(w+2)]
l=[[0]*(w+2) for _ in [0]*(h+2)]
for i in range(h+2):
    for j in range(w+2):
        if s[i][j]=='#':
            l[i][j]=-1
def sol(m,n):
    global l
    if l[m][n]>=0:
        for i,j in [(m-1,n),(m+1,n),(m,n-1),(m,n+1)]:
            if l[i][j]==0 and [i,j]!=[1,1]:
                l[i][j]=l[m][n]+1
                sol(i,j)
            elif l[i][j]>l[m][n]+1:
                l[i][j]=l[m][n]+1
                sol(i,j)
sol(1,1)
if l[h][w]==0:print(-1)
else:print(h*w-l[h][w]-(sum(x.count('#') for x in s)-2*h-2*w-4)-1)
p = map(int, '1 2 3 4 5 6 7'.split())
v = sorted(p)
cou=0
if p==v:
    cou =2
else:
    for i in range(len(p)):
        if not p[i] == v[i]:
            print i
            cou+=1

if cou == 2:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

n = int(input())
p = list(map(int, input().split()))
 
q = sorted(p)
cou = 0
for i in range(n):
    if p[i] != q[i]:
        cou += 1
 
if cou <= 2:
    print("YES")
else:
    print("NO")
import queue
h,w,n = map(int,input().split())
factrys = [None] * (n + 1)
ss = ["X" * (w + 2)]
for i in range(h):
  s = "X" + input() + "X"
  if "S" in s:
    factrys[0] = (i + 1, s.index("S"))
  for j in range(1,n + 1):
    if str(j) in s:
      factrys[j] = (i + 1, s.index(str(j)))
  ss.append(s)
ss.append("X" * (w + 2))
mp = []
que = queue.Queue()

def bfs(i):
  while True:
    (x,y) = que.get()
  #  print(i,x,y)
  #  print(mp[x][y])
    if (x,y) == factrys[i + 1]:
      return mp[x][y]
    count = mp[x][y]
    if ss[x + 1][y] != "X" and mp[x + 1][y] is None:
      mp[x + 1][y] = count + 1
      que.put((x + 1, y))
    if ss[x - 1][y] != "X" and mp[x - 1][y] is None:
      mp[x - 1][y] = count + 1
      que.put((x - 1, y))
    if ss[x][y + 1] != "X" and mp[x][y + 1] is None:
      mp[x][y + 1] = count + 1
      que.put((x, y + 1))
    if ss[x][y - 1] != "X" and mp[x][y - 1] is None:
      mp[x][y - 1] = count + 1
      que.put((x, y - 1))

ans = 0
for i in range(n):
  mp = [[None] * (w + 2) for j in range(h + 2)]
  x,y = factrys[i]
  que = queue.Queue()
  mp[x][y] = 0
  que.put((x,y))
  ret = bfs(i)
  if ret is None:
    ans += 0
  else:
    ans += (bfs(i))
print(ans)


### FIXED CODE ###

from collections import deque

def main():
  h, w, n = map(int, input().split())
  mp = ["X" + input() + "X" for _ in range(h)]
  mp.insert(0, "X" * (w + 2))
  mp.append("X" * (w + 2))
  
  poss = [None] * (n + 1)
  for y in range(1, h + 1):
    for x in range(1, w + 1):
      if mp[y][x] == "S":
        poss[0] = (x, y)
      elif "1" <= mp[y][x] <= "9":
        poss[int(mp[y][x])] = (x, y)
  
  ans = 0
  vec = ((1, 0), (0, -1), (-1, 0), (0, 1))
  for i in range(n):
    sx, sy = poss[i]
    gx, gy = poss[i + 1]
    used = [[False] * (w + 2) for _ in range(h + 2)]
    used[sy][sx] = True
    que = deque()
    push = que.append
    pop = que.popleft
    push((0, sx, sy))
    while que:
      cnt, x, y = pop()
      if (x, y) == (gx, gy):
        ans += cnt
        break
      
      for dx, dy in vec:
        nx, ny = x + dx, y + dy
        if used[ny][nx] or mp[ny][nx] == "X":continue
        used[ny][nx] = True
        push((cnt + 1, nx, ny))
  
  print(ans)

main()
S = input()


count=0
for i in range(len(S)//2):
  if(S[i] != S[-i-1]):
    count++

print(count)

### FIXED CODE ###

S = input()
 
count=0
for i in range(len(S)//2):
  if S[i] != S[-i-1]:
    count+=1

print(count)
#!/usr/bin/env python

nm = [int(i) for i in input().split()]
n = nm[0]
m = nm[1]

student = list()
point = list()

for i in range(n):
    student.append([int(i) for i in input().split()])

for j in range(m):
    point.append([int(j) for j in input().split()])


mat = [[abs(student[i][0]-point[j][0]) + abs(student[i][1]-point[j][1]) for j in range(m)] for i in range(m)]

for i in range(n):
    print(mat[i].index(min(mat[i]))+1)

### FIXED CODE ###

#!/usr/bin/env python

nm = [int(i) for i in input().split()]
n = nm[0]
m = nm[1]

a = list()
b = list()
c = list()
d = list()

for i in range(n):
    ab = [int(tmp) for tmp in input().split()]
    a.append(ab[0])
    b.append(ab[1])

for j in range(m):
    cd = [int(tmp) for tmp in input().split()]
    c.append(cd[0])
    d.append(cd[1])

for i in range(n):
    min_dist = abs(a[i]-c[0]) + abs(b[i]-d[0])
    checkpoint = 1
    for j in range(m):
        cur_dist = abs(a[i]-c[j]) + abs(b[i]-d[j])
        if min_dist > cur_dist:
            min_dist = cur_dist
            checkpoint = j + 1
    print(checkpoint)
n, a, b, c, d = input().split()
s = input()
flag = False
for i in range(n-1):
    if s[i] == s[i+1] == '#':
        print("No")
        exit()
if c < d:
    print("Yes")
else:
    for i in range(b+1, d):
        if s[i-1] == s[i+1] == s[i]:
            print("Yes")
            exit()
    print("No")



### FIXED CODE ###

n, a, b, c, d = map(int, input().split())
a -= 1
b -= 1
c -= 1
d -= 1
s = input()
flag = False
for i in range(a,c):
    if s[i] == s[i+1] == '#':
        print("No")
        exit()
for i in range(b,d):
    if s[i] == s[i+1] == '#':
        print("No")
        exit()
if c < d:
    print("Yes")
else:
    for i in range(b, d+1):
        if s[i-1] == '.' and s[i] == '.' and s[i+1] == '.':
            print("Yes")
            exit()
    print("No")
A = 25 - int(input()) # 0,1,2,3
X = [0] * (10 ** 8 * (A*2+2))

### FIXED CODE ###

D = int(input())
if D == 25:
    print("Christmas")
elif D == 24:
    print("Christmas Eve")
elif D == 23:
    print("Christmas Eve Eve")
else:
    print("Christmas Eve Eve Eve")
n,m = map(int,input().split())
s = []
c = []
for i in range(m):
    val1,val2 = map(int,input().split())
    s.append(val1)
    c.append(val2)

digit = max(s)
if digit == 1:
    start = 0
else:
    start = 10 ** (digit - 1)


ans = []

for i in range(start, 10 ** 3):
    num = str(i)
    flg = 0
    for j in range(m):
        if num[s[j] - 1] == str(c[j]):
            flg = 1
        else:
            flg = 0
            break
    if flg == 1 and len(num) == n:
        ans.append(i)

if ans:
    print(min(ans))
else:
    print(-1)

### FIXED CODE ###

n,m = map(int,input().split())
s = []
c = []
for i in range(m):
    val1,val2 = map(int,input().split())
    s.append(val1)
    c.append(val2)

for i in range(1000):
    if len(str(i)) == n:
        flg = True
        for j in range(m):
            if int(str(i)[s[j] - 1]) != c[j]:
                    flg = False
        if flg:
            print(i)
            break
if not flg:
    print(-1)
N = int(input())
list = input().split()

num_list = []
for c in list:
    n = int(c)
    num_list.append(n)

state = True

i = 0

while state:
    for n in num_list:
        if n % 2:
            state = False
        else:
            n /= 2
    if state:
        i += 1

print(i)


### FIXED CODE ###

print(input().count("1"))
# coding: utf-8
import copy
import numpy as np

n, k = map(int, input().split())
v = list(map(int, input().split()))
rev = copy.copy(v)
rev.reverse()

lcs = [0]+np.cumsum(v)
rcs = [0]+np.cumsum(rev)
# print(lcs,rcs)

ans = -10**20
for l in range(n+1):
  for r in range(n+1-l):
    able = True
    d = k - ( l + r )
    if d < 0:
      able = False
      break
    m = lcs[l] + rcs[r]
    t = v[0:l] + rev[0:r]
    m = sum(t)
    # print(t,l,r,m)
    t.sort()
    # print(t)
    d = min(d,l+r)
    for i in range(d):
      if 0 > t[i]:
        m -= t[i]
      else:
        break
    # print(m)
    ans = max(ans,m)

print(ans)
    

### FIXED CODE ###

# coding: utf-8
import copy
import numpy as np

n, k = map(int, input().split())
v = list(map(int, input().split()))
rev = copy.copy(v)
rev.reverse()

lcs = [0]+np.cumsum(v)
rcs = [0]+np.cumsum(rev)
# print(lcs,rcs)

ans = -10**20
for l in range(n+1):
  for r in range(n+1-l):
    able = True
    d = k - ( l + r )
    if d < 0:
      able = False
      break
    # m = lcs[l] + rcs[r]
    t = v[0:l] + rev[0:r]
    m = sum(t)
    # print(t,l,r,m)
    t.sort()
    # print(t)
    d = min(d,l+r)
    for i in range(d):
      if 0 > t[i]:
        m -= t[i]
      else:
        break
    # print(m)
    ans = max(ans,m)

print(ans)
# -*- coding: utf-8 -*-
from itertools import accumulate
def inpl(): return map(int, input().split())

N, K, Q = inpl()
A = input()

S = sorted(map(int, A.split()))
ans = S[Q-1] - S[0]
S = S[::-1]
Que = [A]


while True:
    s = S.pop()
    nQ = []
    OK = 0
    for q in Que:
        for r in (" "+q).split(" {} ".format(s)):
            L = len(r.split())
            if L >= K:
                nQ.append(r)
                OK += (L - K + 1)
    if OK < Q:
        break
    tmp = []
    for q in nQ:
        tmp.extend(sorted([int(x) for x in q.split()])[::-1][K-1:])
    tmp = sorted(tmp)
    ans = min(ans, tmp[Q-1] - tmp[0])
    Que = nQ

print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-
from itertools import accumulate
def inpl(): return map(int, input().split())

N, K, Q = inpl()
A = " " + input()
S = sorted(map(int, A.split()))
ans = S[Q-1] - S[0]
S = S[::-1]

while S:
    s = S.pop()
    A = A.replace(" {} ".format(s), " x ")

    OK = 0
    Que = A.split("x")

    tmp = []
    for q in Que:
        tmp.extend(sorted([int(x) for x in q.split()])[::-1][K-1:])
    if len(tmp) < Q:
        break
    tmp = sorted(tmp)
    ans = min(ans, tmp[Q-1] - tmp[0])

print(ans)
a=int(input())
t=100
sum=0
while(t<a):
	t=floor(t*101/100)
	sum=sum+1
print(sum)


### FIXED CODE ###

import math
a=int(input())
t=100
sum=0
while(t<a):
	t=math.floor(t*101/100)
	sum=sum+1
print(sum)
lis = list(map(int, input().split()))
lis2 = list(map(int, input().split()))
n = lis[0]
k = lis[1]
a = []
b = []
for i in range(n):
    if lis2[i] not in a
        a.append(lis2[i])
        count = 0
        for j in range(i+1,n)
            if lis[j] == lis[i]
                count += 1
        b.append(count)

if len(b) <= k
    print(0)
else:
    b.sort()
    b.reserve()
    swap = 0
    for i in range(k,len(b))
        swap += b[i]
    print(swap)

### FIXED CODE ###

lis = list(map(int, input().split()))
lis2 = input().split()
n = lis[0]
k = lis[1]
d = {}

for i in range(n):
    if lis2[i] not in d.keys():
       d[lis2[i]] = 1
    else:
        d[lis2[i]] += 1 
        
if len(list(d.values())) <= k:
    print(0)
else:
    a = list(d.values())
    a.sort()
    a.reverse()
    swap = 0
    for i in range(k,len(a)):
        swap += a[i]
    print(swap)
A,B=map(int,input().split())
print("Yay!" if a <= 8 and b <= 8 else ":(")

### FIXED CODE ###

A,B=map(int,input().split())
print("Yay!" if A<9 and B<9 else ":(")
A,B,C,X = [int(input()) for i in range(4)]

count = 0
for a in range(0,A+1):
    Xa  = X - 500*a
    if Xa < 0:
        break
    for b in range(0,B+1):
        Xab = Xa - 100*b
        if Xab < 0:
            break
        for c in range(0,C+1):
            if Xabc == Xab - 50*c == 0:
                count += 1
                break
                
print(count)

### FIXED CODE ###

A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0
for a in range(0,A+1):
    Xa  = X - 500*a
    if Xa < 0:
        break
    for b in range(0,B+1):
        Xab = Xa - 100*b
        if Xab < 0:
            break
        for c in range(0,C+1):
            Xabc = Xab - 50*c
            if Xabc == 0:
                count += 1
                break
                
print(count)
n=input()
hon="24579"
pon="0168"
x=n[len(n)-1]
if x in hon:
  print("hon")
  elif x in pon:
    print("pon")
    else:
      print("bon")


### FIXED CODE ###

n=input()
hon="24579"
pon="0168"
x=n[len(n)-1]
if x in hon:
	print("hon")
elif x in pon:
	print("pon")
else:
	print("bon")
s=list(input())
word,cnt=s[0],0
n=len(s)
S=""
for i in range(n):
    if word!=s[i]:
        S +=word+str(cnt)
        cnt=1
        word=s[i]
    else:
        cnt +=1
S +=word+str(cnt)
S +="G"
S=list(S)
cnt=0
for i in range(0,len(S)-1,2):
    if S[i]+S[i+2]=="ST":
        cnt +=(min(int(S[i+1]),int(S[i+3])))*2
print(n-cnt)

### FIXED CODE ###

from collections import deque
s=list(input())
A=deque([])
for i in s:
    if i=="S":A.append(i)
    elif i=="T":
        if len(A)==0 or A[-1]=="T":A.append(i)
        else:A.pop()
print(len(A))
# import bisect
# import heapq
# from copy import deepcopy
# from collections import deque
# from collections import Counter
# from itertools import accumulate
# from itertools import permutations
# import numpy as np
import math
# mod = 10**9 + 7

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

def prime(n):
    p = True
    for i in range(2,math.sqrt(n) + 1):
        if n % i == 0 :
            p = False
            break

    return p

print('Yes' if n<=81 and not prime(n) else 'No')

### FIXED CODE ###

# import bisect
# import heapq
# from copy import deepcopy
# from collections import deque
# from collections import Counter
# from itertools import accumulate
# from itertools import permutations
# import numpy as np
import math
# mod = 10**9 + 7

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


if n > 81:
    print('No')
    exit()

else:
    for i in range(1,10):
        if n % i == 0 and 1<= (n // i) <=9:
            print('Yes')
            exit()

print('No')
#Coding: utf-8
N=int(input())
a=[]
for i in 5:
  a.append(int(input()))
import math
print(math.ceil(N/min(a))-4)



### FIXED CODE ###

#Coding: utf-8
N=int(input())
a=[]
for i in range(5):
  a.append(int(input()))
import math
print(math.ceil(N/min(a))+4)
code = r"""
# distutils: language=c++
# distutils: include_dirs=opt/atcoder-stl
from libcpp cimport bool
from libcpp.vector cimport vector
cdef extern from "<atcoder/dsu>" namespace "atcoder" nogil:
    cdef cppclass dsu:
        dsu(int n)
        int merge(int a, int b)
        bool same(int a, int b)
        int leader(int a)
        int size(int a)
        vector[vector[int]] groups()
from cython.parallel cimport prange
from libc.stdio cimport getchar, putchar
cdef inline int read() nogil:
    cdef int b, c = 0
    while 1:
        b = getchar() - 48
        if b < 0: break
        c = c * 10 + b
    return c
cdef int i
cdef dsu *d = new dsu(read())
for i in prange(read(), nogil=1):
    if read():
        if d.same(read(), read()): putchar(49)
        else: putchar(48)
        putchar(10)
    else: d.merge(read(), read())
"""
import os, sys
if sys.argv[-1] == 'ONLINE_JUDGE':
    open('solve.pyx', 'w').write(code)
    os.system('cythonize -i -3 -b solve.pyx')
import solve

### FIXED CODE ###

p=[-1]*8**6
for q in[*open(0)][1:]:
 q,*x=map(int,q.split());a,b=sorted(map(f:=lambda x:f(p[x])if~p[x]<0else x,x))
 if q:print(+(a==b))
 elif a<b:p[b]=a
N == int(input())
if N//10==9 or N%10==9: print('Yes')
else: print('No')

### FIXED CODE ###

N = int(input())
if N//10==9 or N%10==9: print('Yes')
else: print('No')
# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde	s=input()	s='abcde'
# abcde	s=list(input())	s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ)	a=int(input())	a=5
# 1 2	| x,y = map(int,input().split())   |	x=1,y=2
# 1 2 3 4 5 ... n 　	li = input().split()	li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n 　	li = inpl()	li=[1,2,3,4,5,...,n]
# FFFTFTTFF 　	li = input().split('T')	li=['FFF', 'F', '', 'FF']

# INPUT
# 3
# hoge
# foo
# bar
# ANSWER
# n=int(input())
# string_list=[input() for i in range(n)]

# import math
# import numpy as np
# import copy
# from collections import defaultdict, Counter
# from itertools import product
# from bisect import bisect_left, bisect_right
def inpl(): return list(map(int, input().split()))

S = list(input())
N = len(S)
while True:
    flag = False
    for i in range(1, len(S)-2):
        l = S[i-1]
        mid = S[i:i+2]
        r = S[i+2]
        if mid == ["0", "1"] or mid == ["1", "0"]:
            if (l == "0" and r == "1") or (l == "1" and r == "0"):
                del S[i:i+2]
                i += 2
                flag = True
                if i >= len(S)-3:
                    break


    if flag:
        continue

    for i in range(0, len(S)-1):
        mid = S[i:i+2]
        if mid == ["0", "1"] or mid == ["1", "0"]:
            del S[i:i+2]
            i += 2
            if i >= len(S)-1:
                break

    break
print(N-len(S))

### FIXED CODE ###

# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde	s=input()	s='abcde'
# abcde	s=list(input())	s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ)	a=int(input())	a=5
# 1 2	| x,y = map(int,input().split())   |	x=1,y=2
# 1 2 3 4 5 ... n 　	li = input().split()	li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n 　	li = inpl()	li=[1,2,3,4,5,...,n]
# FFFTFTTFF 　	li = input().split('T')	li=['FFF', 'F', '', 'FF']

# INPUT
# 3
# hoge
# foo
# bar
# ANSWER
# n=int(input())
# string_list=[input() for i in range(n)]

# import math
# import numpy as np
# import copy
# from collections import defaultdict, Counter
# from itertools import product
# from bisect import bisect_left, bisect_right
def inpl(): return list(map(int, input().split()))

S = input()
N = len(S)
c0 = S.count("0")
c1 = S.count("1")

print(2*min(c0, c1))
n,x = map(int,input().split())
x = list(map(int,input().split()))
l = [abs(i-x) for i in x]

#ユークリッド互除法
def gcd(x,y):
    if y == 0:
        return x
    else:
        return gcd(y,x%y)

ans = l[0]
for i in range(1,n):
    ans = gcd(l[i],ans)
print(ans)

### FIXED CODE ###

n,x = map(int,input().split())
a = list(map(int,input().split()))
new_lst=[abs(i-x) for i in a]

def gcd(x,y):
    if y==0:
        return x
    else:
        return gcd(y,x%y)

ans=new_lst[0]
for i in range(1,n):
	ans =gcd(new_lst[i],ans)

print(ans)
import math
n = int(input())
a = list(map(int,input().split()))
m = 0
for i in range(n):
    b = a.copy()
    b[i:i+1] = []
    g = b[0]
    for j in range(n-1):
        g = math.gcd(g,b[j])
    m = max(m,g)
print(m)

### FIXED CODE ###

def gcd(x,y):
    while y != 0:
        x,y = y,x%y
    return x
n = int(input())
a = list(map(int,input().split()))

L,R = [0],[0]
for i in range(1,n+1): #L[i]は左i個,R[i]は右i個
    L.append(gcd(L[-1],a[i-1]))
    R.append(gcd(R[-1],a[n-i]))
print(max(gcd(L[i],R[n-i-1]) for i in range(n)))