Harryxun/stf_run huggingface dataset:
import bisect

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

zero_ind=bisect.bisect_left(x,0)
"""
print(max(0,k-zero_ind-1))
print(min(k,n-zero_ind))
print(max(1,k-n+zero_ind-1))
print(min(k+1,zero_ind+2))
"""
v,w=10**9,10**9
if(n-zero_ind >= k):v=abs(x[zero_ind+k-1])
if(zero_ind >= k):w=abs(x[zero_ind-k])

y=[abs(x[zero_ind+i])+abs(x[zero_ind+i]-x[zero_ind-(k-i)+1]) for i in range(max(0,k-zero_ind-1),min(k,n-zero_ind,zero_ind+k-1))]
z=[abs(x[zero_ind-i])+abs(x[zero_ind-i]-x[zero_ind+(k-i)-1]) for i in range(max(1,k-n+zero_ind-1),min(k+1,zero_ind+2,zero_ind+k))]

"""
for i in range(k):
    print(abs(x[zero_ind+i]))
    print(x[zero_ind-(k-i)+1])

for i in range(1,k):
    print(abs(x[zero_ind-i]))
    print(x[zero_ind+(k-i)-1])
"""
print(min([v,w]+y+z))
"""
print(y)
print(z)
"""

### FIXED CODE ###

import bisect

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

zero_ind=bisect.bisect_left(x,0)
"""
print("max",0,k-zero_ind-1)
print("min",k,n-zero_ind)
print("max",1,k-n+zero_ind-1)
print("min",k,zero_ind+2)
"""
v,w=10**9,10**9
if(n-zero_ind >= k):v=abs(x[zero_ind+k-1])
if(zero_ind >= k):w=abs(x[zero_ind-k])

y=[10**9]
z=[10**9]

if(zero_ind != 0 and zero_ind != n):
    for i in range(max(0,k-zero_ind-1),min(k,n-zero_ind)):
        if(zero_ind+i<0 or zero_ind+i>=n or zero_ind-(k-i)+1<0 or zero_ind-(k-i)+1>=n):continue
        y.append(abs(x[zero_ind+i])+abs(x[zero_ind+i]-x[zero_ind-(k-i)+1]))
    for i in range(max(1,k-n+zero_ind-1),min(k,zero_ind+2)):
        if(zero_ind-i<0 or zero_ind-i>=n or zero_ind+(k-i)-1<0 or zero_ind+(k-i)-1>=n):continue
        z.append(abs(x[zero_ind-i])+abs(x[zero_ind-i]-x[zero_ind+(k-i)-1]))
    """
    y=[abs(x[zero_ind+i])+abs(x[zero_ind+i]-x[zero_ind-(k-i)+1]) for i in range(max(0,k-zero_ind-1),min(k,n-zero_ind))]
    z=[abs(x[zero_ind-i])+abs(x[zero_ind-i]-x[zero_ind+(k-i)-1]) for i in range(max(1,k-n+zero_ind-1),min(k,zero_ind+2))]
    """

"""
for i in range(k):
    print(abs(x[zero_ind+i]))
    print(x[zero_ind-(k-i)+1])

for i in range(1,k):
    print(abs(x[zero_ind-i]))
    print(x[zero_ind+(k-i)-1])
"""
print(min([v,w]+y+z))
"""
print(y)
print(z)
"""
N=int(input())
if N.count('7')==0:
  print('No')
  
else:
  print('Yes')

### FIXED CODE ###


N=input()
if N.count('7')==0:
  print('No')
  
else:
  print('Yes')
n = int(input())
a = input().split()
pl = []
sb = []
for i in range(len(a)):
	pl.append(i+int(a[i])+1)
	if i - int(a[i]) > 1:
		sb.append(i-int(a[i])+1)


if len(sb) == 0:
	print('0')
else:

