Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

L = int(input())
l = len(str(L))
dp = [[0]*2 for _ in range(100005)]
# dp[i][smaller]: i桁目までみる　未満なら1
# dp[i][1] : i桁目までみて、a, bどちらもL未満
# dp[i][0] : i桁目までみて、a+b = L
dp[0][0] = 1
mod = 10**9+7

for i in range(l):
  n = int(str(L)[i])
  # a + b = 0
  if n == 0: # a+bとn[i]が一致
    dp[i+1][0] = dp[i][0]
    dp[i+1][1] = dp[i][1]
  else: # a+b = 0, n[i] = 1のとき
    dp[i+1][1] = (dp[i][0] + dp[i][1]) % mod

  # a + b = 1
  if n == 0: # a+b=1, n[i]=0
    # 未満のとき、(0, 1), (1, 0)を選べる
    dp[i+1][1] += dp[i][1] * 2 % mod
    # これまで一致しているとき、どれを選んでも超えてしまう
  else: # a+b=n[i]=1のとき
    # これまで一致しているとき、(0, 1), (1, 0)を選べる
    dp[i+1][0] += dp[i][0] * 2 % mod
    # 未満のとき、(0, 1), (1, 0)を選べる
    dp[i+1][1] += dp[i][1] * 2 % mod

print((dp[l][0]+dp[l][1])%mod)




### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 7)
# ----------

INF = float("inf")
MOD = 10 ** 9 + 7

s = input().strip()

dp = [[0] * 2 for _ in range(100005)]
dp[0][0] = 1

n = len(s)
for i in range(n):
    if s[i] == "0":
        dp[i + 1][0] = dp[i][0]
        dp[i + 1][1] = dp[i][1]
    else:
        dp[i + 1][1] = (dp[i][0] + dp[i][1]) % MOD

    if s[i] == "0":
        dp[i + 1][1] += dp[i][1] * 2 % MOD
    else:
        dp[i + 1][0] += dp[i][0] * 2 % MOD
        dp[i + 1][1] += dp[i][1] * 2 % MOD

ans = (dp[n][0] + dp[n][1]) % MOD
print(ans)
### BUGGY CODE ###

def main():
    n, k = map(int, input().split())
    h = tuple(map(int, input().split()))
    inf = float('inf')
    #dp = [inf] * n
    #dp[0] = 0
    dp = [0] * n

    for i1 in range(1, n):
        #print(i1, dp)
        start = max(0, i1 - k)
        dp[i1] = dp[start] + abs(h[start] - h[i1])
        for i2 in range(start, i1):
            dp[i1] = min(dp[i1], dp[i2] + abs(h[i1] - h[i2]))
    print(dp[n - 1])

if __name__ == '__main__':
    main()

### FIXED CODE ###

n,k  = map(int, input().split())
h = list(map(int, input().split()))

dp = [0] * n
for i in range(1, n):
  start = max(0, i - k)
  dp[i] = dp[start] + abs(h[start] - h[i])
  for j in range(start+1, i + 1):
    dp[i] = min(dp[i], dp[j] + abs(h[j]-h[i]))
  
print(dp[n-1])
### BUGGY CODE ###

from collections import deque
h,w=map(int,input().split())
ans=0
field=[["*" for i in range(w+2)]]+[["*"]+list(input())+["*"] for i in range(h)]+[["*" for i in range(w+2)]]
queue=deque([])
for H in range(h+2):
    for W in range(w+2):
        if field[H][W]=="#":
            queue.append((H,W))
            field[H][W]=0
        elif field[H][W]==".":
          field[H][W]=-1
move=[(0,1),(0,-1),(1,0),(-1,0)]
ans=0
while queue:
    pos=queue.popleft()
    for i in move:
      if field[pos[0]+i[0]][pos[1]+i[1]]!=-1:continue
      if field[pos[0]+i[0]][pos[1]+i[1]]=="*":continue
      field[pos[0]+i[0]][pos[1]+i[1]]=field[pos[0]][pos[1]]+1
      queue.append((pos[0]+i[0],pos[1]+i[1]))
      if ans < field[pos[0]+i[0]][pos[1]+i[1]]:ans=field[pos[0]+i[0]][pos[1]+i[1]]
