Harryxun/stf_run huggingface dataset:
#!/usr/bin/env python3
import collections as cl
import sys


def II():
    return int(sys.stdin.readline())


def MI():
    return map(int, sys.stdin.readline().split())


def LI():
    return list(map(int, sys.stdin.readline().split()))


def main():
    N = II()

    words = []
    starts_with_B = 0
    end_with_A = 0
    contain_AB = 0
    starts_with_B_and_end_with_A = 0
    for i in range(N):
        word = input()
        words.append(word)
        contain_AB += len(word) - len(word.replace("AB", "_"))

        if word[0] == "B" and word[-1] == "A":
            starts_with_B_and_end_with_A += 1
        elif word[0] == "B":
            starts_with_B += 1
        elif word[-1] == "A":
            end_with_A += 1

    if starts_with_B_and_end_with_A == 0:
        print(contain_AB + min(starts_with_B, end_with_A))
        return

    min_A_or_B = min(starts_with_B, end_with_A)
    amari = abs(starts_with_B - end_with_A)
    contain_AB += min_A_or_B

    if amari == 0:
        print(contain_AB)

    if amari >= starts_with_B_and_end_with_A:
        print(contain_AB + starts_with_B_and_end_with_A)
    else:
        available = starts_with_B_and_end_with_A // amari
        contain_AB += available * amari
        starts_with_B_and_end_with_A = starts_with_B % amari
        print(contain_AB + starts_with_B_and_end_with_A)


main()


### FIXED CODE ###

#!/usr/bin/env python3
import collections as cl
import sys


def II():
    return int(sys.stdin.readline())


def MI():
    return map(int, sys.stdin.readline().split())


def LI():
    return list(map(int, sys.stdin.readline().split()))


def main():
    N = II()

    words = []
    starts_with_B = 0
    end_with_A = 0
    contain_AB = 0
    starts_with_B_and_end_with_A = 0
    for i in range(N):
        word = input()
        words.append(word)
        contain_AB += len(word) - len(word.replace("AB", "_"))

        if word[0] == "B" and word[-1] == "A":
            starts_with_B_and_end_with_A += 1
        elif word[0] == "B":
            starts_with_B += 1
        elif word[-1] == "A":
            end_with_A += 1

    if starts_with_B_and_end_with_A == 0:
        print(contain_AB + min(starts_with_B, end_with_A))
        return
    if starts_with_B + end_with_A == 0:
        print(contain_AB + starts_with_B_and_end_with_A - 1)
        return
    print(contain_AB + starts_with_B_and_end_with_A +
          min(starts_with_B, end_with_A))


main()
import math
N, K = map(int,input().split())
for i in range(1,K+1):
    ans = (int(math.factorial(K-1)) // int((math.factorial(K-1-i+1)*math.factorial(i-1)))) * (int(math.factorial(N-K+1)) // int((math.factorial(N-K-i)*math.factorial(i))))
    tans = int(ans % int(math.pow(10,9)+7))
    print(tans)

### FIXED CODE ###

import math
N, K = map(int,input().split())
for i in range(1,K+1):
    if N-K+1-i >= 0:
        ans = (math.factorial(K-1) // (math.factorial(K-1-i+1)*math.factorial(i-1))) * (math.factorial(N-K+1) // (math.factorial(N-K+1-i)*math.factorial(i)))
        tans = int(ans % (10**9+7))
        print(tans)
    else:
        print(0)
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))

### FIXED CODE ###

print(input().count("1"))
import bisect

N, M, V, P = map(int, input().split())
A = list(map(int, input().split()))
A.sort()

Ap = A[-P] # 初期状態でP番目に大きい点数
idx = bisect.bisect_left(A, Ap) # 初期状態で得点がApより小さい問題の数
ans = N - idx # 初期状態で得点がAp以上であれば候補に入る


