Harryxun/stf_run huggingface dataset:
N = int(input())
a_i = []
for i in range(N):
    a_i.append(int(input()))

x = []
y = []

if N%2==0:
    for j in range(int(N/2)):
        x.append(max(a_i))
        a_i.remove(max(a_i))
        y.append(max(a_i))
        a_i.remove(max(a_i))

else:
    for j in range(int((N/2)+1)):
        x.append(max(a_i))
        a_i.remove(max(a_i))
        if a_i == []:
            break
        y.append(max(a_i))
        a_i.remove(max(a_i))

X = sum(x)
Y = sum(y)


if X >= Y:
    print(X - Y)

else:
    print(Y - X)

### FIXED CODE ###

N = int(input())
A = int(input())
B = N % 500

if A >= B :
    print('Yes')

else:
    print('No')
n,k = map(int, input().split())
mod = 10**9+7
nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

for i in range(1,k+1):
    a = cmb(n-k+1,i)
    print((a*b)%mod)

### FIXED CODE ###

n,k = map(int, input().split())
mod = 10**9+7
from scipy.misc import comb

for i in range(1,k+1):
    print((comb(n-k+1,i,exact=True)*comb(k-1,i-1,exact=True))%mod)
L, R = map(int, input().split())
if (R - L + 1) >= 2019:
    print(0)
else:
    ans = 10 ** 9 + 7
    for i in range(L, R + 1):
        for j in range(L + 1, R + 1):
            ans = min(ans, i * j % 2019)
print(ans)

### FIXED CODE ###

L, R = map(int, input().split())
mod = 2019
ans = mod
for l in range(L, L + mod + 2):
    for r in reversed(range(R - mod - 2, R + 1)):
        if l >= r:
            break
        ans = min(ans, (l * r) % mod)
print(ans)
S = input()
N = int(input())
ans = S.count("0")
if ans > N:
    ans = N
print(ans)

### FIXED CODE ###

import sys

S = input()
center = len(S) // 2

if len(S) % 2 == 1:
    b = S[center]
    for i in range(1, center + 1):
        if S[center - i] != b or S[center + i] != b:
            print(center + i)
            sys.exit()
else:
    b = S[center - 1]
    for i in range(center):
        if S[center - i - 1] != b or S[center + i] != b:
            print(center + i)
            sys.exit()

print(len(S))
l, n = map(int, input().split())

st = []
for _ in range(n):
  st.append(input())

st.sort()
ans = ''

for s in st:
  ans += s
  
print(ans)


### FIXED CODE ###

N, L = map(int, input().split())
list=[]
for i in range(N):
    list.append(str(input()))
list.sort()
print("".join(list))
import sys
sys.setrecursionlimit=10**12

def modinv(a,m=10**9+7):
    if a==0: return 1
    else:
        b=m
        (x, lastx) = (0, 1)
        (y, lasty) = (1, 0)
        while b != 0:
            q = a // b
            (a, b) = (b, a % b)
            (x, lastx) = (lastx - q * x, x)
            (y, lasty) = (lasty - q * y, y)
        return lastx % m

def cur(p):
    for x in neighbor[p]:
        if x!=par[p]:
            par[x]=p
            cur(x)

def cur1(p):
    for x in neighbor[p]:
        if x!=par[p]:
            descend[p]+=cur1(x)
    return descend[p]

def cur2(p):
    for x in neighbor[p]:
        if x==par[p]: continue
        ans[x]=ans[p]*descend[x]*modinv(n-descend[x])
        ans[x]%=mod
        cur2(x)

mod=10**9+7
n=int(input())
neighbor=[[]  for _ in range(n+1)]
descend=[1]*(n+1)
par=[-1]+[0]*n

for _ in range(n-1):
    a,b=map(int,input().split())
    neighbor[a].append(b)
    neighbor[b].append(a)