# spl = sorted(pl)
	isb = [int(i) for i in sb]
	ipl = [int(i) for i in pl]
	ssb = sorted(isb)
	t = min(ssb)

	cnt = 0

	for i in ipl:
		for j in ssb:
			if i == j:
				cnt += 1
			if i < j:
				break

print(cnt)

### FIXED CODE ###

n = int(input())
a = input().split()
pl = []
sb = []
for i in range(len(a)):
	pl.append(i+int(a[i])+1)
	if i - int(a[i]) > 0:
		sb.append(i-int(a[i])+1)


if len(sb) == 0:
	print('0')
else:

# spl = sorted(pl)
	isb = [int(i) for i in sb]
	ipl = [int(i) for i in pl]
	ssb = sorted(isb)
	t = min(ssb)
	# tl = [0] * max(ipl)
	tl = [0] * 2000000	
	for i in ssb:
		if int(i)-1 < len(tl):
			tl[int(i)-1] += 1
	# print(pl)
	# print(sb)
	# print(tl)
	cnt = 0
	for i in pl:
		if int(i)-1 < len(tl):
			cnt += tl[int(i)-1]

	print(cnt)
a, b = map(int, input().split())
ans = []

for i in range(1,min(a,b)+1):
    if a%i == 0 and b%i ==0:
        while True:
            for j in range(2,int(math.sqrt(i))+1):
                if i%j==0:
                    break
            else:
                ans.append(i)
            break
            
print(len(ans))
        

### FIXED CODE ###

import collections

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