print(ans)

### FIXED CODE ###

from collections import deque
h,w=map(int,input().split())
ans=0
field=[["*" for i in range(w+2)]]+[["*"]+list(input())+["*"] for i in range(h)]+[["*" for i in range(w+2)]]
queue=deque([])
for H in range(h+2):
    for W in range(w+2):
        if field[H][W]=="#":
            queue.append((H,W))
            field[H][W]=0
        elif field[H][W]==".":
          field[H][W]=-1
move=[(0,1),(0,-1),(1,0),(-1,0)]
ans=0
while queue:
    pos=queue.popleft()
    for i in move:
      if field[pos[0]+i[0]][pos[1]+i[1]]!=-1:continue
      if field[pos[0]+i[0]][pos[1]+i[1]]=="*":continue
      field[pos[0]+i[0]][pos[1]+i[1]]=field[pos[0]][pos[1]]+1
      queue.append((pos[0]+i[0],pos[1]+i[1]))
      if ans < field[pos[0]+i[0]][pos[1]+i[1]]:ans=field[pos[0]+i[0]][pos[1]+i[1]]
print(ans)
### BUGGY CODE ###

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

list_a = []
list_b = []


for i in range(1, a):  
  if (a % (i + 1) == 0):
    list_a.append( i +1 )
    while( a % (i + 1) == 0 ):
      a = a//(i+1)
      
for i in range(1, b):  
  if (b % (i + 1) == 0):
    list_b.append( i +1 )
    while( b % (i + 1) == 0 ):
      b = b//(i+1)

#print(list_a)
#print(list_b)

set_a = set(list_a)
set_b = set(list_b)

set_ab = set_a & set_b
  
print(len(set_ab) + 1)
      

### FIXED CODE ###

import math

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

list_a = []
list_b = []
sqrt_a = math.sqrt(a)
sqrt_b = math.sqrt(b)


for i in range(2, int(sqrt_a) ):  
  if (a % (i) == 0):
    list_a.append( i )
    while( a % (i) == 0 ):
      a = a//(i)
if a > 1:
  list_a.append(a)
      
for i in range(2, int(sqrt_b) ):  
  if (b % (i) == 0):
    list_b.append( i )
    while( b % (i ) == 0 ):
      b = b//(i)
if b > 1:
  list_b.append(b)

#print(list_a)
#print(list_b)

set_a = set(list_a)
set_b = set(list_b)

set_ab = set_a & set_b
  
print(len(set_ab) + 1)
### BUGGY CODE ###

n = int(input())
a = {}
count = 0
for _ in range(n):
    res = 0
    s = input()
    for i in s:
        res += (ord(i)-ord('a'))
    if res not in a:
        a[res] = []
        a[res].append(s)
        count += 1
    else:
        if s not in a[res]:
            a[res].append(s)
            count += 1
print(count)	

### FIXED CODE ###

n = int(input())
str_list = []
count = 1
for _ in range(n):
    s = input()
    str_list.append(s)
str_list.sort()
for i in range(n-1):
    if str_list[i] != str_list[i+1]:
        count += 1
print(count)
### BUGGY CODE ###

def cmb(n,r,mod):
  a=1
  b=1
  r = min(r,n-r)
  for i in range(r):
    a = a*(n-i)%mod
    b = b*(i+1)%mod
  return a*pow(b,mod-2,mod)%mod



N,K = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
mod = 10**9+7
ans = 0
if K == 1:
  print(0)
else:
  for i in range(0,N-K+1):
    ans -= A[i]*cmb(N-i-1,K-1,10**9+7)
  for i in range(K-1,N):
    ans += A[i]*cmb(i,K-1,10**9+7)
  print(ans%mod)

### FIXED CODE ###