cur(1)
sys.exit()
cur1(1)
ans=[1]*(n+1)
ans1=1
for i in range(1,n+1):
    ans1=ans1*i*modinv(descend[i])
    ans1%=mod
ans[1]=ans1

cur2(1)

for i in range(1,n+1):
    print(ans[i])


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

def modinv(a,m=10**9+7):
    if a==0: return 1
    else:
        b=m
        (x, lastx) = (0, 1)
        (y, lasty) = (1, 0)
        while b != 0:
            q = a // b
            (a, b) = (b, a % b)
            (x, lastx) = (lastx - q * x, x)
            (y, lasty) = (lasty - q * y, y)
        return lastx % m

def cur(p):
    if neighbor[p]==[]: return
    for x in neighbor[p]:
        par[x]=p
        neighbor[x].remove(p)
        cur(x)
    descend[par[p]]+=descend[p]

def cur2(p):
    for x in neighbor[p]:
        ans[x]=ans[p]*descend[x]*modinv(n-descend[x])
        ans[x]%=mod
        cur2(x)

mod=10**9+7
n=int(input())
neighbor=[set()  for _ in range(n+2)]
descend=[1 for i in range(n+1)]
par=[0]+[0]*(n+1)

for _ in range(n-1):
    a,b=map(int,input().split())
    neighbor[a].add(b)
    neighbor[b].add(a)

cur(1)


ans=[1]*(n+1)
ans1=1
for i in range(1,n+1):
    ans1=ans1*i*modinv(descend[i])
    ans1%=mod
ans[1]=ans1

cur2(1)

for i in range(1,n+1):
    print(ans[i])
H, W = map(int, input().split())
List = [input() for i in range(H)]
queue = [(0,0,1)]
shape = sum(row.count("#") for row in List)
used = {(0,0)}

def check(x,y,c):
    if x > W-1 or y > H-1 or x < 0 or y < 0:
        return
    if List[y][x] == '#':
        return
    if (x,y) in used:
        return
    queue.append((x,y,c))
    used.add((x,y))
    
f = -1
while queue:
    x,y,c = queue.pop(0)
    if x == W-1 and y == H-1:
        f = 1
        break
    check(x+1, y, c+1)
    check(x,y+1,c+1)
    check(x-1,y,c+1)
    check(x,y-1,c+1)
print(f if f == -1 else(H*W - c - shape))
    

### FIXED CODE ###

N = int(input())
A = int(input())

a = N % 500
if a <= A:
    print("Yes")
else:
    print("No")
import math
n, d = map(int, input().split)
print(math.ceil(n/(2*d+1)))

### FIXED CODE ###

import math
n, d = map(int, input().split())
print(math.ceil(n/(2*d+1)))
n, m = int(input().split())

