Harryxun/stf_run huggingface dataset:
def solve(arr,n,m,row,col,count):
    if row>=n or col>=m:
        return 1e9
    elif row==n-1 and col==m-1:
        if arr[row][col]=="#":
            count+=1
        return count
    else:
        if arr[row][col]=="#":
            count+=1
        return min(solve(arr,n,m,row+1,col,count),solve(arr,n,m,row,col+1,count))        

n,m=map(int,input().split())
arr=[int(0) for i in range(n)]
for i in range(m):
    arr[i]=list(input())



#print(arr)
print(solve(arr,n,m,0,0,0))       

### FIXED CODE ###


def IsvalidStep(arr,row1,col1,row2,col2):
    if arr[row2][col2]=="#" and arr[row1][col1]==".":
        return 1
    return 0    

def solve(arr,matrix,n,m):
    maxx=0
    if n>0:
        if arr[0][0]=="#":
            matrix[0][0]=1
        for col in range(1,m):
            matrix[0][col]=matrix[0][col-1]
            if arr[0][col]=="#" and arr[0][col-1]==".":
                matrix[0][col]+=1

        for row in range(1,n):    
            matrix[row][0]=matrix[row-1][0]
            if arr[row][0]=="#" and arr[row-1][0]==".":
                matrix[row][0]+=1
          
        for row in range(1,n):
            for col in range(1,m):
                matrix[row][col]=min(matrix[row-1][col]+IsvalidStep(arr,row-1,col,row,col),matrix[row][col-1]+IsvalidStep(arr,row,col-1,row,col))
        return matrix[n-1][m-1]        



n,m=map(int,input().split())
arr=[int(0) for i in range(n)]
matrix=[int(0) for i in range(n)]
for i in range(n):
    arr[i]=list(input())
    matrix[i]=[int(0) for _ in range(m)]



print(solve(arr,matrix,n,m))       


"""
def solve(arr,n,m,row,col,count):
    if row>=n or col>=m:
        return 1e9
    elif row==n-1 and col==m-1:
        if arr[row][col]=="#":
            count+=1
        return count
    else:
        if arr[row][col]=="#":
            count+=1
        return min(solve(arr,n,m,row+1,col,count),solve(arr,n,m,row,col+1,count))        
"""
#intの場合
N = int(input()) #ここで標準入力

#List にしたい時
#intの場合
huga = list(map(long, input().split()))
ans = 1
flg = 0
for number in huga:
    ans = ans * number
    if ans > 10**18:
        flg = 1
        break

if flg == 0:
    print(ans)
else:
    print('-1')



### FIXED CODE ###

#intの場合
L,R = map(int,input().split())

ans = L*R
print(ans)
N = int(input())
A = {}
for i in range(N):
    a = int(input())
    if a in A:
        A[a] += 1
    else:
        A[a] = 1
ans = 0
for val in A.values:
    ans += val % 2
print(ans)


### FIXED CODE ###

N = int(input())
A = {}
for i in range(N):
    a = int(input())
    if a in A:
        A[a] += 1
    else:
        A[a] = 1
ans = 0
for val in A.values():
    ans += val % 2
print(ans)
N = int(input())
alpha = [chr(i) for i in range(97, 97+26)]

if N <= 26:
    print(alpha[N-1])