# kurimu_usamaro様のメソッドを拝借しています。
class Combi():
    def __init__(self, N, mod):
        self.power = [1 for _ in range(N+1)]
        self.rev = [1 for _ in range(N+1)]
        self.mod = mod
        for i in range(2, N+1):
            self.power[i] = (self.power[i-1]*i) % self.mod
        self.rev[N] = pow(self.power[N], self.mod-2, self.mod)
        for j in range(N, 0, -1):
            self.rev[j-1] = (self.rev[j]*j) % self.mod
 
    def com(self, K, R):
        if K < R:
            return 0
        else:
            return ((self.power[K])*(self.rev[K-R])*(self.rev[R])) % self.mod
 
    def pom(self, K, R):
        if K < R:
            return 0
        else:
            return (self.power[K])*(self.rev[K-R]) % self.mod
 
def main():
  mod = 10**9+7
  N,K = map(int,input().split())
  A = list(map(int,input().split()))
  A.sort()
  c = Combi(N,mod)

  ans = 0
  if K == 1:
    print(0)
  else:
    for i, a in enumerate(A):
      ans += c.com(i, K-1)*a
      ans -= c.com(N-1-i, K-1)*a
      ans %= mod
    print(ans%mod)

if __name__ == "__main__":
    main()
### BUGGY CODE ###

def find(tab, a):
    if tab[a]==-1:
        return a
    tab[a] = find(tab, tab[a])
    return tab[a]

def union(tab, a, b):
    p1, p2 = find(tab, a), find(tab, b)
    if p1 != p2:
        tab[p1] = p2

def count(tab, a):
    ans = 0
    parent = find(tab, a)
    for b in range(len(tab)):
        if find(tab, b) == parent:
            ans += 1
    return ans

N, M = [int(a) for a in input().split(" ")]
ABs = [[int(a) for a in input().split(" ")] for i in range(M)]
tab = [-1]*N
arr = []