for i, a in enumerate(A[:idx]):
  j = 1
  b = a + M
  if b < Ap:
    continue
  n0 = bisect.bisect_right(A, a) # M人全員から投票されてもbを超えない問題の数
  n1 = N - bisect.bisect_left(A, b+1) # 投票されない状態で既にbより点数が高い問題の数
  mv = (V - n0) * M # 上の問題達には取り敢えず投票しておいて、他に選べる問題の数
  if mv <= 0:
    j = 0
    break
  else:
    res = False
    p = P - 1
    for _a in A[n0:][::-1]:
      if p:
        p -= 1
        diff = M
      else:
        diff = b - _a
      if diff <= 0:
        break
      else:
        mv -= diff
        if mv <= 0:
          res = True
          j = 0
          break
    if res:
      break

ans += idx - i - j # 一度候補に入る数を発見したら、それ以降も当然候補に入る
print(ans)

### FIXED CODE ###

import bisect

N, M, V, P = map(int, input().split())
A = list(map(int, input().split())) + [-M-1]
A.sort()

Ap = A[-P] # 初期状態でP番目に大きい点数
I = N + 2 - P
right = N + 1 - P
left = 0

while left + 1 < right:
  mid = (left + right) // 2
  b = A[mid] + M
  if b < Ap:
    left = mid
  else:
    v = V - (bisect.bisect_right(A, A[mid])-1) - (P-1)
    if v <= 0:
      right = mid
    else:
      mv = M*v
      for i in range(mid+1, I):
        if A[i] == A[mid]:
          continue
        mv -= b - A[i]
        if mv <= 0:
          break
      if mv <= 0:
        right = mid
      else:
        left = mid

