Harryxun/stf_run huggingface dataset:
r1,c1,r2,c2 = map(int, input().split())


def nCr_mod_p(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

p = 10 ** 9 + 7
N = 10 ** 6  # N は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p), 0! = 1! = 1
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p), 0! = 1! = 1
inv = [0, 1]  # inv[n] = n^(-1) mod p, 0! = 1　だけど便宜上inv[0]=0にしてる

for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)

sum22 = nCr_mod_p(r2+1+c2+1,r2+1,p) - 1
sum21 = nCr_mod_p(r2+c1+1,r2+1,p) - 1
sum12 = nCr_mod_p(r1+c2+1,c2+1,p) - 1
sum11 = nCr_mod_p(r1+c1,c1,p) - 1

ans = sum22 - sum21 - sum12 + sum11
ans %= p

print(ans)


### FIXED CODE ###

r1,c1,r2,c2 = map(int, input().split())

def nCr_mod_p(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

p = 10 ** 9 + 7
N = 2*10 ** 6 + 10  # N は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p), 0! = 1! = 1
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p), 0! = 1! = 1
inv = [0, 1]  # inv[n] = n^(-1) mod p, 0! = 1　だけど便宜上inv[0]=0にしてる

for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)

sum22 = nCr_mod_p(r2+1+c2+1,r2+1,p) - 1
sum21 = nCr_mod_p(r2+1+c1,r2+1,p) - 1
sum12 = nCr_mod_p(r1+c2+1,c2+1,p) - 1
sum11 = nCr_mod_p(r1+c1,c1,p) - 1

ans = sum22 - sum21 - sum12 + sum11
ans %= p

print(ans)
# -*- coding: utf-8 -*-

# AtCoder Beginner Contest
# Problem C


# See:
# https://atcoder.jp/img/abc054/editorial.pdf
def dfs(v):
    all_visited = True

    if False in visited:
        all_visited = False

    if all_visited:
        return 1

    count = 0

    for i in range(n):
        if graph[v][i] == 0:
            continue

        if visited[i]:
            continue

        visited[i] = True
        count += dfs(i)
        visited[i] = False
    return count


if __name__ == '__main__':
    n, m = list(map(int, input().split()))
    graph = [[0 for __ in range(m)] for _ in range(m)]

    for i in range(m):
        a, b = list(map(lambda x: int(x) - 1, input().split()))
        graph[a][b] = 1
        graph[b][a] = 1

    visited = [False] * n
    visited[0] = True

    print(dfs(0))


### FIXED CODE ###

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

# AtCoder Beginner Contest
# Problem C


# See:
# https://atcoder.jp/img/abc054/editorial.pdf
def dfs(v):
    all_visited = True

    if False in visited:
        all_visited = False

    if all_visited:
        return 1

    count = 0

    for i in range(n):
        if graph[v][i] == 0:
            continue

        if visited[i]:
            continue

        visited[i] = True
        count += dfs(i)
        visited[i] = False
    return count


if __name__ == '__main__':
    n, m = list(map(int, input().split()))
    graph = [[0 for __ in range(n)] for _ in range(n)]

    for i in range(m):
        a, b = list(map(lambda x: int(x) - 1, input().split()))
        graph[a][b] = 1
        graph[b][a] = 1

    visited = [False] * n
    visited[0] = True

    print(dfs(0))
def resolve():
    from collections import deque
    n,m,k = map(int, input().split())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    a = deque(a)
    b = deque(b)
    min = 0
    ans = 0
    while True:
        if len(a) == 0 and len(b)==0:
            break
        elif len(a) == 0:
            bb = b.popleft()
            read = bb
            if min + read <= k:
                min += read
                ans += 1
            else:
                break
        elif len(b) == 0:
            ab = a.popleft()
            read = ab
            if min + read <= k:
                min += read
                ans += 1
            else:
                break
        else:
            ab = a.popleft()
            bb = b.popleft()
            if ab == bb:
                if a[0] < b[0]:
                    b.appendleft(bb)
                    read = ab
                else:
                    a.appendleft(ab)
                    read = bb

            elif ab < bb:
                b.appendleft(bb)
                read = ab
            else:
                a.appendleft(ab)
                read = bb
            if min + read <= k:
                min += read
                ans += 1
            else:
                break

    print(ans)