def trial_division(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

def main():
    a, b = map(int, input().split())
    c = collections.Counter(trial_division(gcd(a, b)))
    print(len(c.keys())+1)

if __name__ == '__main__':
    main()
h,w = map(int,input().split())
l = (h+w)*2
if h%3 == 0 or w%3 == 0:
	print('0')
else:
	a = h
	s = []
	if a%2 == 0:
		d = a/2
		if w%3 == 1:
			b = (w-1)/3
			c = w - b
			s.append(a*b)
			s.append(c*d)
		else:
			b = (w+1)/3
			c = w-b
			s.append(a*b)
			s.append(c*d)
	else:
		d = (a-1)/2
		if w%3 == 1:
			b = (w-1)/3
			c = w - b
			s.append(a*b)
			s.append(c*d)
			s.append(c*(d+1))
		else:
			b = (w+1)/3
			c = w-b
			s.append(a*b)
			s.append(c*d)
			s.append(c*(d+1))
	ans1 = abs(int(max(s)-min(s)))
x = w
w = h
h = x
if h%3 == 0 or w%3 == 0:
	print('0')
else:
	a = h
	k = []
	if a%2 == 0:
		d = a/2
		if w%3 == 1:
			b = (w-1)/3
			c = w - b
			k.append(a*b)
			k.append(c*d)
		else:
			b = (w+1)/3
			c = w-b
			k.append(a*b)
			k.append(c*d)
	else:
		d = (a-1)/2
		if w%3 == 1:
			b = (w-1)/3
			c = w - b
			k.append(a*b)
			k.append(c*d)
			k.append(c*(d+1))
		else:
			b = (w+1)/3
			c = w-b
			k.append(a*b)
			k.append(c*d)
			k.append(c*(d+1))
	ans2 = abs(int(max(k)-min(k)))
if ans1 <= ans2:
	print(ans1)
else:
	print(ans2)

### FIXED CODE ###

h,w = map(int,input().split())
ans = []
if h%3 == 0 or w%3 == 0:
	print('0')
else:
	a = h
	s = []
	if a%2 == 0:
		d = a/2
		if w%3 == 1:
			b = (w-1)/3
			c = w - b
			s.append(a*b)
			s.append(c*d)
		else:
			b = (w+1)/3
			c = w-b
			s.append(a*b)
			s.append(c*d)
	else:
		d = (a-1)/2
		if w%3 == 1:
			b = (w-1)/3
			c = w - b
			s.append(a*b)
			s.append(c*d)
			s.append(c*(d+1))
		else:
			b = (w+1)/3
			c = w-b
			s.append(a*b)
			s.append(c*d)
			s.append(c*(d+1))
	ans.append(abs(int(max(s)-min(s))))
	x = w
	w = h
	h = x
	if h%3 == 0 or w%3 == 0:
		print('0')
	else:
		a = h
		k = []
		if a%2 == 0:
			d = a/2
			if w%3 == 1:
				b = (w-1)/3
				c = w - b
				k.append(a*b)
				k.append(c*d)
			else:
				b = (w+1)/3
				c = w-b
				k.append(a*b)
				k.append(c*d)
		else:
			d = (a-1)/2
			if w%3 == 1:
				b = (w-1)/3
				c = w - b
				k.append(a*b)
				k.append(c*d)
				k.append(c*(d+1))
			else:
				b = (w+1)/3
				c = w-b
				k.append(a*b)
				k.append(c*d)
				k.append(c*(d+1))
		ans.append(abs(int(max(k)-min(k))))
	ans.append(h)
	ans.append(w)
	print(min(ans))
import numpy as np
from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
N=int(input())
tree=np.array([[0]*N for i in range(N)])
for i in range(N-1):
    a,b,c=map(int,input().split(' '))
    tree[a-1][b-1] = c
    tree[b-1][a-1] = c
Q,K=map(int,input().split(' '))
ans = dijkstra(tree,indices=K-1)
for i in range(Q):
    s,e=map(int,input().split(' '))
    print(int(ans[s-1]+ans[e-1]))


### FIXED CODE ###

def main():
    n=input()
    for i,j in zip(n,reversed(n)):
        if i!=j:
            print('No')
            exit()
    print('Yes')

if __name__ == '__main__':
    main()
a=input(a)
b=int(a[0]+a[1])
c=int(a[2]+a[3])
if 1<=b<=12 and 1<=c<=12:
  print("AMBIGUOUS")
elif b>12:
  if c>12:
    print("Na")
  elif 1<=c<=12:
    print("YYMM")
elif c>12:
  if b>12:
    print("Na")
  elif 1<=b<=12:
    print("MMYY")
else:
  print("NA")

### FIXED CODE ###

a=input()
b=int(a[0]+a[1])
c=int(a[2]+a[3])
if 1<=b<=12:
  if 1<=c<=12:
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
  if 1<=c<=12:
    print("YYMM")
  else:
    print("NA")
N=int(input())

print(r**2)

### FIXED CODE ###

r=int(input())

print(int(r**2))
x = map(int,input().split())
i = 0
while (x[i] != 0):
  i+=1
print(i)

### FIXED CODE ###

x = list(map(int,input().split()))
i = 0
while (x[i] != 0):
  i+=1
print(i+1)
from collections import deque
n,k=map(int, input().split())

A = deque(map(int, input().split()))
li = []
li.append(1)

next = 0
t=0
rep = False
for i in range(n):
    li.append(A[next])
    next = A[next]-1

    if A[next] in li:
        t = li.index(A[next])
        rep = True
        break


if rep == True:
    tmp = k%len(li[t:]) - len(li[0:t])
    g=li[t:]
    print(g[tmp])
else:
    print(li[k])

### FIXED CODE ###

from collections import deque
n,k=map(int, input().split())

A = deque(map(int, input().split()))
li = []
li2 = [0]*n
li.append(1)

next = 0

t=0
rep = False

for i in range(k):
    if i == k:
        print(next+1)
        exit()

    if li2[next] == 1:
        t = li.index(next+1)
        rep = True
        li.pop()
        break

    li.append(A[next])
    li2[next] = 1
    next = A[next]-1


tmp = (k-t)%len(li[t:])
print(li[tmp+t])
s = str(input())

j = 0
count = len(s)

s = [_ for _ in s]
for i in range(0, len(s)-1):
    print(j)
    print(s)
    if j+1 <= len(s)-1:
        if s[j] == s[j+1]:
            j = j + 3
            count -= 1
        else:
            j = j + 1
            continue

print(count)


### FIXED CODE ###

s = str(input())

j = 0
count = len(s)

s = [_ for _ in s]
for i in range(0, len(s)-1):
    if j+1 <= len(s)-1:
        if s[j] == s[j+1]:
            j = j + 3
            count -= 1
        else:
            j = j + 1
            continue

print(count)
from string import ascii_letters

def llcs(x, y):
    pm = dict((zip(ascii_letters, [0] * 52)))
    for c in pm:
        for i, xc in enumerate(x):
            if c == xc:
                pm[c] |= (1 << i)
    
    V = (1 << len(x)) - 1
    
    for yc in y:
        V = ((V + (V & pm[yc])) | (V & ~pm[yc]))
    
    ans = bin(V)[-len(x):].count('0')
    
    return ans

from sys import stdin

def solve():
    file_input == stdin
    q = int(file_input.readline())
    for i in range(q):
        s1 = file_input.readline().rstrip()
        s2 = file_input.readline().rstrip()
        print(llcs(s1, s2))

solve()


### FIXED CODE ###

def lcs_len(x, y):
    indices = [0]
    for y_i in y:
        t_index = 0
        for i, index in enumerate(indices, 1):
            c_index = x.find(y_i, t_index) + 1
            if c_index:
                if i < len(indices):
                    t_index = indices[i]
                    indices[i] = min(c_index, t_index)
                else:
                    indices.append(c_index)
                    break
    print(len(indices) - 1)


q = int(input())

for i in range(q):
    ax = input()
    ay = input()
    lcs_len(ax, ay)
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

      
n, q = list(map(lambda x: int(x), input().split()))
uf = UnionFind(n)
for _ in range(q):
    t, u, v = list(map(lambda x: int(x), input().split()))
#     print(uf.parent_indexes)
    if t == 0:
        uf.union(u, v)
        continue
    print('1') if uf.are_in_the_same_group(u, v) else print('0')

### FIXED CODE ###

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n
 
    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
 
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
 
        if x == y:
            return
 
        if self.parents[x] > self.parents[y]:
            x, y = y, x
 
        self.parents[x] += self.parents[y]
        self.parents[y] = x
 
    def size(self, x):
        return -self.parents[self.find(x)]
 
    def same(self, x, y):
        return self.find(x) == self.find(y)
 
    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]
 
    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]
 
    def group_count(self):
        return len(self.roots())
 
    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}
 
      