else:
    digit = 1
    tmp = 26
    while True:
        if N <= tmp:
            break
        digit += 1
        tmp += 26 ** digit

    ans = ''
    for i in range(digit):
        ans += alpha[N // (26 ** (digit - i - 1)) - 1]
        N = N - N // (26 ** (digit - i - 1)) * (26 ** (digit - i - 1))

    print(ans)

### FIXED CODE ###

N = int(input())

az = [chr(i) for i in range(97, 97+26)]

N = N - 1

tmp1 = 0
for i in range(1, 1000):
    tmp1 += 26 ** i
    if tmp1 > N:
        num = i
        tmp1 -= 26 ** i
        N -= tmp1
        break

tmp = [0 for _ in range(num)]
for i in range(num):
    tmp[i] = N%26
    N = N // 26

ans = ""
for i in range(len(tmp)):
    ans = az[tmp[i]] + ans

print(ans)
n,q = map(int, input().split())
MAX = n + 2
Q = [0 for i in range(MAX)]
head = 0
tail = 0

def enqueue(x):
    global tail
    Q[tail] = ???
    tail = (tail + 1) % MAX

def dequeue():
    global head
    x,t = Q[head]
    head = (head + 1) %MAX
    return [x,t]
for i in range(n):
    P = list(input().split())
    enqueue([P[0], int(P[1])])

elaps = 0
while head != tail:
    u,t = dequeue()
    c = min(q, t)
    t -= c
    elaps += c
    if t > 0:
        enqueue([u,t])
    else:
        print(u + " " + str(elaps))

### FIXED CODE ###

n,q = map(int, input().split())
MAX = n + 2
Q = [0 for i in range(MAX)]
head = 0
tail = 0

def enqueue(u, t):
    global tail
    Q[tail] = [u, t]
    tail = (tail + 1) % MAX

def dequeue():
    global head
    x,t = Q[head]
    head = (head + 1) %MAX
    return [x,t]
for i in range(n):
    P = list(input().split())
    enqueue(P[0], int(P[1]))

elaps = 0
while head != tail:
    u,t = dequeue()
    c = min(q, t)
    t -= c
    elaps += c
    if t > 0:
        enqueue(u,t)
    else:
        print(u + " " + str(elaps))
# -*- coding: utf-8 -*-
MOD = 1000000007
N, M = map(int, input().split())
a = []
for _ in range(M):
    a.append(int(input()))


def getPatternNum(num):
    pattern = [0] * num
    for i in range(num):
        if i == 0 or i == 1:
            pattern[i] = 1
            continue
        pattern[i] = (pattern[i - 2] + pattern[i - 1]) % MOD
    return pattern


def solve():
    # 階段の連続してる数のリスト
    stepsList = [0] * (M + 1)
    maxSteps = 0
    stepsList[0] = a[0]
    for j in range(1, M):
        stepsList[j] = a[j] - a[j - 1] - 1
        if stepsList[j] == 0:
            return 0
    stepsList[M] = N - a[M - 1]
    pattern = getPatternNum(max(stepsList) + 1)
    # こわれてるところ以外のパターンを掛ける
    for k in range(len(stepsList)):
        if k == 0:
            total = pattern[stepsList[k] - 1]
        else:
            total = (total * pattern[stepsList[k] - 1]) % MOD
        # print("#", k, stepsList[k], pattern[stepsList[k] - 1], total)

    return total


ans = solve()
print(ans)

### FIXED CODE ###

N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
a.sort()
a.append(10 ** 9 + 7)

memo = [None] * (N + 1)
memo[0] = 1

idx = 0
for pos in range(1, N + 1):
    if a[idx] == pos:
        memo[pos] = 0
        idx += 1
        continue
    else:
        if pos > a[idx]:
            idx += 1
        #
        if pos == 1:
            memo[1] = (memo[0]) % (10 ** 9 + 7)
        else:
            memo[pos] = (memo[pos - 2] + memo[pos - 1]) % (10 ** 9 + 7)

# print("#", memo)
print(memo[-1])
N=[int(x) for x in input().split()]
if not N[2]%N[1]==0:
   c=N[2]//N[1]+1
else:
    c=N[2]//N[1]
if not N[0]%N[3]==0:
   c=N[0]//N[3]+1

   d=N[0]//N[3]+1
else:
    d=N[0]//N[3]
if d>=c:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

N=[int(x) for x in input().split()]
if N[0]>N[1]:
    print("safe")
else:
   print("unsafe")
a, b =map(int,input().split())
s = a-1
t =b -1
print((t+s-1)//2

### FIXED CODE ###

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

t = b - 1
s = a - 1
ans = (t + s - 1) // s
print(ans)
a,b=map(int, input().split())

if a=="H" and b=="H":
    print("H")
elif a=="H" and b=="D":
    print("D")
elif a=="D" and b=="H":
    print("D")
elif a=="D" and b=="D":
    print("H")

### FIXED CODE ###

a,b=input().split()

if a=="H" and b=="H":
    print("H")
elif a=="H" and b=="D":
    print("D")
elif a=="D" and b=="H":
    print("D")
elif a=="D" and b=="D":
    print("H")
N = int(input())
S=[]
for n in range(N):
    S.append(input())
Slist = []
for s in S:
    lists = list(s)
    listss = sorted(lists)
    Slist.append(listss)
def isAna2(Sl,sl):
    boolcount = True
    for i,Sli in enumerate(Sl):
        if Sli != sl[i]:
            boolcount = False
            break
    return boolcount
import copy
def countAna(Slist):
    if len(Slist) == 1:
        return 0
    else:
        groupcount = 1
        Sl = Slist[0]
        del Slist[0]
        newSlist = copy.deepcopy(Slist)
        for i,sl in enumerate(Slist):
            if isAna2(Sl, sl) == True:
                groupcount += 1
                del newSlist[i]
        if groupcount == 1:
            count = 0
        else:
            count = int(groupcount*(groupcount-1)/2)
        return count + countAna(newSlist)
print(countAna(Slist))

### FIXED CODE ###

N = int(input())
S=[]
for n in range(N):
    S.append(input())
Sdict = {}
for s in S:
    lists = list(s)
    listss = sorted(lists)
    listsss = ''.join(listss)
    if Sdict.get(listsss) == None:
        Sdict[listsss] = 1
    else:
        Sdict[listsss] += 1
count = 0
for value in Sdict.values():
    count += int(value*(value-1)/2)
print(count)
n = int(input())
a = map(int,input().split())
s = 0
for i in range(n-2):
  s+=min(a[n-i],a[n-i-1])
print(s+a[n-2])

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
s = 0
for i in range(n-2):
  s+=min(a[n-2-i],a[n-i-3])
print(s+a[n-2]+a[0])
# make_tree(graph, root) -> dist, parent

# LCA: Last Common Ancestor (最近共通祖先)
# lca(u, v, dist, parent)

# Inclusion-exclusion principle: 包除原理
# http://satanic0258.hatenablog.com/entry/2016/04/10/104524
# A∨B∨C = ￢(￢A￢B∨￢C)

N = int(input())
AB = [list(map(int, input().split())) for _ in range(N - 1)]
M = int(input())
UV = [list(map(int, input().split())) for _ in range(M)]

MOD = 10 ** 9 + 7

graph = [[] for _ in range(N + 1)]
for a, b in AB:
  graph[a].append(b)
  graph[b].append(a)
  
def make_tree(graph, root):
  INF = 10 ** 15
  dist = [INF] * len(graph)
  parent = [-1] * len(graph)
  stack = [root]
  dist[root] = 0
  parent[root] = root
  while stack:
    s = stack.pop()
    for g in graph[s]:
      if dist[g] > dist[s] + 1:
        dist[g] = dist[s] + 1
        parent[g] = s
        stack.append(g)
  return dist, parent

def lca(u, v, dist, parent):
  distu, distv = dist[u], dist[v]
  if distu > distv:
    for _ in range(distu - distv):
      u = parent[u]
  if distv > distu:
    for _ in range(distv - distu):
      v = parent[v]
  while u != v:
    u, v = parent[u], parent[v]
  return u

dist, parent = make_tree(graph, 1)
#print(parent)

for i, (u, v) in enumerate(UV):
  UV[i].append(lca(u, v, dist, parent))

cnt = [0] * (N + 1)
for u, v, l in UV:
  tmp = [1] * (N + 1)
  uu, vv = u, v
  while uu != l:
    tmp[uu] = 0
    uu = parent[uu]
  while vv != l:
    tmp[vv] = 0
    vv = parent[vv]
  for i in range(2, N + 1):
    cnt[i] += tmp[i]
print(cnt)

cnt_tmp = 0
for i in range(2, N + 1):
  if cnt[i]:
    cnt_tmp += 1
print((pow(2 , N - 1, MOD) - pow(2, cnt_tmp, MOD)) % MOD)

### FIXED CODE ###

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

print("Yes" if N == M else "No")
from collections import defaultdict
n=int(input())
a=list(map(int,input().split()))
b=[]
c=[]
d=defaultdict(int)
for i in range(n):
    d[a[i]]+=1

for i,j in d.items():
    if j>=2:
        b.append(i)
    if j>=4:
        c.append(i)

if len(b)<2 and len(c)<1:
    print(0)
elif len(c)==1 and len(b)<2:
    print(c[0]**2)
else:
    b.sort(reverse=True)
    rec=b[0]*b[1]
    if len(c)>=1:
        c.sort(reverse=True)
        cube=c[0]**2
    print(max(rec,cube))

### FIXED CODE ###

from collections import defaultdict
n=int(input())
a=list(map(int,input().split()))
b=[]
c=[]
d=defaultdict(int)
for i in range(n):
    d[a[i]]+=1

for i,j in d.items():
    if j>=2:
        b.append(i)
    if j>=4:
        c.append(i)

if len(b)<2 and len(c)<1:
    print(0)
elif len(c)==1 and len(b)<2:
    print(c[0]**2)
else:
    b.sort(reverse=True)
    rec=b[0]*b[1]
    if len(c)>=1:
        c.sort(reverse=True)
        cube=c[0]**2
    else:
        cube=0
    print(max(rec,cube))
li = input().split()
 
print( li[0](li[0]-1)/2 + li[1](li[1]-1)/2 )

### FIXED CODE ###

li = input().split()
li[0] = int(li[0])  
li[1] = int(li[1])  
  
print( int(li[0]*(li[0]-1)/2 + li[1]*(li[1]-1)/2 ))
import fractions

n,X=map(int,input().split())
x=list(map(int,input().split()))
x.append(X)
x2=sorted(x)
a=x2[1]-x2[0]
if len(x2)==2:
    print(a)
else:
    for i in range(1,n-1):
        b=x2[i+1]-x2[i]
        ans=fractions.gcd(a,b)
        a=ans
    print(ans)

### FIXED CODE ###

import fractions

n,X=map(int,input().split())
x=list(map(int,input().split()))
ans=abs(x[0]-X)
for i in range(1,n):
    b=abs(x[i]-X)
    ans=fractions.gcd(ans,b)
print(ans)
n=input()
dc=dict()
for j in input().split():
    i=int(j)
    if i in dc:
        dc[i]+=1
    else:
        dc[i]=1
ans=0
for i in dc:
    if dc[i]>i:
        ans+=dc[i]-i,0
    elif dc[i]<i:
        ans+=dc[i]
print(ans)
    


### FIXED CODE ###

n=input()
dc=dict()
for j in input().split():
    i=int(j)
    if i in dc:
        dc[i]+=1
    else:
        dc[i]=1
ans=0
for i in dc:
    if dc[i]>i:
        ans+=dc[i]-i
    elif dc[i]<i:
        ans+=dc[i]
print(ans)
w=input()
nw=len(w)
lw=list(w)
n=int(input())
alpha="qwertyuiopasdfghjklzxcvbnm"
l=sorted(list(alpha))
d={}
for i in range(26):
  d[l[i]]=i+1
num=n
count=0
while num>0 and count<nw:
  if lw[count]=="a":
    count+=1
  else:
    letter=lw[count]
    if 27-d[letter]<num:
      num-=27-d[letter]
      lw[count]="a"
      count+=1
    else:
      count+=1
if num>0:
  a=lw[-1]
  num1=d[a]
  lw[-1]=l[num1+num-1]
print("".join(lw))

### FIXED CODE ###

w=input()
nw=len(w)
lw=list(w)
n=int(input())
alpha="qwertyuiopasdfghjklzxcvbnm"
l=sorted(list(alpha))
d={}
for i in range(26):
  d[l[i]]=i
num=n
count=0
while num>0 and count<nw:
  if lw[count]=="a":
    count+=1
  else:
    letter=lw[count]
    if 27-d[letter]-1<=num:
      num-=27-d[letter]-1
      lw[count]="a"
      count+=1
    else:
      count+=1
if num>0:
  a=lw[-1]
  num1=d[a]
  lw[-1]=l[(num1+num)%26]
print("".join(lw))
r = int(input())
p = 3.141592
print(round(r*r*p,6),round(2*r*p,6))

### FIXED CODE ###

import math
r = float(input())
p = math.pi
print(round(r*r*p,6),round(2*r*p,6))
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)
que = deque()
def func(x):
    i = x[3]
    if x[3] == N:
        print('Yes')
        return 1
    if S[i] == 'AB':
        if x[1] > 0:
            result = func((x[0]+1, x[1]-1, x[2], x[3]+1))
            if result:
                que.append('A')
                return 1
        if x[0] > 0:
            result = func((x[0]-1, x[1]+1, x[2], x[3]+1))
            if result:
                que.append('B')
                return 1
    elif S[i] == 'BC':
        if x[2] > 0:
            result = func((x[0], x[1]+1, x[2]-1, x[3]+1))
            if result:
                que.append('B')
                return 1

        if x[1] > 0:
            result = func((x[0], x[1]-1, x[2]+1, x[3]+1))
            if result:
                que.append('C')
                return 1
    elif S[i] == 'AC':
        if x[2] > 0:
            result = func((x[0]+1, x[1], x[2]-1, x[3]+1))
            if result:
                que.append('A')
                return 1
        if x[0] > 0:
            result = func((x[0]-1, x[1], x[2]+1, x[3]+1))
            if result:
                que.append('C')
                return 1
    return 0


N, A, B, C = [int(i) for i in input().split()]
S = [input() for _ in range(N)]
i = 0

result = func((A, B, C, i))
if result == 1:
    while len(que) > 0:
        print(que.pop())
else:
    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')
n = int(input())
lst = [list(map(int,input().split())) for _ in range(n)]

cx,cy = 0,0
for cx in range(101):
    for cy in range(101):
        pro_height = []
        for i in range(n):
            h = lst[i][2] + abs(lst[i][0]-cx) + abs(lst[i][1]-cy)
            pro_height.append(h)
        if len(set(pro_height)) == 1:
            ans_H = pro_height[0]
            ans_cx = cx
            ans_cy = cy
            break
print(ans_cx,ans_cy,ans_H)

### FIXED CODE ###

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

for cx in range(101):
    for cy in range(101):
        H = -1
        ok = True
        for x, y, h in P:
            if h == 0:
                continue
            Hi = abs(x-cx) + abs(y-cy) + h
            if H == -1:
                H = Hi
                continue
            if Hi != H:
                ok = False
                break
        if not ok:
            continue
        for x, y, h in P:
            if h != max(H-abs(cx-x)-abs(cy-y), 0):
                ok = False
        if ok:
            print(cx, cy, H)
            break
    if ok:
        break
import sys
  
def Forbidden_List(x,n,p):
  k = [abs(s - x) for s in p]
  for i in range(n):
    if i not in k: 
      return 10 - i
  return 10 - n
 
if __name__ == '__main__':
    input = sys.stdin.readline
    
    inp1 = input().rstrip().split()
    inp2 = input().rstrip().split()
    
    x,n = int(inp1[0]),int(inp1[1])
    if n == 0:
        print(x)
    else:
        p = list(map(int,inp2))
 
        print(Forbidden_List(x,n,p))

### FIXED CODE ###

import sys

def Forbidden_List(x,n,p):
  for i in range(n):
    if x - i not in p: 
        return x - i
    if x + i not in p:
        return x + i
  return x - n

if __name__ == '__main__':
    input = sys.stdin.readline
    
    inp1 = input().rstrip().split()
    x,n = int(inp1[0]),int(inp1[1])
    if n == 0:
        print(x)
    else: 
        inp2 = input().rstrip().split()
        p = list(map(int,inp2))
        print(Forbidden_List(x,n,p))
N = int(input())
uvw = [list(map(int, input().split())) for i in range(N - 1)]
R = [-1] * N
Q = [[] for i in range(N)]
for i in range(N - 1):
    Q[uvw[i][0] - 1].append([uvw[i][1], uvw[i][2]])
    Q[uvw[i][1] - 1].append([uvw[i][0], uvw[i][2]])

def func(i, s, d, l):
    
    if R[i] != -1:
        return

    if R[i] == -1:
        if l %2 == 0:
            R[i] = s
        else:
            R[i] = d
            s = d
            d = s
    for j in range(len(Q[i])):
        func(Q[i][j][0] - 1, s, d, Q[i][j][1])

func(uvw[0][0] - 1, 0, 1, 0)
for i in range(len(R)):
    print(R[i])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)