resolve()

### FIXED CODE ###


def resolve():
    import bisect
    n,m,k = map(int, input().split())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))

    cuma = [0]
    cumb = [0]
    for i in range(n):
        cuma.append(cuma[-1]+ a[i])
    for i in range(m):
        cumb.append(cumb[-1] + b[i])

    ans = 0
    for i in range(n+1):
        if k-cuma[i] < 0:
            continue
        ans = max(ans, i + bisect.bisect_right(cumb, k-cuma[i])-1)
    print(ans)
resolve()
s = int(input())

a = [-1]*(s+1)
mod = 10**9 + 7

a[0] = 1
a[1] = 0
a[2] = 0
a[3] = 1
for i in range (4,s+1):
    a[i] = (a[i-1]+a[i-3])%mod

print(a[s])


### FIXED CODE ###

s = int(input())

a = [-1]*(s+10)
mod = 10**9 + 7

a[0] = 1
a[1] = 0
a[2] = 0
a[3] = 1
if s > 3:
    for i in range (4,s+1):
        a[i] = (a[i-1]+a[i-3])%mod

print(a[s])
S = input()

count = 1
answer = [0] * len(S)
# RLの切り替わるインデックスをマーク
n = 0
for i in range(len(S) - 1):
    if (S[i] == S[i + 1]):
        count += 1
    else:
        if (S[i + 1] == 'R'):
            # Lを割り振る
            answer[n] += count // 2
            answer[n + 1] += -(-count // 2)
            count = 1
        else:
            # Rを割り振る
            answer[i] += -(-count // 2)
            answer[i + 1] += count // 2
            count = 1
            n = i
    # 右端のLを割り振る
    if (i == len(S) - 2):
        answer[n] += count // 2
        answer[n + 1] += -(-count // 2)

for c in answer:
    print(f"{c} ", end='')
print()


### FIXED CODE ###

S = input()

count = 1
answer = [0] * len(S)
# RLの切り替わるインデックスをマーク
n = 0
for i in range(len(S) - 1):
    if (S[i] == S[i + 1]):
        count += 1
    else:
        if (S[i + 1] == 'R'):
            # Lを割り振る
            answer[n] += count // 2
            answer[n + 1] += -(-count // 2)
            count = 1
        else:
            # Rを割り振る
            answer[i] += -(-count // 2)
            answer[i + 1] += count // 2
            count = 1
            n = i
    # 右端のLを割り振る
    if (i == len(S) - 2):
        answer[n] += count // 2
        answer[n + 1] += -(-count // 2)

for i, c in enumerate(answer):
    print(c, end='')
    print(' ', end='')
a, b, c = map(int, input().split())
print(len(set(a, b, c)))

### FIXED CODE ###

a, b, c = map(int, input().split())
print(len(set([a, b, c])))
import collections
import sys
input=sys.stdin.readline()

def calc():
  h,w,k=map(int,input().split())
  sy,sx,gy,gx=map(int,input().split())
  sy,sx,gy,gx=sy-1,sx-1,gy-1,gx-1
  board=[input() for _ in range(h)]
  q=collections.deque()
  q.append((sx,sy))
  checked=[[0]*w for _ in range(h)]
  checked[sy][sx]=1
  cost=[[10**18]*w for _ in range(h)]
  cost[sy][sx]=0
  dx=[1,0,-1,0]
  dy=[0,1,0,-1]
  while len(q)!=0:
    x,y=q.popleft()
    c=cost[y][x]
    for i in range(4):
      for j in range(1,k+1):
        if x+j*dx[i]<0 or w<=x+j*dx[i] or y+j*dy[i]<0 or h<=y+j*dy[i]:
          break
        if board[y+j*dy[i]][x+j*dx[i]]=='@':
          break
        if cost[y+j*dy[i]][x+j*dx[i]]<=c:
          break
        q.append((x+j*dx[i],y+j*dy[i]))
        cost[y+j*dy[i]][x+j*dx[i]]=c+1
  if cost[gy][gx]==10**18:
    print(-1)
  else:
    print(cost[gy][gx])
calc()

### FIXED CODE ###

import collections

h,w,k=map(int,input().split())
sy,sx,gy,gx=map(int,input().split())
sy,sx,gy,gx=sy-1,sx-1,gy-1,gx-1
board=[input() for _ in range(h)]
q=collections.deque()
q.append((sx,sy))
checked=[[0]*w for _ in range(h)]
checked[sy][sx]=1
cost=[[10**18]*w for _ in range(h)]
cost[sy][sx]=0
dx=[1,0,-1,0]
dy=[0,1,0,-1]
while len(q)!=0:
  x,y=q.popleft()
  c=cost[y][x]
  for i in range(4):
    for j in range(1,k+1):
      if x+j*dx[i]<0 or w<=x+j*dx[i] or y+j*dy[i]<0 or h<=y+j*dy[i]:
        break
      if board[y+j*dy[i]][x+j*dx[i]]=='@':
        break
      if cost[y+j*dy[i]][x+j*dx[i]]<=c:
        break
      if cost[y+j*dy[i]][x+j*dx[i]]>c+1:
        q.append((x+j*dx[i],y+j*dy[i]))
        cost[y+j*dy[i]][x+j*dx[i]]=c+1
if cost[gy][gx]==10**18:
  print(-1)
else:
  print(cost[gy][gx])
n,m=map(int, input().split())
h = [list(map(str,input().split())) for _ in range(m)]
# print(h)
for i in range(m):
    h[i][0] = int(h[i][0])
l=set()
penalty = 0
import numpy as np
p = np.zeros(n)
for i in range(m):
    if h[i][0] not in l:
        if h[i][1] == 'AC':
            l.add(h[i][0])
            penalty += p[h[i][0]-1]
        else:
            p[h[i][0]-1] += 1
ansnum = len(l)

# for i in l:
#     penalty += p[i-1]

print(ansnum,int(penalty))

### FIXED CODE ###

n,m=map(int, input().split())
h = [list(map(str,input().split())) for _ in range(m)]
# print(h)
for i in range(m):
    h[i][0] = int(h[i][0])
l=set()
penalty = 0
import numpy as np
p = np.zeros(n)
for i in range(m):
    if h[i][0] not in l:
        if h[i][1] == 'AC':
            l.add(h[i][0])
            penalty += p[h[i][0]-1]
        else:
            p[h[i][0]-1] += 1
ansnum = len(l)

# for i in l:
#     penalty += p[i-1]

print(ansnum,int(penalty))
s = list(input())
n = len(s)

if "".join(s) == "keyence":
	print("YES")
	eixt()

for i in range(n):
	ss = s[::]
	for j in range(i, n):
		ss.pop(i)
		print("".join(ss))
		if "".join(ss) == "keyence":
			print("YES")
			break
	else:
		continue
	break
else:
	print("NO")

### FIXED CODE ###

s = list(input())
n = len(s)

if "".join(s) == "keyence":
	print("YES")
	exit()

for i in range(n):
	ss = s[::]
	for j in range(i, n):
		ss.pop(i)
		if "".join(ss) == "keyence":
			print("YES")
			break
	else:
		continue
	break
else:
	print("NO")
import math
X,Y = map(int, input().split())
maxY = X * 2
if (maxY - Y)%3==0:
    num2 = (maxY - Y)//3
    num1 = X - num2 * 2
    print((math.factorial(num2+num1) // math.factorial(num1) * math.factorial(num2))%(10**9+7))
else:
    print(0)


### FIXED CODE ###

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

def cinit(N):
    for i in range( 2, N + 1 ):
        g1.append( ( g1[-1] * i ) % mod )
        inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
        g2.append( (g2[-1] * inverse[-1]) % mod )

X,Y = map(int, input().split())
if (X+Y)%3==0and(X<Y*2 or Y<X*2):
    cinit((X+Y)//3)
    p = (min(X,Y)*2 - max(X,Y))//3
    print(cmb((X+Y)//3,p,mod))
else:
    print(0)
L, R = map(int, input().split())
if R - L >= 2019 :
    print(0)

else :
    t = []
    for i in range(L, R):
        for j in range(i + 1, R + 1) :
            list.append((i * j) % 2019)
    print(min(t))

### FIXED CODE ###

L, R = map(int, input().split())
if R - L >= 2019 :
    print(0)

else :
    t = []
    for i in range(L, R):
        for j in range(i + 1, R + 1) :
            t.append((i * j) % 2019)
    print(min(t))
N, K = map(int, input().split())
D = list(map(int, input().split()))
OK = list({1, 2, 3, 4, 5, 6, 7, 8, 9} - set(D))

S = str(N)
ans = []


def find_next(x):
    while True:
        x += 1
        if x in OK:
            return str(x)


for i in range(len(S)):
    if int(S[i]) in OK:
        ans += S[i]
    elif max(OK) > int(S[0]):
        ans += find_next(int(S[0]))
        for _ in range(len(S) - len(ans)):
            ans += "0"
        break
    else:
        if i == 0:
            ans += str(min(OK))
        else:
            ans[-1] = find_next(ans[-1])

        for _ in range(len(S) - len(ans) + 1):
            ans += "0"
        break

print("".join(ans))

### FIXED CODE ###

N, K = map(int, input().split())
D = list(map(int, input().split()))
ans = N
while True:
    for i in D:
        if str(i) in str(ans):
            break
    else:
        break

    ans += 1

print(ans)
N = int(input())
cs = list(input())

ans = 0
sorted = N - 1
for i in range(N):
  if cs[i] == "W":
    for j in range(sorted, i, -1):
      if cs[j] == "R":
        cs[i], cs[j] = cs[j], cs[i]
        ans += 1
        sorted = j
        break
  if (i + 1) == j:
    break
print(str(ans))

### FIXED CODE ###

N = int(input())
cs = list(input())

ans = 0
sorted = N - 1
for i in range(N):
  if cs[i] == "W":
    for j in range(sorted, i, -1):
      sorted = j - 1
      if cs[j] == "R":
        cs[i], cs[j] = cs[j], cs[i]
        ans += 1
        break
  if (i + 1) > sorted:
    break
print(str(ans))
import sys
n = int(input())
x = list(map(int, input().split()))
s = sorted([[y-1, i+1] for i, y in enumerate(x)])
#print(s)
cur = 0
cnt = [0 for _ in range(n+1)]
cnt_cur = 0
ans = []
residual = []
for i in range(n*n):
	#print(i, cur, cnt_cur)
	if i == s[cur][0] and cnt[s[cur][1]] < s[cur][1]-1:
		print("No")
		sys.exit()
	elif i == s[cur][0]:
		ans.append(s[cur][1])
		cnt[s[cur][1]] += 1
		residual += [s[cur][1]] * (n - s[cur][1])
		cur += 1
		if cur == n:
			break
	elif cnt_cur < n:
		if cnt[s[cnt_cur][1]] == s[cnt_cur][1]-1:
			cnt_cur += 1
		if cnt_cur == n:
			ans.append(residual.pop())
			continue
		cnt_cur = max(cnt_cur, cur)
		ans.append(s[cnt_cur][1])
		cnt[s[cnt_cur][1]] += 1
	else:
		ans.append(residual.pop())
ans += residual
print("Yes")
print(*ans)

### FIXED CODE ###

import sys
n = int(input())
x = list(map(int, input().split()))
s = sorted([[y-1, i+1] for i, y in enumerate(x)])
cur = 0
cnt = [0 for _ in range(n+1)]
fill_cur = 0
ans = []
residual = []
for i in range(n*n):
	if i == s[cur][0] and cnt[s[cur][1]] != s[cur][1]-1:
		print("No")
		sys.exit()
	elif i == s[cur][0]:
		ans.append(s[cur][1])
		cnt[s[cur][1]] += 1
		residual += [s[cur][1]] * (n - s[cur][1])
		cur += 1
		fill_cur = max(fill_cur, cur)
		if cur == n:
			break
	elif fill_cur < n:
		while cnt[s[fill_cur][1]] == s[fill_cur][1]-1:
			fill_cur += 1
			if fill_cur == n:
				if not residual:
					print("No")
					sys.exit()
				ans.append(residual.pop())
				break
		else:
			fill_cur = max(fill_cur, cur)
			ans.append(s[fill_cur][1])
			cnt[s[fill_cur][1]] += 1
	elif not residual:
		print("No")
		sys.exit()
	else:
		ans.append(residual.pop())
ans += residual
print("Yes")
print(*ans)
a11, a12, a13 = map(int, input().split())
a21, a22, a23 = map(int, input().split())
a31, a32, a33 = map(int, input().split())
n = int(input())
l = [int(input()) for i in range(n)]
if (a11 and a12 and a13 in l) or (a21 and a22 and a23 in l) or (a31 and a32 and a33 in l) or (a11 and a21 and a31 in l) or (a22 and a12 and a32 in l) or (a13 and a23 and a33 in l) or (a11 and a22 and a33 in l) or (elif a13 and a22 and a31 in l):
    print('Yes')
else :
    print('No')

### FIXED CODE ###

A=[]
flag=0
for i in range(3):
  A.append(list(map(int,input().split())))
n=int(input())
for i in range(n):
  s=int(input())
  for k in range(3):
    if s in A[k]:
      A[k][A[k].index(s)]=0

if A[0]==[0,0,0] or A[1]==[0,0,0] or A[2]==[0,0,0]:
  print("Yes")
  flag=1
elif A[1][1]==0 and A[2][2]==0 and A[0][0]==0:
  print("Yes")
  flag=1
elif A[0][2]==0 and A[1][1]==0 and A[2][0]==0:
  print("Yes")
  flag=1
else:
  for i in range(3):
    if A[0][i]==0 and A[1][i]==0 and A[2][i]==0:
      print("Yes")
      flag=1
      break
if flag == 0:
  print("No")
i=list(map(int, input().split()))
 
if i[0]==i[1] | i[0]==i[2] | i[1]==i[2]:
  if i[0]==i[1] & i[0]==i[2]  & i[1]==i[2]:
	print('No')
  else:
	print('Yes')
else:
    print('No')

### FIXED CODE ###

i=list(map(int, input().split()))
 
if i[0]==i[1] or i[0]==i[2] or i[1]==i[2]:
	if i[0]==i[1] and i[0]==i[2]:
		print('No')
	else:
		print('Yes')
else:
    print('No')
list1=list(input())
list1.reverse()
count=0
for i in range(len(list1)):
    if list1[i]=="W":
        a=i
        break
for i in range(a+1,len(list1)):
    if list1[i]=="B":
        count+=i-a
        a+=1
print(count)

### FIXED CODE ###

list1=list(input())
list1.reverse()
a=0
count=0
for i in range(len(list1)):
    if list1[i]=="W":
        a=i
        break
for i in range(a,len(list1)):
    if list1[i]=="B":
        count+=i-a
        a+=1
print(count)
import math

def is_prime(n):
    sqrtn = math.ceil(math.sqrt(n))
    for i in range(2, sqrtn + 1):
        if n % i == 0:
            return False
    return n != 1

n = int(input())
answer = 0
for _ in range(0, n+1):
    m = int(input())
    if is_prime(m):
        print(m)
        answer = answer + 1
print(answer)


### FIXED CODE ###

def witness(a, n, t, u):
    x = pow(a, u, n)  # x0 = a^u mod nを計算

    for _ in range(0, t):
        y = (x * x) % n

        # 法nの下での1の非自明な平方根が存在するのはnが合成数であるときに限る
        if y == 1 and x != 1 and x != (n - 1):
            return True
        x = y
    return y != 1

def is_probably_prime(n, witnesses):
    t = 1
    u = n >> 1
    while u & 1 == 0:
        t = t + 1
        u >>= 1
    assert(2**t * u == n - 1)

    for a in witnesses:
        if a < n and witness(a, n, t, u):
            return False
    return True

def is_definitely_prime(n):
    if ((not (n & 1)) and n != 2) or (n < 2) or ((n % 3 == 0) and (n != 3)):
        return False
    elif n <= 3:
        return True
    else:
        return is_probably_prime(n, [2, 7, 61])


n = int(input())
answer = 0
for _ in range(0, n):
    m = int(input())
    if is_definitely_prime(m):
        answer = answer + 1
print(answer)
n, m = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(n)]

if m == 0:
    print(0)
else:
    ans = 0
    for i in range(8):
        a = []
        for z in x:
            r = 0
            for j in range(3):
                r += z[j] * (1 if i&2**j == 0 else -1)
            a.append(r)
        a.sort(reverse=True)
        ans = max(ans, sum(a[:m]))
print(ans)


### FIXED CODE ###

n, m = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(n)]

if m == 0:
    ans = 0
else:
    ans = 0
    for i in range(8):
        a = []
        for z in x:
            r = 0
            for j in range(3):
                r += z[j] * (1 if i&1<<j == 0 else -1)
            a.append(r)
        a.sort(reverse=True)
        ans = max(ans, sum(a[:m]))
print(ans)
import sys

input = sys.stdin.readline

d = []
ABC = []


sys.setrecursionlimit(10 ** 5 + 1)
def solve(i, dis):
    global d
    global ABC
    d[i] = dis

    for n, c in ABC[i]:
        if d[n] == -1:
            solve(n, dis + c)


def main():
    N = int(input())
    global ABC
    ABC = [[] for _ in range(N + 1)]
    global d
    d = [-1] * (N + 2)
    for _ in range(N - 1):
        a, b, c = [int(x) for x in input().split()]
        ABC[a - 1].append([b - 1, c])
        ABC[b - 1].append([a - 1, c])

    Q, K = [int(x) for x in input().split()]

    solve(K - 1, 0)

    for _ in range(Q):
        x, y = [int(x) for x in input().split()]
        print(d[x - 1] + d[y - 1])


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys

input = sys.stdin.readline

d = []
ABC = []

sys.setrecursionlimit(10 ** 8)


def solve(i, dis):
    global d
    global ABC
    d[i] = dis

    for n, c in ABC[i]:
        if d[n] == -1:
            solve(n, dis + c)


def main():
    N = int(input())
    global ABC
    ABC = [[] for _ in range(N + 1)]
    global d
    d = [-1] * (N + 2)
    for _ in range(N - 1):
        a, b, c = [int(x) for x in input().split()]
        ABC[a - 1].append([b - 1, c])
        ABC[b - 1].append([a - 1, c])

    Q, K = [int(x) for x in input().split()]

    solve(K - 1, 0)

    for _ in range(Q):
        x, y = [int(x) for x in input().split()]
        print(d[x - 1] + d[y - 1])


if __name__ == '__main__':
    main()
def judge():
    count = 0
    flag = True
    for _ in range(n):
        d1, d2 = map(int, input().split(" "))
        if d1 == d2:
            count += 1
        else:
            count = 0
        
        
        if count == 3:
            flag = True
            break
        else:
            flag = False
            pass
    return flag

if judge():
    print("yes")
else:
    print("no")

### FIXED CODE ###

def judge():
    cnt = 0  # 今何連続でゾロ目が出ているか記録しておきます

    for _ in range(N):
        x, y = map(int, input().split())
        if x == y:
            # ゾロ目ストリークが1増えました
            cnt += 1
        else:
            # ゾロ目ストリークが切れました
            cnt = 0

        if cnt == 3:
            # 3連続になった瞬間、return True していいです
            return True

    # ダメでした
    return False

N = int(input())

if judge():
    # judge() で Trueが返ってくるとこっちに進みます
    print("Yes")
else:
    # Falseだとこっちです
    print("No")
a=input()
print(a[0]+str(len([a]-2))+a[-1])

### FIXED CODE ###

a=input()
print(a[0]+str(len(a)-2)+a[-1])
# from math import factorial,sqrt,ceil,gcd
# from itertools import permutations as permus
# from collections import deque,Counter
# import re
# from functools import lru_cache # 簡単メモ化 @lru_cache(maxsize=1000)
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

import numpy as np
# import networkx as nx
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix
# from scipy.special import comb

# slist = "abcdefghijklmnopqrstuvwxyz"
N = int(input())
arrA = np.array(input().split(),dtype=np.int64)
bins = np.array([400,800,1200,1600,2000,2400,2800,3200,4801])
arr = np.digitize(arrA,bins)
ans = np.bincount(arr,minlength=9)
ans1 = len(ans[:-1][ans[:-1]>0])
ans2 = min(ans1 + ans[-1])
if ans1 == 0:
    ans1 = 1
print(ans1,ans2)
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))


### FIXED CODE ###

# from math import factorial,sqrt,ceil,gcd
# from itertools import permutations as permus
# from collections import deque,Counter
# import re
# from functools import lru_cache # 簡単メモ化 @lru_cache(maxsize=1000)
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

import numpy as np
# import networkx as nx
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix
# from scipy.special import comb

# slist = "abcdefghijklmnopqrstuvwxyz"
N = int(input())
arrA = np.array(input().split(),dtype=np.int64)
bins = np.array([400,800,1200,1600,2000,2400,2800,3200,4801])
arr = np.digitize(arrA,bins)
ans = np.bincount(arr,minlength=9)
ans1 = len(ans[:-1][ans[:-1]>0])
ans2 = ans1 + ans[-1]
if ans1 == 0:
    ans1 = 1
print(ans1,ans2)
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))
n, k = map(int, input().split())
s = list(input())

if s[k-1] == 'A':
    s[k-1] = 'a'
elif s[k-1] == 'B'
    s[k-1] = 'b'
else:
    s[k-1] = 'c'

print(''.join(s))

### FIXED CODE ###

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

if s[k-1] == 'A':
    s[k-1] = 'a'
elif s[k-1] == 'B':
    s[k-1] = 'b'
else:
    s[k-1] = 'c'

print(''.join(s))
def solve():
    n, m = map(int, input().split())
    if n >= m:
        return 0
    x = sorted(list(map(int, input().split())))
    diff = sorted([x[i + 1] - x[i] for i in range(m)], reverse=True)
    return sum(diff[n - 1:])


if __name__ == "__main__":
    print(solve())


### FIXED CODE ###

def solve():
    n, m = map(int, input().split())
    x = sorted(list(map(int, input().split())))
    diff = sorted([x[i + 1] - x[i] for i in range(m - 1)], reverse=True)
    return sum(diff[n - 1:])


if __name__ == "__main__":
    print(solve())
N,T = map(int,input().split())
a= [map(int,input().split()) for i in range(N)]
b = []
for i in range(N):
    b.append(a[i][0])
L = sorted(b)
i = 0
while i < N:
    if L[i] < T:
        print(L[i])
        break
    else:
        i = i+1
        continue
if i == N:
    print("TLE")

### FIXED CODE ###

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

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

c = []
t = []

for i in range(N):
    c.append(ct[i][0])
    t.append(ct[i][1])

minc = 10000

for i in range(len(c)):
    if t[i] <= T and c[i] < minc:
        minc = c[i]

if minc == 10000:
    print("TLE")
else:
    print(minc)