n, q = list(map(lambda x: int(x), input().split()))
uf = UnionFind(n)
for _ in range(q):
    t, u, v = list(map(lambda x: int(x), input().split()))
#     print(uf.parent_indexes)
    if t == 0:
        uf.union(u, v)
        continue
    print('1') if uf.same(u, v) else print('0')
s = list(input().split())
s.sort()

if s[0] == s[1] and s[0] != s[2] and s[2] == s[3]:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

s = list(input())
s.sort()
if s[0] == s[1] and s[0] != s[2] and s[2] == s[3]:
  print('Yes')
else:
  print('No')
import math
W,a,b = map(int,input().split())
print(max(abs(a-b)-W),0)

### FIXED CODE ###

W,a,b = map(int,input().split())
print(max(abs(a-b)-W,0))
N = int(input())
a = list(map(int, input().split()))

from collections import deque
b = deque([])
if len(a) % 2 == 0:
    for i in range(1, N + 1):
        print(b)
        if i % 2 == 0:
            b.appendleft(a[i - 1])
        else:
            b.append(a[i - 1])
else:
    for i in range(1, N + 1):
        print(b)
        if i % 2 == 0:
            b.append(a[i - 1])
        else:
            b.appendleft(a[i - 1])

print(' '.join([str(i) for i in b]))