N = int(input())
uvw = [list(map(int, input().split())) for i in range(N - 1)]
R = [-1] * N
Q = [[] for i in range(N)]
for i in range(N - 1):
    Q[uvw[i][0] - 1].append([uvw[i][1], uvw[i][2]])
    Q[uvw[i][1] - 1].append([uvw[i][0], uvw[i][2]])

def func(i, s, d, l):
    
    if R[i] != -1:
        return

    if R[i] == -1:
        if l %2 == 0:
            R[i] = s
        else:
            R[i] = d
            tmp = s
            s = d
            d = tmp
    for j in range(len(Q[i])):
        func(Q[i][j][0] - 1, s, d, Q[i][j][1])

func(uvw[0][0] - 1, 0, 1, 0)
for i in range(len(R)):
    print(R[i])
n, k = map(int, input().split())
s = input()
t = 0
for i in range(n - 1):
    if s[i] == s[i + 1]:
        t += 1
print(min([n - 1, h + 2 * k]))


### FIXED CODE ###

n, k = map(int, input().split())
s = input()
t = 0
for i in range(n - 1):
    if s[i] == s[i + 1]:
        t += 1
print(min([n - 1, t + 2 * k]))
S,W=int(input()),int(input())
if S <= W:
  print('unsafe')
else:
  print('safe')