for a, b in reversed(ABs):
    pa, pb = (find(tab, a-1), find(tab, b-1))
    if pa!=pb:
        na = count(tab, pa)
        nb = count(tab, pb)
        dn = ((na+nb)*(na+nb-1)//2)-(na*(na-1)//2)-(nb*(nb-1)//2)
        arr.append(dn)
    else:
        arr.append(0)
    union(tab, a-1, b-1)

acc = 0
for cp in reversed(arr):
    acc += cp
    print(acc)


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

def find(tab, a):
    if tab[0][a]==a:
        return a
    tab[0][a] = find(tab, tab[0][a])
    return tab[0][a]

def union(tab, a, b):
    p1, p2 = (find(tab, a), find(tab, b))
    if p1 != p2:
        tab[0][p1] = p2
        tab[1][p2] += tab[1][p1]

def size(tab, a):
    return tab[1][a]

N, M = [int(a) for a in input().split(" ")]
ABs = [[int(a) for a in input().split(" ")] for i in range(M)]
tab = [[i for i in range(N)], [1 for i in range(N)]]
arr = []

for a, b in reversed(ABs):
        a, b = (a-1, b-1)
        pa, pb = (find(tab, a), find(tab, b))
        na, nb = (size(tab, pa), size(tab, pb))
        if pa!=pb:
            dn = ((na+nb)*(na+nb-1)//2)-(na*(na-1)//2)-(nb*(nb-1)//2)
            arr.append(dn)
            union(tab, a, b)
        else:
            arr.append(0)

acc = 0
for cp in reversed(arr):
    acc += cp
    print(acc)
### BUGGY CODE ###

import math
tmp = input().split()
X = int(tmp[0])
Y = int(tmp[1])

mod = 10 ** 9 + 7

if (X + Y) % 3 != 0:
    print(0)
else:
    n = (2 * Y - X) / 3
    m = Y - 2 * n
    if n < 0 or m < 0:
        print(0)
        exit()
    total = math.factorial(n + m)
    n = math.factorial(n)
    m = math.factorial(m)
    total //= n * m
    # total //= m
    # print(total)
    # print(nm)
    # tmp = total/nm
    print(total%mod)


### FIXED CODE ###

import math
tmp = input().split()
X = int(tmp[0])
Y = int(tmp[1])

mod = 10 ** 9 + 7

if (X + Y) % 3 != 0:
    print(0)
else:
    n = int((2 * Y - X) / 3)
    m = int(Y - 2 * n)
    if n < 0 or m < 0:
        print(0)
        exit()
    n %= mod
    m %= mod

    r = n
    n = n+m
    # if n - r < r:
    #     r = n - r
    # if r == 0:
    #     return 1
    # if r == 1:
    #     return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    # return result
    print(result % mod)
### BUGGY CODE ###

N, M = map(int, input().split())
a = list(map(int, input().split()))
a = list(set(a))
N = len(a)
for k in range(N):
  a[k] //= 2


count = 0
foo = 1

while a[0]%2 == 0:
  foo *= 2
  a[0] // 2
for k in range(1, N):
  if a[k] % foo == 0 and a[k]%(2*foo) !=0:
    a[k] //= foo
    continue
  else:
    print(0)
    exit()
ans = 0

for odd in [3, 5, 7, 11]:
  flag = False
  for k in range(N):
    if a[k]%odd == 0:
      a[k] //= odd
      flag = True
  if flag:
    foo *= odd
 

def euclid(a, b):
  while b:
    a, b = b, a%b
  return a

lcm = a[0]
for k in range(1, N):
  lcm = lcm * a[k] // euclid(lcm, a[k])
  if lcm* foo > M:
    print(0)
    exit()
lcm *= foo
ans = int((M / lcm -1)//2 + 1)
print(ans)



### FIXED CODE ###

N, M = map(int, input().split())
a = list(map(int, input().split()))
for k in range(N):
  a[k] //= 2

foo = 1
while a[0]%2 == 0:
  foo *= 2
  a[0] //= 2
for k in range(1, N):
  if a[k] % foo == 0 and a[k]%(2*foo) !=0:
    a[k] //= foo
    continue
  else:
    print(0)
    exit()
ans = 0

import math
lcm = a.pop()
for k in range(1, N):
  b = a.pop()
  lcm = lcm * b // math.gcd(lcm, b)
  if lcm* foo > M:
    print(0)
    exit()
lcm *= foo
ans = int((M / lcm -1)//2 + 1)
print(ans)
### BUGGY CODE ###

def Warshall_Floyd(edges,N):
  """頂点N個のグラフ上の隣接行列edges(空欄はinfとせよ)が与えられたとき, 
  2点間の最短距離距離を隣接行列で返す"""
  for k in range(N):
    for i in range(N):
      for j in range(i):
        if edges[i][j]>edges[i][k]+edges[k][j]: return 1
  return 0
 
import sys
from sys import stdin
input = stdin.readline
N=int(input())
A=[list(map(int,input().split())) for i in range(N)]
if Warshall_Floyd(A,N):
  print(-1)
  sys.exit()
 
ans=0
for i in range(N):
  for j in range(i):
    need=1
    for k in range(N):
      if k!=i and k!=j and A[i][j]==A[i][k]+A[k][j]:
        need=0
        break
    if need:ans+=A[i][j]
print(ans)

### FIXED CODE ###

def Warshall_Floyd(edges,N):
  """頂点N個のグラフ上の隣接行列edges(空欄はinfとせよ)が与えられたとき, 
  2点間の最短距離距離を隣接行列で返す"""
  for k, i, j in itertools.product(range(N), range(N),range(N)):
    if edges[i][j]>edges[i][k]+edges[k][j]: return 1
  return 0
 
import sys
import itertools
N=int(input())
A=[list(map(int,input().split())) for i in range(N)]
if Warshall_Floyd(A,N):
  print(-1)
  sys.exit()
 
ans=0
for i, j in itertools.product(range(N),range(N)):
  need=1
  for k in range(N):
    if k!=i and k!=j and A[i][j]==A[i][k]+A[k][j]:
      need=0
      break
  if need:ans+=A[i][j]
print(ans//2)
### BUGGY CODE ###

r,g,b,n = map(int, input().split())

count = 0
r,g,b = sorted([r, g, b], reverse=True)

for i in range(n // r + 1):
    total = r * i
    if total > n:
        continue
    for j in range((n - total)//g + 1):
        total = r * i + g * j
        if total > n:
            continue
        for k in range((n - total)//b + 1):
            total = r * i + g * j + b * k
            if total == n:
                count += 1

print(count)

### FIXED CODE ###

r, g, b, n = map(int, input().split())

count = 0
r, g, b = sorted([r, g, b], reverse=True)


for i in range(n // r + 1):
    rc = r * i
    for j in range((n - rc) // g + 1):
        gc = g * j
        if (n - rc - gc) % b == 0:
            count += 1
print(count)
### BUGGY CODE ###

n,m=map(int,input().split())
flag=True
for i in range(1,int(m**0.5)+1):
  if m%i==0:
    flag=False
    break
if flag:
  print(1)
  exit()
for i in range(n,m+1):
  if m%i==0:
    print(m//i)
    exit()
print(1)

### FIXED CODE ###

n,m=map(int,input().split())
for i in range(2,m):
  if i*i>m:
    print(1)
    exit()
  if m%i==0:
    break
for i in range(n,m+1):
  if m%i==0:
    print(m//i)
    exit()
### BUGGY CODE ###

original = input()

target = 2019

results = {}
countOfMod = {0:1}
s = reversed(original)

counts = [0] * 2019
counts[0] = 1

digit = 1
mod = 0
for c in s:
    val = int(c) * digit
    currentMod = val % target
    mod = (currentMod + mod) % target
    digit *= 10

    counts[mod] += 1
    # count = countOfMod.get(mod, 0) + 1
    # countOfMod[mod] = count
    # if countOfMod[mod] > 1:
    #     results.setdefault(mod, int(count*(count-1)/2))

# print(sum(results.values()))

ans = 0
for cnt in counts:
    ans += cnt * (cnt - 1) // 2

print(ans)  # 答えの出力

### FIXED CODE ###

s = input()[::-1] # 入力文字列を逆順でsに格納

counts = [0] * 2019
counts[0] = 1

num, d = 0, 1

for char in s:
    num += int(char) * d
    num %= 2019
    d *= 10
    d%= 2019
    counts[num] += 1

ans = 0
for cnt in counts:
    ans += cnt * (cnt - 1) // 2

print(ans)
### BUGGY CODE ###

import bisect
x=int(input())
l=[(i*(i+1))//2 for i in range(100000000)]
print(bisect.bisect_left(l,x))

### FIXED CODE ###

import bisect
x=int(input())
l=[(i*(i+1))//2 for i in range(100000)]
print(bisect.bisect_left(l,x))
### BUGGY CODE ###

# ABC171 E 

import itertools

n = int(input())
a_l = [format(int(x), "030b") for x in input().split()]

for _d,_tp in enumerate(zip(*a_l)):
    if "1" not in _tp:
        continue
    if "0" not in _tp:
        continue
    else:
        _num = _tp.count("0")
        if _num % 2 == 1:
            for i in range(n):
                _str = list(a_l[i])
                if _str[_d] == "0":
                    _str[_d] = "1"
                else:
                    _str[_d] = "0"
                a_l[i] = "".join(_str)

print(*[int(x, 2) for x in a_l])

### FIXED CODE ###

# ABC171 E 

import itertools

n = int(input())
a_l = [list(format(int(x), "030b")) for x in input().split()]

for _d,_tp in enumerate(zip(*a_l)):
    if "1" not in _tp:
        continue
    if "0" not in _tp:
        continue
    else:
        _num = _tp.count("0")
        if _num % 2 == 1:
            for i in range(n):
                if a_l[i][_d] == "0":
                    a_l[i][_d] = "1"
                else:
                    a_l[i][_d] = "0"

print(*[int("".join(x), 2) for x in a_l])
### BUGGY CODE ###

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

def main(N,A,B):
    for k in range(N):
        ans_k = 0
        rem_A = A[k]
        A.remove(rem_A)
        for n in B:
            cnt = A.count(n)
            ans_k += cnt*(cnt-1)//2
        A.insert(k,rem_A)
        print(ans_k)

main(N,A,B)




### FIXED CODE ###

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

from collections import Counter
cnt_A = Counter(A)

All = 0
cnt = 0
for a in B:
    cnt = cnt_A[a]
    All +=  cnt*(cnt-1)//2

for k in range(N):
    ans_k = 0
    cnt = cnt_A[A[k]]
    ans_k = cnt - 1
    Ans = All - ans_k
    print(Ans)
### BUGGY CODE ###

def main():
    N = int(input())
    d = {}
    for _ in range(N-1):
        u, v, w = map(int, input().split())
        w %= 2
        if u in d:
            d[u].append((v, w))
        else:
            d[u] = [(v,w)]
        if v in d:
            d[v].append((u, w))
        else:
            d[v] = [(u,w)]
    cur = [1]
    nextp = []
    l = [0] * N
    v = set([1])
    while v != set(range(1,N+1)):
        for i in cur:
            for j, k in d[i]:
                if j not in v:
                    if k:
                        l[j-1] = 1 - l[i-1]
                    else:
                        l[j-1] = l[i-1]
                    v.add(j)
                    nextp.append(j)
        cur = nextp
        nextp = []
    return l
l = main()
for i in l:
    print(i)



### FIXED CODE ###

def main():
    N = int(input())
    d = {}
    for _ in range(N-1):
        u, v, w = map(int, input().split())
        w %= 2
        if u in d:
            d[u].append((v, w))
        else:
            d[u] = [(v,w)]
        if v in d:
            d[v].append((u, w))
        else:
            d[v] = [(u,w)]
    cur = [1]
    nextp = []
    l = [0] * N
    v = set(range(1, N+1))
    while v:
        for i in cur:
            v.remove(i)
            for j, k in d[i]:
                if j in v:
                    l[j-1] = 1 - l[i-1] if k else l[i-1]
                    nextp.append(j)
        cur = nextp
        nextp = []
    return l
l = main()
for i in l:
    print(i)
### BUGGY CODE ###

N, K = map(int, input().split())
P = list(map(int, input().split()))
m = 0
for i in range(N-K+1):
  sum = 0
  for j in range(i,i+K):
    sum += (P[j]+1)/2
    m = max(m, sum)
print(m)


### FIXED CODE ###

N, K = map(int, input().split())
P = list(map(int, input().split()))
p = 0
for j in range(K):
  p += (P[j]+1)/2
m = p
for i in range(N-K):
  p = p + (P[i+K]+1)/2 - (P[i]+1)/2
  m = max(m,p)
print(m)
### BUGGY CODE ###

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

B = [list(map(int, input().split())) for _ in range(M)][::-1]

class Group:
    id = 0
    def __init__(self):
        self.id = Group.id
        Group.id += 1
        self.root = None
        self.count = 1

    def top(self):
        w = self
        while not w.root is None:
            w = w.root
        return w

    def addMember(self):
        self.count += 1

    def union(self, g):
        self.top().count += g.top().count
        g.top().root = self.top()

    def __repr__(self):
        w = self.top()
        return str(("Gropup", w.id, w.count))

pt = []
G = [Group() for x in range(N+1)]
idx = 0
cnt = 0
for x, y in B:
    wx = G[x]
    wy = G[y]
    if wx.top() is wy.top():
        pt.append(0)
    else:
        pt.append(wx.top().count * wy.top().count)
        wx.union(wy)

    #print(G)

cnt = 0
for x in pt[::-1]:
    cnt += x
    print(cnt)


### FIXED CODE ###

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

pt = []
G = [[None, 1] for x in range(N+1)]

def find(x):
    n = G[x]
    c = []
    while not n[0] is None:
        c.append(n)
        n = n[0]
    for ci in c:
        ci[0] = n
    return n

cnt = 0
while len(B):
    x, y = B.pop()
    wx = find(x)
    wy = find(y)
    if wx is wy:
        pt.append(0)
    else:
        pt.append(wx[1] * wy[1])
        wx[1] += wy[1]
        wy[0] = wx

    #print(G)

cnt = 0
for _ in range(M):
    cnt += pt.pop()
    print(cnt)
### BUGGY CODE ###

import sys
s=input()
t=input()

def c(a,b,s):
    li=""
    for i in s:
        if i==a:
            li+=b
        elif i==b:
            li+=a
        else:
            li+=i
    return li
    
l=[]

for i in range(len(t)):
    if s[i]!=t[i]:
        for j in l:
            if s[i]==j:
                print("No")
                sys.exit()
        l.append(t[i])
        s=c(s[i],t[i],s)
    
        

if s==t:
    print("Yes")
else:
    print("No")
        
    

### FIXED CODE ###

s=input()
t=input()


def f(s):
    l=[]
    a="abcdefghijklmnopqrstuvwxyz"
    r=""
    for i in range(len(s)):
        if s[i] in l:
            for j in range(len(l)):
                if s[i]==l[j]:
                    r+=a[j]
        else:
            r+=a[len(l)]
            l.append(s[i])
    return r

if f(s)==f(t):
    print("Yes")
else:
    print("No")
### BUGGY CODE ###

import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n, k = map(int, input().split())
    A = list(map(int, input().split()))

    for x in range(k if k < 30 else 30):
        B = [0] * n
        for j in range(n):
            l = max(0, j - A[j])
            r = min(n - 1, j + A[j])
            B[l] += 1
            if r + 1 < n:
                B[r + 1] -= 1

        for x in range(1, n):
            B[x] += B[x - 1]
        A = B

    print(*A)


if __name__ == '__main__':
    resolve()


### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n, k = map(int, input().split())
    A = list(map(int, input().split()))

    for x in range(k if k < 50 else 50):
        B = [0] * n
        for j in range(n):
            l = max(0, j - A[j])
            r = min(n - 1, j + A[j])
            B[l] += 1
            if r + 1 < n:
                B[r + 1] -= 1

        for x in range(1, n):
            B[x] += B[x - 1]
        A = B

    print(*A)


if __name__ == '__main__':
    resolve()
### BUGGY CODE ###

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

li.sort()

ind=int(n//2)-1

count=0
for k in range(li[ind],li[ind+1]+1):
  miman=0
  ijou=0
  for num in li:
    if num >= k:
      ijou+=1
    elif num < k:
      miman+=1
      
  if ijou==miman:
    count+=1
    
print(count)

### FIXED CODE ###

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

li.sort()

ind=int(n//2)-1

count=0

for k in range(li[ind]+1,li[ind+1]+1):
  count+=1
  
print(count)
### BUGGY CODE ###

import os, sys, atexit
from io import BytesIO, StringIO
 
input = BytesIO(os.read(0, os.fstat(0).st_size)).readline
_OUTPUT_BUFFER = StringIO()
sys.stdout = _OUTPUT_BUFFER
 
@atexit.register
def write():
    sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
n = int(input())
l = list(map(int, input().split()))
l.sort()
l.append(9999999999999)
c = 0
for i in range(n - 2):
    t = i + 2
    for j in range(i + 1, n - 1):
        for k in range(t, n + 1):
            if l[i] + l[j] <= l[k]:
                t = k
                break
        if t > j: c += t - j - 1
        if j + 1 == t: t += 1
print(c)

### FIXED CODE ###

import sys
input = sys.stdin.readline
def main():
  n = int(input())
  l = list(map(int, input().split()))
  l.sort()
  l.append(99999999)
  c = 0
  for i in range(n - 2):
      t = i + 2
      for j in range(i + 1, n - 1):
          for k in range(t, n + 1):
              if l[i] + l[j] <= l[k]:
                  t = k
                  break
          if t > j: c += t - j - 1
          if j + 1 == t: t += 1
  print(c)
if __name__ == "__main__":
  main()