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

import collections

def calc(x,y):
  cnt1=(x+k-1)//k
  cnt2=(w-1-x+k-1)//k
  cnt3=(y+k-1)//k
  cnt4=(h-1-y+k-1)//k
  return min(cnt1,cnt2,cnt3,cnt4)

h,w,k=map(int,input().split())
boards=[tuple(input()) for _ in range(h)]
for i in range(h):
  for j in range(w):
    if boards[i][j]=='S':
      sx=j
      sy=i
      break
q=collections.deque()
checked=[[0]*w for _ in range(h)]
checked[sy][sx]=1
q.append((sx,sy,0))
ans=1+calc(sx,sy)
while 1:
  if len(q)==0:
    break
  tx,ty,cnt=q.popleft()
  if cnt==k+1:
    break
  ans=min(ans,1+calc(tx,ty))
  if tx!=0 and boards[ty][tx-1]!='#' and checked[ty][tx-1]==0:
    checked[ty][tx-1]=1
    q.append((tx-1,ty,cnt+1))
  if tx!=w-1 and boards[ty][tx+1]!='#' and checked[ty][tx+1]==0:
    checked[ty][tx+1]=1
    q.append((tx+1,ty,cnt+1))
  if ty!=0 and boards[ty-1][tx]!='#' and checked[ty-1][tx]==0:
    checked[ty-1][tx]=1
    q.append((tx,ty-1,cnt+1))
  if ty!=h-1 and boards[ty+1][tx]!='#' and checked[ty+1][tx]==0:
    checked[ty+1][tx]=1
    q.append((tx,ty+1,cnt+1))
print(ans)

### FIXED CODE ###

import collections

def solve():
  def calc(x,y):
    cnt1=(x+k-1)//k
    cnt2=(w-1-x+k-1)//k
    cnt3=(y+k-1)//k
    cnt4=(h-1-y+k-1)//k
    return min(cnt1,cnt2,cnt3,cnt4)

  h,w,k=map(int,input().split())
  boards=[tuple(input()) for _ in range(h)]
  for i in range(h):
    for j in range(w):
      if boards[i][j]=='S':
        sx=j
        sy=i
        break
  q=collections.deque()
  checked=[[0]*w for _ in range(h)]
  checked[sy][sx]=1
  q.append((sx,sy,0))
  ans=1+calc(sx,sy)
  while 1:
    if len(q)==0:
      break
    tx,ty,cnt=q.popleft()
    if cnt==k+1:
      break
    ans=min(ans,1+calc(tx,ty))
    if tx!=0 and boards[ty][tx-1]!='#' and checked[ty][tx-1]==0:
      checked[ty][tx-1]=1
      q.append((tx-1,ty,cnt+1))
    if tx!=w-1 and boards[ty][tx+1]!='#' and checked[ty][tx+1]==0:
      checked[ty][tx+1]=1
      q.append((tx+1,ty,cnt+1))
    if ty!=0 and boards[ty-1][tx]!='#' and checked[ty-1][tx]==0:
      checked[ty-1][tx]=1
      q.append((tx,ty-1,cnt+1))
    if ty!=h-1 and boards[ty+1][tx]!='#' and checked[ty+1][tx]==0:
      checked[ty+1][tx]=1
      q.append((tx,ty+1,cnt+1))
  print(ans)
solve()
### BUGGY CODE ###

from collections import deque

def pr(a):
    for i in range(len(a)):
        if i == len(a)-1:
            print(a[i])
        else:
            print(a[i],end = " ")

n = int(input())
q = deque()
for i in range(n):
    x = input()
    l = len(x)
    if x[0] == "i":
        q.insert(0,x[7:])
    elif x[6] == " ":
        try:
            q.remove(x[7:])
        except:
            pass
    elif l > 10:
        q.popleft()
    elif l > 6:
        q.pop()

pr(q)


### FIXED CODE ###

from collections import deque

def pr(a):
    for i in range(len(a)):
        if i == len(a)-1:
            print(a[i])
        else:
            print(a[i],end = " ")