print((n*(n-1))/2 + ((m*(m-1))/2)

### FIXED CODE ###

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

print(int((n*(n-1))/2 + ((m*(m-1))/2)))
import itertools
N = int(input())
A = [int(x) for x in input().split()]
B = list(range(1,N+1))

def test(i,j):
  AA = A.copy()
  AA[i], AA[j] = AA[j], AA[i]
  return AA == B

bl = (A == B)
for i,j in itertools.combinations(range(N)):
  if test(i,j):
    bl = True
answer = 'YES' if bl else 'NO'
print(answer)


### FIXED CODE ###

import itertools
N = int(input())
A = [int(x) for x in input().split()]
B = list(range(1,N+1))

def test(i,j):
  AA = A.copy()
  AA[i], AA[j] = AA[j], AA[i]
  return AA == B

bl = (A == B)
for i,j in itertools.combinations(range(N),2):
  if test(i,j):
    bl = True
answer = 'YES' if bl else 'NO'
print(answer)
inputa = input().split()
inputa[0] = int(inputa[0])
inputa[1] = int(inputa[1])
tempa = []
tempb = float(inputa[1])
tempc = []
res = float(0)
if tempb == 1:
  print(1)
  exit()
while tempb > 1:
  if tempb <= inputa[0]:
    tempa.append(inputa[0] - tempb + 1)
  else:
    tempa.append(0)
    
  tempb /= 2

i = 1
tempc.append(tempa[0])
while i <= len(tempa):
  tempc.append(tempa[i] - tempa[i - 1])
  i += 1

for i, num in enumerate(tempc):
  res += num / inputa[0] / (2 ** i)

print(res)

### FIXED CODE ###

import math
inputa = input().split()
inputa[0] = int(inputa[0])
inputa[1] = int(inputa[1])
tempa = []
tempb = float(inputa[1])
tempc = []
res = float(0)
if tempb == 1:
	print(1)
	exit()
while tempb >= 0.5:
	#print(tempb)
	if tempb <= inputa[0]:
		tempa.append(math.floor(inputa[0] - tempb + 1))
	else:
		tempa.append(0)
	tempb /= 2

i = 1
tempc.append(tempa[0])
#print(tempa)
while i < len(tempa):
	tempc.append(tempa[i] - tempa[i - 1])
	i += 1
#print(tempc)
for i, num in enumerate(tempc):
	#print(num / inputa[0] / (2 ** i))
	res += num / inputa[0] / (2 ** i)

print(res)
import sys
input = sys.stdin.readline

N, K = map(int, input().split())
A = list(map(int, input().split()))
L = 50
dp = [[-10**18]*2 for _ in range(L+1)]
dp[0][0] = 0

for i in range(L):
    Ki = (K>>(L-1-i))&1
    
    for j in range(2):
        for k in range(2 if j else Ki+1):
            add = 0
            
            for Ai in A:
                add += k^((Ai>>(L-1-i))&1)
            
            dp[i+1][j|(k<Ki)] = max(dp[i+1][j|(k<Ki)], dp[i][j]+add*2**(L-1-i))

ans = max(dp[L])

if N*K>10**6:
    exit()
    
ans2 = 0

for i in range(K+1):
    ans2 = max(ans2, sum(i^Ai for Ai in A))
    
if ans!=ans2:
    1/0


### FIXED CODE ###

import sys
input = sys.stdin.readline

N, K = map(int, input().split())
A = list(map(int, input().split()))
L = 100
dp = [[-float('inf')]*2 for _ in range(L+1)]
dp[0][0] = 0

for i in range(L):
    Ki = (K>>(L-1-i))&1
    
    for j in range(2):
        for k in range(2 if j else Ki+1):
            add = 0
            
            for Ai in A:
                add += k^((Ai>>(L-1-i))&1)
            
            dp[i+1][j|(k<Ki)] = max(dp[i+1][j|(k<Ki)], dp[i][j]+add*2**(L-1-i))
            
print(max(dp[L]))
n,k=map(int,input().split())
l=list(input())
s=l[0]
m=0
c=0
for i in range(1,n):
  if l[i]!=s:
    c+=1
    s=l[i]
if (c%2==0 and c//2<=k):
  print(n-1)
if (c%2==1 and c//2<k):
  print(n-1)
else:
  for i in range(1,n-1):
    if l[i]=="R" and l[i-1]=="R":
      m+=1   
    elif l[i]=="R" and l[i-1]=="L":
      pass
    elif l[i]=="L" and l[i-1]=="R":
      pass
    else:
      m+=1
  if l[-1]==l[-2] and l[-2]=="R":
    m+=1
  elif l[-1]==l[-2] and l[-2]=="L":
    m+=1
  print(m+k*2)

### FIXED CODE ###

n,k=map(int,input().split())
l=list(input())
s=l[0]
m=0
c=1
for i in range(1,n):
  if l[i]!=s:
    c+=1
    s=l[i]
if c//2<=k:
  print(n-1)
else:
  for i in range(1,n-1):
    if l[i]=="R":
      if l[i+1]=="R":
        m+=1
    if l[i]=="L":
      if l[i-1]=="L":
        m+=1
  if l[0]=="R" and l[0]==l[1]:
    m+=1
  if l[-1]=="L" and l[-2]==l[-1]:
    m+=1
  print(m+k*2)
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#

"""
tenka1-2018 E
"""

from itertools import product
from itertools import combinations

h, w = map(int, input().split())
slili = [list(input()) for i in range(h)]

coinsetli = [set() for i in range(h+w)]
for i, j in product(range(h), range(w)):
    if slili[i][j] == '#':
        coinsetli[i+j+1].add(j-i)

coinacumdictli = [{} for i in range(h+w)]
for i in range(1, h+w):
    tmp = 0
    for j in range(-300, 301):
        if j in coinsetli[i]:
            tmp += 1
        coinacumdictli[i][j] = tmp

ansdouble = 0
for i in range(1, h+w):
    for x, y in combinations(coinsetli[i], 2):
        j = abs(x-y)
        x, y = (min(x, y), max(x, y))
        if i-j >= 1:
            ansdouble += coinacumdictli[i-j][y]+coinacumdictli[i-j][y-1] - coinacumdictli[i-j][x] - coinacumdictli[i-j][x-1]
        if i+j <= h+w-1:
            ansdouble += coinacumdictli[i+j][y]+coinacumdictli[i+j][y-1] - coinacumdictli[i+j][x] - coinacumdictli[i+j][x-1]

# repeat after reversing along the vertical axis
for i in range(h):
    slili[i].reverse()

coinsetli = [set() for i in range(h+w)]
for i, j in product(range(h), range(w)):
    if slili[i][j] == '#':
        coinsetli[i+j+1].add(j-i)

coinacumdictli = [{} for i in range(h+w)]
for i in range(1, h+w):
    tmp = 0
    for j in range(-300, 301):
        if j in coinsetli[i]:
            tmp += 1
        coinacumdictli[i][j] = tmp

for i in range(1, h+w):
    for x, y in combinations(coinsetli[i], 2):
        j = abs(x-y)
        x, y = (min(x, y), max(x, y))
        if i-j >= 1:
            ansdouble += coinacumdictli[i-j][y]+coinacumdictli[i-j][y-1] - coinacumdictli[i-j][x] - coinacumdictli[i-j][x-1]
        if i+j <= h+w-1:
            ansdouble += coinacumdictli[i+j][y]+coinacumdictli[i+j][y-1] - coinacumdictli[i+j][x] - coinacumdictli[i+j][x-1]

print(ansdouble//2)


### FIXED CODE ###

#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#

"""
Tenka1-2018 C
"""

n = int(input())
ali = [int(input()) for i in range(n)]
ali.sort()

if n % 2 is 1:
    m = (n-1)//2
    am = ali[m]
    asmall = ali[:m]
    abig = ali[m+1:]
    if 2*am-asmall[-1]-abig[0] > 0:
        ans = am-2*sum(asmall)+2*sum(abig)-abig[0]
    else:
        ans = -am+2*sum(abig)-2*sum(asmall)+asmall[-1]
else:
    m = n//2
    asmall = ali[:m]
    abig = ali[m:]
    ans = -2*sum(asmall)+2*sum(abig)-abig[0]+asmall[-1]

print(ans)
R = lambda: map(int, input().split())
R()
a = [0] * 100001
s = 0
for x in R():
  s += x
  a[x] += 1
q, = R()
for _ in range(q):
  b, c = R()
  s += (c - b) * a[b]
  print(s)
  a[c]+=d[b]
  a[b] = 0


### FIXED CODE ###

from collections import Counter

R = lambda: map(int, input().split())
R()
d = Counter(R())
s = sum(d.elements())
q, = R()
for _ in range(q):
  b, c = R()
  s += (c - b) * d[b]
  print(s)
  d[c]+=d[b]
  d[b] = 0
N = int(input())
A = [int(x) for x in input().split()]
A.sort()
for i in range(1, len(A)):
    if A[i - 1] != A[i]:
        continue
        k = True
    else:
        k = False
        break

if k:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

N = int(input())
A = [int(x) for x in input().split()]
A.sort()
for i in range(1, len(A)):
    if A[i - 1] != A[i]:
        k = True
    else:
        k = False
        break

if k:
    print("YES")
else:
    print("NO")
lis=[]
lis.append(input())

while True:
    inp=input()
    if inp==0:
        print lis[-1]
        del lis[-1]
    else:
        lis.append(inp)

### FIXED CODE ###

import sys
import sys

a = []
for line in sys.stdin:
    a.append(line)

lis=[]
for n in a:
    inp=int(n)
    if inp==0:
        print lis[-1]
        del lis[-1]
    else:
        lis.append(inp)
W, H, N = map(int,input().split())

Wmin = 0
Wmax = W
Hmin = 0
Hmax = H

for i in range(N):
    x, y, z = map(int,input().split())
    if z == 1:
        Wmin = x
    if z == 2:
        Wmax = x
    if z == 3:
        Hmin = y
    if z == 4:
        Hmax = y

print(min((Wmax-Wmin)*(Hmax-Hmin)), 0)

### FIXED CODE ###

W, H, N = map(int,input().split())

Wmin = 0
Wmax = W
Hmin = 0
Hmax = H

for i in range(N):
    x, y, z = map(int,input().split())
    if z == 1:
        Wmin = max(x, Wmin)
    if z == 2:
        Wmax = min(x, Wmax)
    if z == 3:
        Hmin = max(y, Hmin)
    if z == 4:
        Hmax = min(y, Hmax)
if Wmax < Wmin or  Hmax < Hmin:
    print(0)
else:
    print((Wmax-Wmin)*(Hmax-Hmin))
import sys

def plus_and_check(list):
    sum_up = sum(list)
    return len(str(sum_up))

a = []
for line in sys.stdin:
    a.append(map(iny, raw_input().split()))

answer = []
for i in range(len(a)):
    answer = plus_and_check(l)

for i in range(len(answer)):
    print answer[i]

### FIXED CODE ###

import sys

a = []
answer_array = []
for line in sys.stdin:
    a.append(map(int, line.strip().split()))
    #except StopIteration:
        #break

for i in range(len(a)):
    sum_up = a[i][0] + a[i][1]

    answer = len(str(sum_up))

    answer_array.append(answer)

for j in range(len(answer_array)):
    print answer_array[j]
# coding: utf-8
from collections import defaultdict, deque


def popcount(x):
    assert x.bit_length() <= 32
    x -= (x >> 1) & 0x55555555
    x = (x & 0x33333333) + ((x >> 2) & 0x33333333)
    x = (x + (x >> 4)) & 0x0f0f0f0f
    x += x >> 8
    x += x >> 16
    return x & 0x3f


def solve(*args: str) -> str:
    n = int(args[0])
    x = args[1]

    ret = []
    dp = defaultdict(int)
    x_count = x.count('1')
    x_dec = int(x, 2)

    x_mod_set = x_dec % (x_count+1)
    x_mod_reset = x_dec % (x_count-1)
    xor_set = 1 % (x_count+1)
    xor_reset = 1 % (x_count-1)
    for i in range(n):
        bitcount = x_count + (1 if x[-1-i] == '0' else -1)
        if bitcount == 0:
            ret.append(0)
            continue

        m = (x_mod_set + xor_set
             if x[-1-i] == '0' else
             x_mod_reset - xor_reset) % bitcount
        deq = deque([m])

        count = 1
        while m:
            deq.append(m)
            if 0 < dp[m]:
                count += dp[m]
                break

            m = m % popcount(m)
            count += 1

        ret.append(str(count))

        while deq:
            dp[deq.popleft()] = count
            count -= 1

        xor_set = (xor_set << 1) % (x_count+1)
        xor_reset = (xor_reset << 1) % (x_count-1)

    return '\n'.join(ret[::-1])


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))


### FIXED CODE ###

# coding: utf-8
from collections import defaultdict, deque


def popcount(x):
    assert x.bit_length() <= 32
    x -= (x >> 1) & 0x55555555
    x = (x & 0x33333333) + ((x >> 2) & 0x33333333)
    x = (x + (x >> 4)) & 0x0f0f0f0f
    x += x >> 8
    x += x >> 16
    return x & 0x3f


def solve(*args: str) -> str:
    n = int(args[0])
    x = args[1]

    ret = []
    dp = defaultdict(int)
    x_count = x.count('1')
    x_dec = int(x, 2)

    x_mod_set = x_dec % (x_count+1)
    xor_set = 1 % (x_count+1)
    if 1 < x_count:
        x_mod_reset = x_dec % (x_count-1)
        xor_reset = 1 % (x_count-1)

    for i in range(n):
        bitcount = x_count + (1 if x[-1-i] == '0' else -1)
        if bitcount == 0:
            ret.append(str(0))
            continue

        m = (x_mod_set + xor_set
             if x[-1-i] == '0' else
             x_mod_reset - xor_reset) % bitcount
        deq = deque([m])

        count = 1
        while m:
            deq.append(m)
            if 0 < dp[m]:
                count += dp[m]
                break

            m = m % popcount(m)
            count += 1

        ret.append(str(count))

        while deq:
            dp[deq.popleft()] = count
            count -= 1

        xor_set = (xor_set << 1) % (x_count+1)
        if 1 < x_count:
            xor_reset = (xor_reset << 1) % (x_count-1)

    return '\n'.join(ret[::-1])


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))
s = input()
q = int(input())
for i in range(q):
  n = int(input())
  if n == 1:
    s = s[::-1]
  else:
    f,c = input().split()
    if int(f) == 1:
      s = c + s
    else:
      s = s + c