### FIXED CODE ###

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

from collections import deque
b = deque([])
if len(a) % 2 == 0:
    for i in range(1, N + 1):
        #print(b)
        if i % 2 == 0:
            b.appendleft(a[i - 1])
        else:
            b.append(a[i - 1])
else:
    for i in range(1, N + 1):
        #print(b)
        if i % 2 == 0:
            b.append(a[i - 1])
        else:
            b.appendleft(a[i - 1])

print(' '.join([str(i) for i in b]))
n = int(input())
h = list(map(int, input().split()))
h = h[::-1]
ans = []
x = 0
for i in range(1,n):
    if h[i-1] <= h[i]:
        x += 1
    else:
        ans.append(x)
        x = 0
print(max(ans))

### FIXED CODE ###

n = int(input())
h = list(map(int, input().split()))
h = h[::-1]
ans = []
x = 0
if n > 1:
    for i in range(1,n):
        if h[i-1] <= h[i]:
            x += 1
        else:
            ans.append(x)
            x = 0
    ans.append(x)
else:
    ans.append(0)
print(max(ans))
import math
a, b, c = map(int, input().split())
for (a % 2 == 0 and b % 2 == 0 and c % 2 == 0):
  if (a == 2 or b == 2 or c == 2):
    break
  a /= 2
  b /= 2
  c /= 2
left = a * b
right = (c - (a + b)) / 2
right = right ** 2
if (left < right):
  print('Yes')
else:
  print('No')


### FIXED CODE ###

a, b, c = map(int, input().split())
left = 4 * a * b
right = c - (a + b)
if (right < 0):
  print('No')
  exit()
right = right ** 2
if (left < right):
  print('Yes')
else:
  print('No')
from collections import deque

h, w = map(int, input().split())

maze = [list(input()) for _ in range(h)]
step = [[0] * w for _ in range(h)]
direction = [[1,0],[-1,0],[0,1],[0,-1]]

def bfs(maze,h,w):
    start = [0,0]
    #キューで座標保存
    q = deque([start])
    while q:
        x, y = q.popleft()
        for d in direction:
            nx = x + d[0]
            ny = y + d[1]
            if 0 <= nx < h and 0 <= ny < w and maze[nx][ny] == "." and step[nx][ny] == 0:
                q.append([nx,ny])
                step[nx][ny] = step[x][y] + 1
        if step[h-1][w-1] != 0:
            return step[h-1][w-1]

#壁の数
wall = 0
for i in maze:
    for j in i:
        if j == "#":
            wall += 1

ans = h * w - wall - (bfs(maze,h,w) + 1)
print(ans)


### FIXED CODE ###

from collections import deque

h, w = map(int, input().split())

maze = [list(input()) for _ in range(h)]
step = [[0] * w for _ in range(h)]
direction = [[1,0],[-1,0],[0,1],[0,-1]]

def bfs(maze,h,w):
    start = [0,0]
    #キューで座標保存
    q = deque([start])
    while q:
        x, y = q.popleft()
        for d in direction:
            nx = x + d[0]
            ny = y + d[1]
            if 0 <= nx < h and 0 <= ny < w and maze[nx][ny] == "." and step[nx][ny] == 0:
                q.append([nx,ny])
                step[nx][ny] = step[x][y] + 1
        if step[h-1][w-1] != 0:
            return step[h-1][w-1]
    return -1

#壁の数
wall = 0
for i in maze:
    for j in i:
        if j == "#":
            wall += 1
if bfs(maze,h,w) >= 0:
    ans = h * w - wall - (bfs(maze,h,w) + 1)
else:
    ans = -1
print(ans)
c = 10**9+7

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

def combinations_count_mod(n, r):
  ret = 1
  for i in range(r):
    ret *= (n-i)/(r-i) % c
  return ret