n = int(input())
q = deque()
for i in range(n):
    x = input()
    l = len(x)
    if x[0] == "i":
        q.insert(0,x[7:])
    elif x[6] == " ":
        try:
            q.remove(x[7:])
        except:
            pass
    elif l > 10:
        q.popleft()
    elif l > 6:
        q.pop()

print(*q)
### BUGGY CODE ###

S=input()

# tmp=[]
# for i in range(2019,S+1,2019):
#     label=1
#     for ii in str(i):
#         if ii=='0':
#             label=0
#     if label:
#         tmp.append(i)
#     #tmp.append(2019*i)
# print(tmp)

out=0
D=len(S)-4
for ii in range(D+1):
    for i in range(ii+3,len(S)):
        T=S[ii:i+1]
        if int(T)%2019==0:
            out+=1
print(out)

### FIXED CODE ###

S=input()

out=0
l=[0]*2019
x=0
now=1
for i in S[::-1]:
    x+=now*int(i)
    x%=2019
    l[x]+=1

    now*=10
    now%=2019

for i in l:
    out+=(i-1)*i//2
print(out+l[0])

# # 全探索は間に合わない
# D=len(S)-4
# for ii in range(D+1):
#     for i in range(ii+3,len(S)):
#         T=S[ii:i+1]
#         if int(T)%2019==0:
#             out+=1
# print(out)
### BUGGY CODE ###

import math

def find_index(l, x, default=-1):
    return l.index(x) if x in l else default


def main():
    n,m = map(int, input().split())
    A = list(map(int, input().split()))
    for i in range(m):
        maximum = max(A)
        index = find_index(A,maximum)
        A[index] = int(math.floor(maximum/2))
    print(sum(A))


if __name__ == '__main__':
    main()


### FIXED CODE ###

import heapq