print(N + 1 - right)
a,b,c= map(int,input().split())
pritn((c//a)*b)

### FIXED CODE ###

# T/A * B を出力する
a,b,t = map(int,input().split())
print(b*(t//a))
S=str(input())

if 0<int(S[0]+S[1])<=12 and 0<int(S[2]+S[3])<=12:
  print('AMBIGUOUS');exit()
elif S[0]+S[1]=='00':
  print('NA');exit()
elif  (S[0]+S[1]<=12 and S[2]+S[3]=='00') or int(S[0]+S[1])>12:
  print('YYMM');exit()
else:
  print('MMYY');exit()

### FIXED CODE ###

S=str(input())
A=int(S[0]+S[1])
B=int(S[2]+S[3])

if 0<A<=12 and 0<B<=12:
  print('AMBIGUOUS');exit()
elif (A>12 or A==0) and 0<B<=12:
  print('YYMM');exit()
elif 0<A<=12 and (B>12 or B==0):
  print('MMYY');exit()
else:
  print('NA');exit()
n = int(input())
H = list(map(int,input().split()))
dp = [0]*n

def rec(i):
    res = 0
    if i == 1 or i == 2:
        res = abs(H[i]-H[0])
        dp[i] = res
        return res
    elif i == 0:
        return 0
    if dp[i] != 0:
        return dp[i]
    else:
        res = min(abs(H[i]-H[i-2])+rec(i-2),abs(H[i]-H[i-1])+rec(i-1))
        dp[i] = res
    return res

rec(n-1)

print(dp[n-1]) 

### FIXED CODE ###

n = int(input())
H = list(map(int,input().split()))
dp = [0]*n

for i in range(1,n):
    if i == 1 or i == 2:
        dp[i] = abs(H[i]-H[0])
    else:
        dp[i] = min(abs(H[i]-H[i-2])+dp[i-2],abs(H[i]-H[i-1])+dp[i-1])

print(dp[n-1])
N,M=map(int,input().split())
O = M//2
if N>=O:
  print(N)
elpe:
  P = (N+O)//2
  print(P)

### FIXED CODE ###

N,M=map(int,input().split())
O = M//2

if N>=O:
  print(O)
else:
  P = (N+O)//2
  print(P)
# 解説AC
from math import gcd
from collections import defaultdict
import sys

input = sys.stdin.buffer.readline

mod = 10 ** 9 + 7
n = int(input())
cnt = 0
cnt += n
zerocnt = 0
kumi = defaultdict(int)
for i in range(n):
    a, b = map(int, input().split())
    if a == 0 and b == 0:
        zerocnt += 1
        continue
    elif b == 0:
        kumi[(1, 0)] += 1
        kumi[(0, -1)] += 0
        continue
    elif a == 0:
        kumi[(0, -1)] += 1
        kumi[(1, 0)] += 0
        continue
    g = gcd(a, b)
    a //= g
    b //= g
    if a < 0:
        a *= -1
        b *= -1
    kumi[(a, b)] += 1
    kumi[(b, -a)] += 0
ans = 1
cnt -= zerocnt
for a, b in kumi.keys():
    if b <= 0:
        continue
    s = kumi[(a, b)]
    t = kumi[(b, -a)]
    ans *= pow(2, (s + t), mod) - (pow(2, s, mod) - 1) * (pow(2, t, mod) - 1)
    ans %= mod
    cnt -= s + t
if cnt > 0:
    ans *= pow(2, cnt, mod)
    ans %= mod
print((ans - 1 + zerocnt) % mod)


### FIXED CODE ###

n, m = map(int, input().split())
if m % 2 == 1:

    cnt = 0

    for i in range(m // 2):
        num1 = 1 + i
        num2 = m - i
        print(num1, num2, sep=" ")
        cnt += 1
        if cnt == m:
            exit()
    for i in range(m // 2 + 1):
        num1 = m + 1 + i
        num2 = 2 * m + 1 - i
        print(num1, num2, sep=" ")
        cnt += 1
        if cnt == m:
            exit()
else:
    cnt = 0

    for i in range(m // 2):
        num1 = 1 + i
        num2 = m + 1 - i
        print(num1, num2, sep=" ")
        cnt += 1
        if cnt == m:
            exit()
    for i in range(m // 2):
        num1 = m + 2 + i
        num2 = 2 * m + 1 - i
        print(num1, num2, sep=" ")
        cnt += 1
        if cnt == m:
            exit()
N, M = map(int, input().split())
paths = [list(map(int, input().split())) for _ in range(M)]

minimumScore = [-float('inf') for _ in range(N)]
minimumScore[0] = 0
count = 0
while count < N:
    flag = False
    for a, b, c in paths:
        if minimumScore[a-1] == -float('inf'):
            continue
        if minimumScore[a-1] + c > minimumScore[b-1]:
            minimumScore[b-1] = minimumScore[a-1] + c
            minimumScore[b-1] = minimumScore[a-1] + 1
            flag = True
    if not flag:
        break
    count += 1
tmp = minimumScore[-1]
for a, b, c in paths:
    if minimumScore[a-1] == -float('inf'):
        continue
    if minimumScore[a-1] + c > minimumScore[b-1]:
        minimumScore[b-1] = minimumScore[a-1] + c
        minimumScore[b-1] = minimumScore[a-1] + 1
        flag = True
if tmp != minimumScore[-1]:
    print('inf')
else:
    print(minimumScore[N-1][0])
#print(minimumScore[-1])


### FIXED CODE ###

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

minimumScore = [float('inf') for _ in range(N)]
minimumScore[0] = 0
for _ in range(N-1):
    flag = False
    for a, b, c in paths:
        c = -c
        if minimumScore[a-1] == -float('inf'):
            continue
        if minimumScore[a-1] + c < minimumScore[b-1]:
            minimumScore[b-1] = minimumScore[a-1] + c
            flag = True
    if not flag:
        break


negative = [False for i in range(N)]
for _ in range(N):
    for a, b, c in paths:
        c = -c
        if negative[a-1]:
            negative[b-1] = True
        if minimumScore[a-1] == -float('inf'):
            continue
        if minimumScore[a-1] + c < minimumScore[b-1]:
            negative[b-1] = True
            flag = True
if negative[-1]:
    print('inf')
else:
    print(-minimumScore[N-1])
#print(minimumScore[-1])
n, d = map(int, input())
print(n//(2*d+1)+(1 if n%(2*d+1)!=0 else 0))

### FIXED CODE ###

n, d = map(int, input().split())
print(n//(2*d+1)+(1 if n%(2*d+1)!=0 else 0))
from collections import deque, Counter
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
L = deque()
for _ in range(Q):
    b, c = map(int, input().split())
    L.append([b, c])
d = [0] * 10**5
count = Counter(A)
sum_a = sum(A)
for j in range(Q):
    d[L[j][1]] = count[L[j][0]]

    sum_a -= d[L[j][1]] * L[j][0]
    sum_a += d[L[j][1]] * L[j][1]

    print(sum_a)


### FIXED CODE ###

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

B = []
C = []
for _ in range(Q):
    b, c = map(int, input().split())
    B.append(b)
    C.append(c)

d = [0] * (10**5 + 7)
for a in A:
    d[a] += 1
sum_a = sum(A)
for j in range(Q):
    before = d[C[j]]
    d[C[j]] += d[B[j]]
    sum_a -= d[B[j]] * B[j]

    sum_a += (d[C[j]] - before) * C[j]
    d[B[j]] = 0
    print(sum_a)
N,K,Q = map(int, input().split())
A = [K for _ in N]
for _ in N:
  a = int(input())
  A[a-1] += 1
for i in N:
  if A[i] > Q:
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

N,K,Q = map(int, input().split())

A = [K for _ in range(N)]

for _ in range(Q):
    A[int(input())-1] += 1
for i in range(N):
    print("Yes" if A[i] > Q else "No")
import sys
input=lambda: sys.stdin.readline().rstrip()
A=input()
B=input()
C=input()

a,b,c=len(A),len(B),len(C)

def f(X,Y):
  XY=[True]*(10**4)
  x,y=len(X),len(Y)
  for i in range(5000-y+1,5000+x):
    ret=True
    if i<=5000:
      for j in range(min(x,y+i-5000)):
        if X[j]=="?" or Y[j-i+5000]=="?" or X[j]==Y[j-i+5000]:
          continue
        else:
          ret=False
    else:
      for j in range(min(y,x-i+5000)):
        if Y[j]=="?" or X[j+i-5000]=="?" or Y[j]==X[j+i-5000]:
          continue
        else:
          ret=False
    XY[i]=ret
  return XY
AB=f(A,B)
BC=f(B,C)
AC=f(A,C)
ans=a+b+c
for i in range(5000-b-c,5000+a+c):
  for j in range(5000-b-c,5000+a+b):
    if AB[i] and AC[j] and BC[j-i+5000]:
      l=min(5000,i,j)
      r=max(i+b,j+c,5000+a)
      ans=min(ans,r-l)
print(ans)


### FIXED CODE ###

import sys
input=lambda: sys.stdin.readline().rstrip()
A=input()
B=input()
C=input()

a,b,c=len(A),len(B),len(C)

def f(X,Y):
  XY=[True]*(10**4)
  x,y=len(X),len(Y)
  for i in range(5000-y+1,5000+x):
    ret=True
    if i<=5000:
      for j in range(min(x,y+i-5000)):
        if X[j]=="?" or Y[j-i+5000]=="?" or X[j]==Y[j-i+5000]:
          continue
        else:
          ret=False
    else:
      for j in range(min(y,x-i+5000)):
        if Y[j]=="?" or X[j+i-5000]=="?" or Y[j]==X[j+i-5000]:
          continue
        else:
          ret=False
    XY[i]=ret
  return XY
AB=f(A,B)
BC=f(B,C)
AC=f(A,C)
ans=a+b+c
for i in range(5000-b-c,5000+a+c):
  for j in range(5000-b-c,5000+a+b):
    if -4000<=j-i<=4000:
      if AB[i] and AC[j] and BC[j-i+5000]:
        l=min(5000,i,j)
        r=max(i+b,j+c,5000+a)
        ans=min(ans,r-l)
    else:
      if AB[i] and AC[j]:
        l=min(5000,i,j)
        r=max(i+b,j+c,5000+a)
        ans=min(ans,r-l)
print(ans)
from itertools import islice
import operator

N, K = map(int, input().split())
sushi = [tuple([i] + [int(x) for x in input().split()]) for i in range(N)]
sushi.sort(key=operator.itemgetter(2), reverse=True)

from collections import OrderedDict, deque, Counter
left = OrderedDict((x[0], x) for x in sushi)

base = 0
choosen = [None] * K
choosen_kind = set()
ci = 0
for x in sushi:
    i, t, _ = x
    if t not in choosen_kind:
        choosen[ci] = x
        ci += 1
        choosen_kind.add(t)
        del left[i]

choosen = choosen[:min(ci, K)]
base = sum(d for _,_,d in choosen)
kinds = len(choosen)

cands = islice(left.values(), K)
fixed = islice(cands, K - len(choosen))
base += sum(d for _,_,d in fixed)

score = base + kinds**2

for cand in cands:
    if cand[2] <= choosen[-1][2]:
        break

    base_n = base
    base_n -= choosen[-1][2]
    base_n += cand[2]
    kinds_n = kinds - 1
    
    score_n = base_n + kinds_n**2
    if score_n > score:
        choosen.pop()
        base, kinds, score = base_n, kinds_n, score_n
    else:
        break

print(score)

### FIXED CODE ###

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from itertools import islice
import operator

N, K = map(int, input().split())
sushi = [tuple([i] + [int(x) for x in input().split()]) for i in range(N)]
sushi.sort(key=operator.itemgetter(2), reverse=True)

from collections import OrderedDict, deque, Counter
left = OrderedDict((x[0], x) for x in sushi)

base = 0
choosen = [None] * N
choosen_kind = set()
ci = 0
for x in sushi:
    i, t, _ = x
    if t not in choosen_kind:
        choosen[ci] = x
        ci += 1
        choosen_kind.add(t)
        del left[i]

choosen = choosen[:min(ci, K)]
base = sum(d for _,_,d in choosen)
kinds = len(choosen)

cands = islice(left.values(), K)
fixed = islice(cands, K - len(choosen))
base += sum(d for _,_,d in fixed)

score = base + kinds**2

for cand in cands:
    if cand[2] <= choosen[-1][2]:
        break

    base_n = base
    base_n -= choosen[-1][2]
    base_n += cand[2]
    kinds_n = kinds - 1
    
    score_n = base_n + kinds_n**2
    if score_n > score:
        choosen.pop()
        base, kinds, score = base_n, kinds_n, score_n
    else:
        break

print(score)
def _print():
  a = int(input())
  print(1 if a == 0 else 0)

if __name__ = '__main__':
  _print()

### FIXED CODE ###

num = int(input())
if num == 1:
  print(0)
else:
  print(1)
n, k = map(int,input().spllit())

if n * 500 >= k :
    print("Yes")
else:
    print("No")

### FIXED CODE ###

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

if n * 500 >= k :
    print("Yes")
else:
    print("No")
a = input()
if a=='a' | a=='e' | a=='i' | a == 'o' | a == 'u':
  print("vowel")
else:
  print("consonant")


### FIXED CODE ###

a = input()
l = ['a', 'i', 'u', 'e', 'o']

if a in l:
  print("vowel")
else:
  print("consonant")
S = input()
T = input()

i = 0
j = 0
ss = list()
tt = list()
slist = list()
tlist = list()

for s in S:
   if s in slist:
      ss.append(slist[s])
   else:
      ss.append(i)
      slist.append(s)
      i += 1

for t in T:
   if t in tlist:
      tt.append(tlist[t])
   else:
      tt.append(j)
      tlist.append(t)
      j += 1

if ss == tt:
   print("Yes")
else:
   print("No")

      
      
         

### FIXED CODE ###

S = input()
T = input()

i = 0
j = 0
ss = list()
tt = list()
slist = list()
tlist = list()

if len(S) == len(T):
   for s in S:
      if s in slist:
         ss.append(slist.index(s))
      else:
         ss.append(i)
         slist.append(s)
         i += 1

   for t in T:
      if t in tlist:
         tt.append(tlist.index(t))
      else:
         tt.append(j)
         tlist.append(t)
         j += 1

   if ss == tt:
      print("Yes")
   else:
      print("No")
else:
   print("No")
#-*- coding:utf-8 -*-

if __name__ == "__main__":
    A, B, K = list(map(int, input().split()))
    end = A + K
    if end >= B+1:
        end = B
    for i in range(A, end):
        print(i)

    start = B - K + 1
    if start <= i:
        start = i + 1
    for j in range(start, B+1):
        print(j)


### FIXED CODE ###

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

if __name__ == "__main__":
    A, B, K = list(map(int, input().split()))
    end = A + K
    if end >= B+1:
        end = B + 1
    for i in range(A, end):
        print(i)
    if end == B + 1:
        exit()

    start = B - K + 1
    if start <= i:
        start = i + 1
    for j in range(start, B+1):
        print(j)
import heapq
n,m=map(int,input().split())
ab=[[] for _ in range(m+1)]
for i in range(n):
  a,b=map(int,input().split())
  if a<=m:
    a[i].append(-b)

cand=[]
heapq.heapify(cand)
ans=0
for i in range(1,m+1):
  for j in range(len(ab[i])):
    heapq.heappush(cand,ab[i][j])
  if len(cand)>0:
    ans-=heapq.heappop(cand)

print(ans)

### FIXED CODE ###

import heapq
n,m=map(int,input().split())
ab=[[] for _ in range(m+1)]
for i in range(n):
  a,b=map(int,input().split())
  if a<=m:
    ab[a].append(-b)

cand=[]
heapq.heapify(cand)
ans=0
for i in range(1,m+1):
  for j in range(len(ab[i])):
    heapq.heappush(cand,ab[i][j])
  if len(cand)>0:
    ans-=heapq.heappop(cand)

print(ans)
import math
from functools import reduce

l = list(map(int, input().split()))
N=l[0]
X=l[1]
x=[0]*N
A=[0]*N
l = list(map(int, input().split()))
for i in range(N):
    x[i] = l[i]
    A[i] = abs(X-x[i])
g=A[0]
for i in range(N):
    g = math.gcd(g, A[i])
print(g)


### FIXED CODE ###

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

l = list(map(int, input().split()))
N=l[0]
X=l[1]
x=[0]*N
A=[0]*N
l = list(map(int, input().split()))
for i in range(N):
    x[i] = l[i]
    A[i] = abs(X-x[i])
g=A[0]
for i in range(N):
    g = gcd(g, A[i])
print(g)
import sys
from bisect import bisect_left
import numpy as np


def test(a, K):
    from itertools import combinations
    answer = []
    for i, j in combinations(a, 2):
        answer.append(i * j)
    answer.sort()
    print(answer)
    print(answer[K - 1])


def main():
    read = sys.stdin.read

    N, K, *A = map(int, read().split())

    # test(A, K)
    A.sort()
    m = bisect_left(A, 0)
    z = bisect_left(A, 1) - m
    p = N - m - z

    M = m * p
    Z = z * (N - z) + z * (z - 1) // 2
    negative = np.array(A[:m], np.int64)
    positive = np.array(A[-p:], np.int64)

    if K <= M:
        negative = -negative[::-1]
        left = 1
        right = -A[0] * A[-1] + 1
        while left + 1 < right:
            mid = (left + right) // 2
            cnt = (p - np.searchsorted(positive, (mid + negative - 1) // negative, side='left')).sum()
            if cnt < K:
                right = mid
            else:
                left = mid
        print(-left)
    elif K <= M + Z:
        print(0)
    else:
        print(CE)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import numpy as np


def test(a, K):
    from itertools import combinations
    answer = []
    for i, j in combinations(a, 2):
        answer.append(i * j)
    answer.sort()
    print(answer[K - 1])


def main():
    read = sys.stdin.read

    N, K, *A = map(int, read().split())

    if N <= 10:
        test(A, K)
        exit()
    A.sort()
    A = np.array(A, np.int64)
    negative = A[A < 0]
    positive = A[A > 0]
    m = len(negative)
    p = len(positive)
    z = N - m - p

    M = m * p
    Z = z * (N - z) + z * (z - 1) // 2
    negative = -negative[::-1]
    # 負の数の操作(pythonの挙動)は頭がこんがらがるので正の数にして考える

    if K <= M:
        left = 1
        right = -A[0] * A[-1] + 1
        while left + 1 < right:
            mid = (left + right) // 2
            cnt = (p - np.searchsorted(positive, (mid + negative - 1) // negative, side='left')).sum()
            if cnt < K:
                right = mid
            else:
                left = mid
        print(-left)
    elif K <= M + Z:
        print(0)
    else:
        K -= M + Z
        left = 0
        right = max(A[0] * A[1], A[-1] * A[-2])
        positive2 = positive ** 2
        negative2 = negative ** 2
        while left + 1 < right:
            mid = (left + right) // 2
            a = np.searchsorted(negative, mid // negative, side='right').sum() - (mid >= negative2).sum()
            b = np.searchsorted(positive, mid // positive, side='right').sum() - (mid >= positive2).sum()

            if (a + b) // 2 < K:
                left = mid
            else:
                right = mid

        print(right)


if __name__ == '__main__':
    main()
A,B,K = map(int,input().split())
S = list(range(A,B+1))

S2 = set(S[:K]+S[-K:])
S3 = sorted(S2)

for s in S3:
	print(s)

#print("\n".join(S3))

### FIXED CODE ###

A,B,K = map(int,input().split())
S = []
#list(range(A,B+1))
for i in range(K):
	S.append(A+i)
	S.append(B-i)

S = sorted(list(set(S)))

for i in range(len(S)):
	if A<=S[i]<=B:
		print(S[i])
import sys
from math import sqrt, floor
from bisect import bisect_right as bi_r

def factorize(n):
    res = []
    for i in range(1, floor(sqrt(n)) + 1):
        if not n % i:
            res.append(i, n // i)
    return sorted(res)

n, m = map(int, sys.stdin.readline().split())


def main():
    res = factorize(m)
    ans = res[bi_r(res, m / n) - 1]
    return ans

if __name__ == '__main__':
    ans = main()
    print(ans)

### FIXED CODE ###

import sys
from math import sqrt, floor
from bisect import bisect_right as bi_r

def factorize(n):
    res = []
    for i in range(1, floor(sqrt(n)) + 1):
        if not n % i:
            res.append(i)
            res.append(n // i)
    return sorted(res)

n, m = map(int, sys.stdin.readline().split())

def main():
    res = factorize(m)
    ans = res[bi_r(res, m / n) - 1]
    return ans

if __name__ == '__main__':
    ans = main()
    print(ans)
charas = 'abcdefghijklmnopqrstuvwxyz'


for line in sys.stdin:
    data.appen(line)
for chara in chara:
    for row in data:
        cnt = row.count(chara)
        cnt += row.count(chara.upper())
    print('{} : {}'.format(chara, cnt))

### FIXED CODE ###

# coding: utf-8
alphabet = 'abcdefghijklmnopqrstuvwxyz'
S = ''
while True:
    try:
        n = input()
        S += n
    except EOFError:
        break
ans_dict = {}
for char in alphabet:
    ans_dict[char] = S.count(char)
    ans_dict[char] += S.count(char.upper())
for k, v in sorted(ans_dict.items(), key=lambda x: x[0]):
    print('{} : {}'.format(k, v))
import sys

def main():
    N, X = map(int, input().split())
    A = list(map(int, input().split()))

    cnt = 0
    D = 0
    while D <= X:
        D += A[cnt]
        cnt += 1

    return cnt


if __name__ == '__main__':
    print(main())


### FIXED CODE ###

import sys

def main():
    N, X = map(int, input().split())
    A = list(map(int, input().split()))

    cnt = 0
    D = 0
    for a in A:
        D += a
        cnt += 1
        if D > X:
            cnt -= 1
            break

    return cnt+1


if __name__ == '__main__':
    print(main())
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if (B-A) % abs(V-W) == 0 and V > W:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if abs(A - B) <= (V - W) * T:
  print('YES')
else:
  print('NO')