### FIXED CODE ###

# AtCoder
S, W = map(int, input().split())
if S <= W:
    print('unsafe')
else:
    print('safe')
s = input()
s_ = s.replace("BC", "D")
group = re.findall(r"[AD]+", s_)
ans = 0
for grp in group:
    a = 0
    for g in grp:
        if g=="A":
            a += 1
        if g=="D":
            ans += a
print(ans)

### FIXED CODE ###

import re
s = input()
s_ = s.replace("BC", "D")
group = re.findall(r"[AD]+", s_)
ans = 0
for grp in group:
    a = 0
    for g in grp:
        if g=="A":
            a += 1
        if g=="D":
            ans += a
print(ans)
s = list(map(int, input().split()))
l = list(range(s[0],s[1]+1))

ans = sorted(set(l[:s[2]] + l[len(l)-s[2]:]))

for i in ans:
    print(i)

### FIXED CODE ###

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

l = [i for i in range(a, b+1) if (i < a+k) or (i > b-k)]

print(*l, sep="\n", end="")
n,a,b=map(int,input().split())
if b+w<a:print(a-b-w)
else:print(max(0,b-a-w))

### FIXED CODE ###

w,a,b=map(int,input().split())
if b+w<a:print(a-b-w)
else:print(max(0,b-a-w))
N, T = map(int,raw_input().split())
ans = float("inf")