def main():
    n,m = map(int, input().split())
    A = list(map(lambda x: -int(x), input().split()))

    heapq.heapify(A)
    for i in range(m):
        temp_min = heapq.heappop(A)
        heapq.heappush(A, (-1)*(-temp_min//2))
    print(-sum(A))


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

def main():
    n = int(input())
    a = [int(input()) for _ in range(n)]
    print(solve(a))

def solve(a):
    peaks = find_peaks(a)
    if all(check_peak(a, p) for p in peaks):
        return sum(a[p] for p in peaks)
    else:
        return -1

def check_peak(a, peak):
    if a[peak] > peak:
        return False
    
    base = peak - a[peak]
    for i in range(a[peak]):
        if a[base + i] < i:
            return False
    
    return True

def find_peaks(a):
    peaks = []

    for i in range(len(a) - 1):
        if a[i] != 0 and a[i + 1] <= a[i]:
            peaks.append(i)
    
    if a[len(a) - 1] != 0:
        peaks.append(len(a) - 1)
    
    return peaks

main()

### FIXED CODE ###

import bisect

def main():
    n = int(input())
    a = []
    for _ in range(n):
        a.append(int(input()))
    a.append(0)
    ans = solve(a, n)
    print(ans)

def solve(a, n):
    if not check(a, n):
        return -1

    base = 0
    s = 0
    for i in range(n):
        if a[i] > base + i:
            return -1
        
        if a[i + 1] <= a[i]:
            s += a[i]
        
        base = i - a[i]
    
    return s

def check(a, n):
    if a[0] != 0:
        return False
    
    for i in range(1, n):
        if a[i] - a[i - 1] > 1:
            return False

    return True

main()
### BUGGY CODE ###

N = int(input())
A = list(map(int,input().split()))
ans = 0
for i in range(N-1):
    a = A[i]
    for j in range(i+1,N):
        ans += a*A[j]
print(ans % (10**9+7))

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
ans = 0
s = sum(A[1:])
for i in range(N-1):
    ans += A[i]*s 
    s = s - A[i+1]
print(ans % (10**9+7))
### BUGGY CODE ###

import sys

def main():
  if 'get_ipython' not in globals():  
    # For Subsession
    N = int(input())
    b = list(map(int, input().split()))
  else:
    # b = [1,2,1]
    # b = [2,2]
    b = [1,1,1,2,2,1,2,3,2]
    N = len(b)

  if max(b) > N:
    print(-1)
    sys.exit()
    
  if check(b) != True:
    print(-1)
    
def check(B):
  # if 'get_ipython' in globals(): print(B)
  lenB = len(B)
  if lenB == 0 :
    return True
  for i in reversed(range(lenB)):
    if B[i] == i+1:
      if check(B[:i]+B[(i+1):]) == True:
        print(B[i])
        return True
        break
    
main()

### FIXED CODE ###

import sys

def main():
  if 'get_ipython' not in globals():  
    # For Subsession
    N = int(input())
    b = [int(i) for i in input().split()] 
  else:
    # b = [1,2,1]
    # b = [2,2]
    b = [1,1,1,2,2,1,2,3,2]
    N = len(b)

  ans = []
  while True:
    for i in range(N-1,-1,-1):
      if b[i] == i+1:
        ans.append(i+1)
        del b[i]
        N = N -1
        break
      if i == 0:
        print(-1)
        sys.exit()
    if N == 0:
      break

  for i in reversed(ans):
    print(i)
    
main()
### BUGGY CODE ###

def solve():
    alpha = "abcdefghijklmnopqrstuvwxyz"
    inp1, inp2 = input(), input()
    sz = dict(zip(list(alpha), [0] * 26))
    tz = dict(zip(list(alpha), [0] * 26))
    siz = dict(
        zip(list(alpha), [[0 for i in range(2 * (10 ** 5))] for _ in range(26)]))
    tiz = dict(
        zip(list(alpha), [[0 for i in range(2 * (10 ** 5))] for _ in range(26)]))
    for i in range(len(inp1)):
        sz[inp1[i]] += 1
        tz[inp2[i]] += 1
        siz[inp1[i]][i] = i
        tiz[inp2[i]][i] = i
        if (sz[inp1[i]] != tz[inp2[i]]
                or set(siz[inp1[i]]) ^ set(tiz[inp2[i]])):
            print("No")
            return
    print("Yes")


solve()


### FIXED CODE ###

def solve():
  from collections import Counter
  s = [i for i in sorted(Counter(input()).values())]
  t = [i for i in sorted(Counter(input()).values())]
  print(["No","Yes"][s==t])

solve()
### BUGGY CODE ###

def calc(h,n,N):
  if 4*h*n-N*(h+n)!=0:
    return (N*h*n)//(4*h*n-N*(h+n))
  else:
    return 0

N=int(input())
for h in range(1,3501):
  for n in range(1,3501):
    w=calc(h,n,N)
    if w>0:
      if 4/N==1/h+1/n+1/w:
        print(h,n,w)
        exit()

### FIXED CODE ###

N=int(input())
for h in range(1,3501):
  if 4*h-N!=0:
    n=(N*h)//(4*h-N)+1
    if 4*h*n-N*(h+n)>0 and (N*h*n)%(4*h*n-N*(h+n))==0:
      w=(N*h*n)//(4*h*n-N*(h+n))
      break
print(h,n,w)
### BUGGY CODE ###

s=input()
p=set()
ans=0
for c in s:
    t=set()
    for i in p:
        i=(i*10+int(c))%2019
        if i==0:
            ans+=1
        else:
            t.add(i)
    t.add(int(c))
    p=t.copy()
print(ans)

### FIXED CODE ###

S=input()
MOD=2019
dp=[0]*MOD
dp[0]=1
r=0
t=1
for c in reversed(S):
    r+=int(c)*t
    r%=MOD
    t*=10
    t%=MOD
    dp[r]+=1
print(sum(i*(i-1)//2 for i in dp))
### BUGGY CODE ###

n = int(input())
s = input()

count = 0
for i in range(0,n-3):
  ii = s[i]
  for j in range(i+1, n-1):
    jj = s[j]
    if ii==jj:
      continue
    for k in range(j+1,n):
      kk=s[k]
      if j-i != k-j:
        if jj != kk and kk!=ii:
          count = count + 1
print(count)


### FIXED CODE ###

n = int(input())
s = input()

count = 0
r=0
g=0
b=0
for i in range(0,n):
  if s[i] == 'R':
    r = r + 1
  if s[i]=='G':
    g = g+1
  if s[i]=='B':
    b = b+1
    
for i in range(0,n):
  ii = s[i]
  for j in range(i+1, n):
    jj = s[j]
    if ii==jj:
      continue
    if (2*j-i)<=(n-1):
      if ii!=s[2*j-i] and jj!=s[2*j-i]:
        count = count + 1
print(r*g*b-count)
### BUGGY CODE ###

#!/usr/bin/env python3


def main():
    D = 60
    n, k = map(int, input().split())

    warps = list(map(int, input().split()))
    warps = [0] + warps

    dp = [[0 for j in range(n + 1)] for i in range(D)]
    # print(warps)
    for j in range(1, n + 1):
        dp[0][j] = warps[j]

    for i in range(D - 1):
        for j in range(1, n + 1):
            dp[i + 1][j] = dp[i][dp[i][j]]

    # for dd in dp:
    # print(dd)

    node = 1
    for i in range(D, -1, -1):
        if k >= (1 << i):
            # print(i)
            k -= 1 << i
            node = dp[i][node]

    print(node)


main()


### FIXED CODE ###

#!/usr/bin/env python3

import sys
import numpy as np


def main():
    n, k = map(int, sys.stdin.buffer.readline().split())

    warps = list(map(int, sys.stdin.buffer.readline().split()))
    warps = [0] + warps
    warps = np.array(warps, dtype=int)

    dp = np.zeros((k.bit_length() + 1, n + 1), dtype=int)

    dp[0, :] = warps

    for h in range(1, len(dp)):
        dp[h] = dp[h - 1][dp[h - 1]]

    node = 1
    # for i in reversed(range(k.bit_length())):
    for i in range(k.bit_length(), -1, -1):
        if k >> i & 1:
            node = dp[i][node]

    print(node)


main()
### BUGGY CODE ###

n = int(input())
s = str(input())

num_r = s.count('R')
num_g = s.count('G')
num_b = s.count('B')

ans = num_r*num_g*num_b

for i in range(n):
    for j in range(i, n):
        try:
            k = j+(j-i)
            if (s[i] != s[j]) and (s[j] != s[k]) and (s[k] != s[i]):
                ans -= 1
        except:
            pass
print(ans)


### FIXED CODE ###

n = int(input())
s = list(input())

num_r = s.count('R')
num_g = s.count('G')
num_b = s.count('B')

ans = num_r*num_g*num_b

for i in range(n):
    for j in range(i, n):
        k = j+(j-i)
        if (k < n) and (s[i] != s[j]) and (s[j] != s[k]) and (s[k] != s[i]):
            ans -= 1
print(ans)
### BUGGY CODE ###

import numpy as np
inf = 100100100
ans = inf
H, W, K = map(int, input().split())
S = []
for _ in range(H):
    S.append([int(x) for x in input()])
S = np.array(S)
for i in range(2**(H-1)):
    group = [0]
    g = 0
    for j in range(H-1):
        if (i >> j) & 1:
            g += 1
        group.append(g)
    group = np.array(group)
    g += 1
    c = np.array([[0]*W]*g)
    for j in range(H):
        for k in range(W):
            c[group[j],k] += S[j,k]
    num = g-1
    now = np.zeros(g)
    def large(now):
        for n in now:
            if n > K:
                return True
        else:
            return False
    for k in range(W):
        now += c[:,k]
        if large(now):
            now = c[:,k]
            num += 1
            if large(now):
                num = inf
                break
    ans = min(ans, num)
print(ans)


### FIXED CODE ###

def main():
    import sys
    inf = 100100100
    ans = inf
    H, W, K = map(int, input().split())
    S = [0]*H
    for i in range(H):
        S[i] = [int(x) for x in sys.stdin.readline().strip()]
    for i in range(2**(H-1)):
        group = [0]
        g = 0
        for j in range(H-1):
            if (i >> j) & 1:
                g += 1
            group.append(g)
        g += 1
        c = [[0 for _ in range(W)] for __ in range(g)]
        for j in range(H):
            for k in range(W):
                c[group[j]][k] += S[j][k]
        num = g-1
        now = [0]*g
        def large(now):
            for n in now:
                if n > K:
                    return True
            else:
                return False
        def v_vec(twodlis, k):
            ans = []
            for lis in twodlis:
                ans.append(lis[k])
            return ans
        for k in range(W):
            for n in range(len(now)):
                now[n] = now[n] + v_vec(c,k)[n]
            if large(now):
                now = v_vec(c,k)
                num += 1
                if large(now):
                    num = inf
                    break

        ans = min(ans, num)
    print(ans)

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

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

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

X = sum(a)
x = sum(a[:1])

minsum = 10000000000

for i in range(1,n):
    x = sum(a[:i])
    minsum = min(minsum,abs(X-2*x))

print(minsum)


### FIXED CODE ###

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

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

X = sum(a)

minsum = 10000000000

cnt = 0

for i in range(1,n):
    cnt += a[i-1]
    minsum = min(minsum,abs(X-2*cnt))

print(minsum)
### BUGGY CODE ###

from collections import deque
# N < 10^5, A, B, C < 10^9
# s = ('AB', 'AC', 'BC')
# A >= 0, B >= 0, C >= 0
# N回操作できるか？できるなら道筋を
# 各ステップで2通りのどちらかしか選択できない。
# DPだと思う
# (A, B, C, i, '')
N, A, B, C = [int(i) for i in input().split()]
S = [input() for _ in range(N)]
i = 0
que = deque([(A, B, C, i, '')])
while len(que) != 0:
    x = que.pop()
    i = x[3]
    if x[3] == N:
        print('Yes')
        for i in range(N):
            print(x[4][i])
        exit()
    if S[i] == 'AB':
        if x[1] > 0:
            que.append((x[0]+1, x[1]-1, x[2], x[3]+1, x[4]+'A'))
        if x[0] > 0:
            que.append((x[0]-1, x[1]+1, x[2], x[3]+1, x[4]+'B'))
    elif S[i] == 'BC':
        if x[2] > 0:
            que.append((x[0], x[1]+1, x[2]-1, x[3]+1, x[4]+'B'))
        if x[1] > 0:
            que.append((x[0], x[1]-1, x[2]+1, x[3]+1, x[4]+'C'))
    elif S[i] == 'AC':
        if x[2] > 0:
            que.append((x[0]+1, x[1], x[2]-1, x[3]+1, x[4]+'A'))
        if x[0] > 0:
            que.append((x[0]-1, x[1], x[2]+1, x[3]+1, x[4]+'C'))
    else:
        print('error')
print('No')



### FIXED CODE ###

from collections import deque
import sys
sys.setrecursionlimit(500000)
# N < 10^5, A, B, C < 10^9
# s = ('AB', 'AC', 'BC')
# A >= 0, B >= 0, C >= 0
# N回操作できるか？できるなら道筋を
# 各ステップで2通りのどちらかしか選択できない。
# DPだと思う
# (A, B, C, i, '')

def f(x, dic):
    if x[4] == '':
        return 1
    else:
        if f(dic[x], dic):
            print(x[4])
            return 1

N, A, B, C = [int(i) for i in input().split()]
S = [input() for _ in range(N)]
i = 0
dic = {}
que = deque([(A, B, C, i, '')])
while len(que) != 0:
    x = que.pop()
    i = x[3]
    if x[3] == N:
        print('Yes')
        f(x, dic)
        exit()
    if S[i] == 'AB':
        if x[1] > 0:
            newx = (x[0]+1, x[1]-1, x[2], x[3]+1, 'A')
            dic[newx] = x
            que.append(newx)
        if x[0] > 0:
            newx = (x[0]-1, x[1]+1, x[2], x[3]+1, 'B')
            dic[newx] = x
            que.append(newx)
    elif S[i] == 'BC':
        if x[2] > 0:
            newx = (x[0], x[1]+1, x[2]-1, x[3]+1, 'B')
            dic[newx] = x
            que.append(newx)
        if x[1] > 0:
            newx = (x[0], x[1]-1, x[2]+1, x[3]+1, 'C')
            dic[newx] = x
            que.append(newx)
    elif S[i] == 'AC':
        if x[2] > 0:
            newx = (x[0]+1, x[1], x[2]-1, x[3]+1, 'A')
            dic[newx] = x
            que.append(newx)
        if x[0] > 0:
            newx = (x[0]-1, x[1], x[2]+1, x[3]+1, 'C')
            dic[newx] = x
            que.append(newx)
    else:
        print('error')
print('No')
### BUGGY CODE ###

from fractions import gcd
import math
A, B = [int(x) for x in input().split()]
N = gcd(A, B)
p_list = set({})
for i in range(1, N+1):
    if (N != (N//i * i)):
        continue
    if (i == 1):
        p_list.add(i)
    else:
        is_prime = True
        for p in p_list:
            if (p != 1 and i == (i//p * p)):
                is_prime = False
        if (is_prime):
            p_list.add(i)
print(len(p_list))


### FIXED CODE ###

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

from fractions import gcd
import math
A, B = [int(x) for x in input().split()]
N = gcd(A, B)
a = prime_factorize(N)
print(len(set(a))+1)
### BUGGY CODE ###

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

ans = 0
for i in range(n):
    if i == 0:
        if a[i] == 0:
            f = "+"
            a[i] = 1
        elif a[0] > 0:
            f = "+"
        elif a[0] < 0:
            f = "-"
    else:
        if f == "+":
            if a[i] + sum(a[:i]) > 0:
                c = -1 - sum(a[:i])
                ans += abs(c - a[i])
                a[i] = c
                f = "-"
            else:
                if a[i] + sum(a[:i]) == 0:
                    a[i] -= 1
                    ans += 1
                f = "-"
        elif f == "-":
            if a[i] + sum(a[:i]) < 0:
                c = 1 - sum(a[:i])
                ans += abs(c - a[i])
                a[i] = c
                f = "+"
            else:
                if a[i] + sum(a[:i]) == 0:
                    a[i] += 1
                    ans += 1
                f = "+"
#print(a)
print(ans)


### FIXED CODE ###

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

ans = 0
f = 1
num = 0
for i in range(n):
    num += a[i]
    if f:
        if num <= 0:
            ans += 1 - num
            num = 1
        f = 0
    else:
        if num >= 0:
            ans += abs(-1 - num)
            num = -1
        f = 1

ans_2 = 0
f = 1
num = 0
for i in range(n):
    num += a[i]
    if f:
        if num >= 0:
            ans_2 += abs(-1 - num)
            num = -1
        f = 0
    else:
        if num <= 0:
            ans_2 += 1 - num
            num = 1
        f = 1

print(min(ans,ans_2))
### BUGGY CODE ###

import math
N = int(input())
A = sorted(int(i) for i in input().split())

k = 2**int(math.log(A[-1], 2) + 1)
c = 0
while A:
    v = A.pop()
    while k > 2*v:
        k //= 2
    w = k - v
    if w in A:
        c += 1
        A.remove(w)
print(c)



### FIXED CODE ###

import math
from collections import defaultdict
N = int(input())
A = sorted(int(i) for i in input().split())

d = defaultdict(lambda: 0)
for i in A:
    d[i] += 1

c = 0
for k in sorted(d.keys(), reverse=True):
    l = 2**int(math.log(k, 2) + 1) - k
    v = d[k]
    if k == l:
        c += v // 2
    elif l in d:
        w = d[l]
        if v > w:
            c += w
            d[l] = 0
        else:
            c += v
            d[l] = w-v
print(c)
### BUGGY CODE ###

import math
N = int(input())
def f(n):
    count=0
    for x in range(1,int(math.sqrt(n))):
        for y in range(1,x+1):
            for z in range(1,y+1):
                if x*x+y*y+z*z+x*y+y*z+z*x==n:
                    if x==y and y==z:
                        count+=1
                    else:
                        count+=3
    print(count)

for i in range(1,N+1):
    f(i)

### FIXED CODE ###

a=[0]*int(input())
r=range(1,99)
for x in r:
    for y in r:
        for z in r:
            n=x*(x+y+z)+y*(y+z)+z*z-1
            if n<len(a):
                a[n]+=1
print(*a)
### BUGGY CODE ###

a,b,k = map(int,input().split())
src = [i for i in range(a,b+1)]
if k > len(src):
    k = len(src)
li = set()
for ki in range(k):
    li.add(src[ki])
for ki in reversed(range(k)):
    li.add(src[-(ki+1)])
for l in sorted(li):
    print(l)

### FIXED CODE ###

a,b,k = map(int,input().split())
if k > b-a+1:
    k = b-a+1
li = set()
for i in range(k):
    li.add(a+i)
    li.add(b-i)
for l in sorted(li):
    print(l)
### BUGGY CODE ###

# 200216 C

N = int(input())
S = [""] * N
for i in range(N):
    S[i] = input()


Ssimple = sorted(list(set(S)))
cntlist = [0] * len(Ssimple)

for i in range(len(Ssimple)):
    cntlist[i] = S.count(Ssimple[i])

for i in range(len(Ssimple)):
    if cntlist[i] == max(cntlist):
        print(Ssimple[i],end=" ")
print("")



### FIXED CODE ###

# 200216 C

import collections

N = int(input())
S = [""] * N
dic = {}
for i in range(N):
    S = input()
    if S in dic:
        dic[S] += 1
    else:
        dic[S] = 1

maxs = max(list(dic.values()))
ans = []
for i in dic:
    if dic[i] == maxs:
        ans.append(i)
ans = sorted(ans)
for i in ans:
    print(i,end=" ")
print("")
### BUGGY CODE ###

import sys
from collections import deque
input = sys.stdin.readline
n = int(input())
hL = list(map(int, input().split()))
flag = 'Yes'
for i in range(n-1):
    for j in range(i+1, n) :
        if hL[i] -hL[j]>=2:
            flag = 'No'
            break
    if flag =='No':
        break
print(flag)

### FIXED CODE ###

import sys
import numpy as np
input = sys.stdin.readline
n = int(input())

L = np.array(list(map(int, input().split())))

for i in range(n-1, 0, -1):
    if L[i]-L[i-1] ==-1:
        L[i-1] -=1

if np.all(L ==sorted(L)):
    print('Yes')
else:
    print('No')
### BUGGY CODE ###

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

for _ in range(k):
    b = [0] * (n + 2)
    for i in range(n):
        b[max(0, i - a[i])] += 1
        b[min(n + 1, i + a[i] + 1)] -= 1
    a[0] = b[0]
    cnt = 1 if a[0] == n else 0
    for i in range(1, n):
        a[i] = a[i - 1] + b[i]
        if a[i] == n:
            cnt += 1

    if cnt == n:
        break

print(*a)


### FIXED CODE ###

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

for _ in range(k):
    b = [0] * (n + 2)
    for i in range(n):
        b[max(0, i - a[i])] += 1
        b[min(n + 1, i + a[i] + 1)] -= 1
    a[0] = b[0]
    cnt = a[0]
    for i in range(1, n):
        a[i] = a[i - 1] + b[i]
        cnt += a[i]

    # print(*a)
    if cnt == n**2:
        break

print(*a)