for i in range(1, k+1):
  a = combinations_count_mod(k-1, i-1) 
  if n-k > i-1:
#    if n-k-i >= 1:
    b = (combinations_count_mod(n-k-1, i-1) * ((n-k-1-(i-1))/i + 2)) 
#    else:
#      b = (n-k-1) * 3
  elif n-k == i-1:
    b = 1
  else:
    b = 0
  print(int((a*b) % c))

### FIXED CODE ###

N = int(input())
AB = [list(map(int, input().split())) for _ in range(N)]
AB.sort(key=lambda x: x[1])
timeSum = 0
for i in AB:
  timeSum += i[0]
  if timeSum > i[1]:
    print("No")
    exit()
print("Yes")
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

N = int(input())
A_list = list(map(int, input().split()))

divided = []
for i in range(N):
    divided.append(A_list.count(i + 1))

ans = 0
for j in divided:
    ans += combinations_count(j, 2)

# print(divided)

for k in range(1, N + 1):
    n = divided[A_list[k - 1] - 1]
    # print(n)
    ans_k = ans
    if n > 1:
        ans_k -= n - 1

    print(int(ans_k))

### FIXED CODE ###

import collections
import math

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

N = int(input())
A_list = list(map(int, input().split()))

counts = collections.Counter(A_list)
ans = 0
for _, v in counts.items():
    # ans += len(list(itertools.combinations(range(v), 2)))
    if v > 1:
        ans += combinations_count(v, 2)

for k in range(1, N + 1):
    n = counts[A_list[k - 1]]
    ans_k = ans
    if n > 1:
        ans_k -= n - 1

    print(int(ans_k))
main(int_list):
  sorted_list = sorted(int_list)
  print str(sorted_list[0]) + ' ' + str(sorted_list[1]) + ' ' + str(sorted_list[2]) + ' ' 

int_list = []
input_string = raw_input()
input_list = raw_input().split(' ')
for i in input_list:
  int_list.append(int(i))

main(int_list)

### FIXED CODE ###

a, b, c = sorted(map(int, raw_input().split()))
print a, b, c
if txt[2] == txt[3] and txt[4] == txt[5]:
    print('Yes')
else :
    print('No')


### FIXED CODE ###

txt = input()

if txt[2] == txt[3] and txt[4] == txt[5]:
    print('Yes')
else :
    print('No')
str = input().split()

r = int(str[0])
D = int(str[1])
x2000 = int(str[2])

for i in range(10):
  print(x2000 = (r*x2000-D))
  

### FIXED CODE ###

str = input().split()

r = int(str[0])
D = int(str[1])
x2000 = int(str[2])

for i in range(10):
  print(r*x2000-D)
  x2000 = r*x2000-D
n,m = map(int,input().split())

li = [[] for i in range(n+1)]
memo = [0 for i in range(m)]

def search(p,y):
    fst = 0
    lst = len(li[p])-1

    while(fst <= lst):
        mid = (fst+lst)//2
        if li[p][mid] == y:
            return mid

        elif li[p][mid] < y:
            fst = mid+1
        
        elif li[p][mid] > y:
            lst = mid-1


for i in range(m):
    p,y=map(int,input().split())
    memo[i] = [p,y]
    li[p].append(y)

for i in range(n):
    li[i].sort()

for i in range(m):
    a = memo[i][0]
    b = search(memo[i][0],memo[i][1])
    print("{:0>6}".format(a),end ="")
    print("{:0>6}".format(b+1))


### FIXED CODE ###

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

li = [[] for i in range(n)]
memo = [0 for i in range(m)]

def search(p,y):
    fst = 0
    lst = len(li[p])-1

    while(fst <= lst):
        mid = (fst+lst)//2
        if li[p][mid] == y:
            return mid

        elif li[p][mid] < y:
            fst = mid+1
        
        elif li[p][mid] > y:
            lst = mid-1