print(s)
    


### FIXED CODE ###

s=input()
q=int(input())
head=[]
tail=[]
rev=False
for _ in range(q):
  tmp=list(input().split())
  if tmp[0]=='1':
    if rev==False:
      rev=True
    else:
      rev=False
  if tmp[0]=='2':
    if rev==False:
      if tmp[1]=='1':
        head.append(tmp[2])
      if tmp[1]=='2':
        tail.append(tmp[2])
    if rev==True:
      if tmp[1]=='1':
        tail.append(tmp[2])
      if tmp[1]=='2':
        head.append(tmp[2])
head=''.join(map(str,head))
tail=''.join(map(str,tail))
ans=head[::-1]+s+tail
if rev==True:
  ans=ans[::-1]
print(ans)
from collections import deque
import numpy as np
import sys

H, W = map(int, input().split())

Map = [[] for _ in range(H)]
reached = [[False]*W for _ in range(H)]
q = deque()
cnt = 0
count = 0
tempList = []
for y in range(H):
    for i, x in enumerate(input()):
        Map[y].append(x)
        if x=="#":
            reached[y][i] = True
            if i + 1 < W and not reached[y][i + 1]:
                tempList.append((i + 1, y))

            if i - 1 >= 0 and not reached[y][i - 1]:
                tempList.append((i - 1, y))

            if y + 1 < H and not reached[y + 1][i]:
                tempList.append((i, y + 1))

            if y - 1 >= 0 and not reached[y - 1][i]:
                tempList.append((i, y - 1))