for i in range(N):
    c,t = map(int,input(),split())
    if t <= T:
        ans = min(num,c)

if ans == float("inf"):
    print("TLE")
else:
    print(ans)


### FIXED CODE ###

N, T = map(int,input().split())
ans = float("inf")

for i in range(N):
    c,t = map(int,input().split())
    if t <= T:
        ans = min(ans,c)

if ans == float("inf"):
    print("TLE")
else:
    print(ans)
import itertools
n=int(input())
p=''.join(list(input().split()))
q=''.join(list(input().split()))
l=[]
for a in itertools.permutations(range(1,n+1),n):
  l.append(a)
ip=l.index(p)
iq=l.index(q)
print(abs(ip-iq))

### FIXED CODE ###

import itertools
n=int(input())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
l=[]
for a in itertools.permutations(range(1,n+1),n):
  l.append(a)
ip=l.index(tuple(p))
iq=l.index(tuple(q))
print(abs(ip-iq))
n = int(input())
x = []
y = []

for i in range(n):
    a = int(input())
    x.append([])
    y.append([])
    for j in range(a):
        u, v = map(int, input().split())
        x[i].append(u)
        y[i].append(v)
ans = 0
for i in range(2 ** n):
    jdg = [False] * n
    used = [False] * n
    end = False
    for j in range(n):
        if ((i >> j) & 1):
            jdg[j] = True
    for j in range(n):
        for k in range(n):
            if ((not jdg[k]) or used[k]):
                continue
            used[k] = True
            for l in range(len(x[k])):
                if (y[k][l] == 1):
                    jdg[x[k][l] - 1] = True
                elif (jdg[x[k][l] - 1]):
                    end = True
                    break
            if (end):
                break
        if (end):
            break
    if (end):
        continue
    ans = max(sum(jdg), ans)

print(ans)


### FIXED CODE ###

a = [int(i) for i in input().split()]

print('bust' if sum(a) > 21 else 'win')
x = list(map(int,input().split( )))
z = x[1]-x[0]
t = 0
for s in range(z+2):
    t += s
    
print(t-x[1])

### FIXED CODE ###

x = int(input())

if x > 999:
    print('ABD')
    
else:
    print('ABC')
data = [int(i) for i in input).split()]

data.sort()
print("{0}{1}{2}".format(data[0],data[1],data[2]))

### FIXED CODE ###

data = [int(i) for i in input().split()]

data.sort()
print("{0} {1} {2}".format(data[0],data[1],data[2]))
a = list(map(int,input()))
b = a.count(’5')
c = a.count(’7')
if b == 2 and c ==1:
            pritn('YES')
else:
            print('NO')
 

### FIXED CODE ###

a = list(map(int,input().split()))
b = a.count(5)
c = a.count(7)
if b == 2 and c ==1:
            print('YES')
else:
            print('NO')