for i in range(m):
    p,y=map(int,input().split())
    p-=1
    memo[i] = [p,y]
    li[p].append(y)

for i in range(n):
    li[i].sort()

for i in range(m):
    a = memo[i][0]+1
    b = search(memo[i][0],memo[i][1])
    print("{:0>6}".format(a),end ="")
    print("{:0>6}".format(b+1))
def find_dex(list,dex):
    for j in range(len(list)):
        if list[j][0] == dex:
            return j
    return 0
n = int(input())
a = np.zeros((10**9))
d = []
left = []
right = []
for i in range(n):
    x,l = map(int, input().split())
    # num , left , right
    left.append([i,x-l+1,x+l-1])
    right.append([i,x-l+1,x+l-1])

left.sort(key=lambda x:x[1],reverse=False)
right.sort(key=lambda x:x[2],reverse=False)

flag = True
p = 10**9 + 1
ans = 0
while len(left) > 0:
    if flag:
        i,l,r = left.pop(-1)
        right.pop(find_dex(right,i))
        flag = False
        if r >= p:
            ans += 1
        p = l

    else:
        i,l,r = right.pop(-1)
        left.pop(find_dex(left,i))
        flag = True
        if r >= p:
            ans += 1
        p = l

    #print(i,l,r)
    #print(left)
    #print(right)

print(n-ans)


### FIXED CODE ###

n = int(input())
d = []
left = []
right = []
for i in range(n):
    x,l = map(int, input().split())
    # num , left , right
    d.append([x-l,x+l])

d.sort()
p = d[0][1]
ans = n
for i in range(1,n):
    if d[i][0] < p:
        ans -= 1
        p = min(p,d[i][1])
    else:
        p = d[i][1]
print(ans)
a =[]

for i in range(3):
    a .append(list(map(int, input().split())))


n = int(input())
b =[]

for i in range(n):
    b.append(int(input()))



flag = 0
cnt = 0
# yoko
for i in range(3):
    for j in range(3):
        if a[i][j] in b:
            cnt += 1
    else:
        if cnt == 3:
            print("Yes")
            flag += 1
            exit()
        else:
            cnt = 0

# tate
if flag == 0:
    for i in range(3):
        for j in range(3):
            if a[j][i] in b:
                cnt += 1

        else:
            if cnt == 3:
                print("Yes")
                flag += 1
                exit()
            else:
                cnt = 0


# ななめ1
if flag == 0:
    for i in range(3):
        if a[i][i] in b:
             cnt += 1
    else:
        if cnt == 3:
            print("Yes")
            flag += 1
            exit()
        else:
            cnt = 0

# ななめ2
if flag == 0:
    if a[3][1] in b and a[2][2] in b and a[1][3] in b:
        print("Yes")
        flag += 1


if flag == 0:
    print("No")


### FIXED CODE ###

a =[]

for i in range(3):
    a .append(list(map(int, input().split())))


n = int(input())
b =[]

for i in range(n):
    b.append(int(input()))



flag = 0
cnt = 0
# yoko
for i in range(3):
    for j in range(3):
        if a[i][j] in b:
            cnt += 1
    else:
        if cnt == 3:
            print("Yes")
            flag += 1
            exit()
        else:
            cnt = 0

# tate
if flag == 0:
    for i in range(3):
        for j in range(3):
            if a[j][i] in b:
                cnt += 1

        else:
            if cnt == 3:
                print("Yes")
                flag += 1
                exit()
            else:
                cnt = 0


# ななめ1
if flag == 0:
    for i in range(3):
        if a[i][i] in b:
             cnt += 1
    else:
        if cnt == 3:
            print("Yes")
            flag += 1
            exit()
        else:
            cnt = 0

# ななめ2
if flag == 0:
    if a[2][0] in b:
        if a[1][1] in b:
            if a[0][2] in b:
                print("Yes")
                flag += 1


if flag == 0:
    print("No")