q.append(tempList)

def BFS(blist):
    global count
    tList = []

    count += 1

    for (x, y) in blist:
        reached[y][x] = True
        Map[y][x] = "#"
        if x+1<W and not reached[y][x + 1]:
            tList.append((x + 1, y))

        if x-1>=0 and not reached[y][x - 1]:
            tList.append((x - 1, y))

        if y+1<H and not reached[y + 1][x]:
            tList.append((x, y + 1))

        if y-1>=0 and not reached[y - 1][x]:
            tList.append((x, y - 1))

    if np.array(reached).all():
        print(count)
        sys.exit()

    q.append(tList)

while q:
    BFS(q.popleft())













### FIXED CODE ###

from collections import deque

H, W = map(int, input().split())

Map = [[] for _ in range(H)]
reached = [[False] * W for _ in range(H)]
q = deque()
cnt = 0
count = 0
tempList = []
for y in range(H):
    for i, x in enumerate(input()):
        Map[y].append(x)
        if x == "#":
            cnt += 1
            reached[y][i] = True
            if i + 1 < W and not reached[y][i + 1]:
                reached[y][i + 1] = True
                tempList.append((i + 1, y))

            if i > 0 and not reached[y][i - 1]:
                reached[y][i - 1] = True
                tempList.append((i - 1, y))

            if y + 1 < H and not reached[y + 1][i]:
                reached[y + 1][i] = True
                tempList.append((i, y + 1))

            if y > 0 and not reached[y - 1][i]:
                reached[y - 1][i] = True
                tempList.append((i, y - 1))
if cnt==H*W:
    print(0)
    exit()

q.append(tempList)


def BFS(blist):
    global count
    tList = []

    count += 1

    for (x, y) in blist:
        if x+1<W and not reached[y][x + 1]:
            reached[y][x + 1] = True
            tList.append((x + 1, y))

        if x-1>=0 and not reached[y][x - 1]:
            reached[y][x - 1] = True
            tList.append((x - 1, y))

        if y+1<H and not reached[y + 1][x]:
            reached[y + 1][x] = True
            tList.append((x, y + 1))

        if y-1>=0 and not reached[y - 1][x]:
            reached[y - 1][x] = True
            tList.append((x, y - 1))

    if tList:
        q.append(tList)


while q:
    BFS(q.popleft())

print(count)
n=int(input())
l=[0]*n+1
l[0]=2
l[1]=1

for i in range(2,n+2):
  l[i]=l[i-1]+l[i-2]
print(l[n+1])

### FIXED CODE ###

n=int(input())
l=[0]*(n+1)
l[0]=2
l[1]=1

for i in range(2,n+1):
  l[i]=l[i-1]+l[i-2]
print(l[n])
N=int(input())
A=list(list(map(int,input().split()))
ans=0
hoge=0
for i in range(N-1):
  if A[i] >A[i+1]:
    hoge+=1
    ans=max(ans,hoge)
    else:
       hoge=0
print(ans)


### FIXED CODE ###

N = int(input())
H = list(map(int,input().split()))
ans = 0
x = 0
for i in range(N-1):
  if H[i] >= H[i+1]:
    x += 1
    ans = max(ans,x)
  else:
    x = 0
print(ans)
import math
N,K = map(int, input().split())
M = (N-1)*(N-2)//2
if K > M:
    print(-1)
    exit()

print(N-1+M-K)
for i in range(2,N+1):
    print(1,i)
s = 2
d = 3
for i in range(M-K):
    print(s,d)
    d+=1
    if d > n:
        s+=1
        d = s+1

### FIXED CODE ###

import math
N,K = map(int, input().split())
M = (N-1)*(N-2)//2
if K > M:
    print(-1)
    exit()

print(N-1+M-K)
for i in range(2,N+1):
    print(1,i)
s = 2
d = 3
for i in range(M-K):
    print(s,d)
    d+=1
    if d > N:
        s+=1
        d = s+1
s=input()
t=input()
ans=0
for i in range(len(s)):
  if s[i]=t[i]:
    ans+=1
print(ans)

### FIXED CODE ###

s=input()
t=input()
ans=0
for i in range(len(s)):
  if s[i]==t[i]:
    ans+=1
print(ans)