Harryxun/stf_run huggingface dataset:
n = int(input())
s_list = []
for _ in range(n):
    s_list.append(input())

ans = 0
head_b = 0
tail_a = 0
headAndTail = 0

for s in s_list:
    if 'AB' in s:
        ans += 1
    if s.startswith('B') and s.endswith('A')::
       headAndTail += 1
    elif s.startswith('B'):
        head_b += 1
    elif s.endswith('A'):
        tail_a += 1

ans += min([head_b, tail_a])

if head_b == 0 and tail_a == 0:
    ans += max([0,headAndTail-1])
else:
    ans += headAndTail

print(ans)

### FIXED CODE ###

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

ans = 0
head_b = 0
tail_a = 0
headAndTail = 0

for s in s_list:
    ans += s.count('AB')

    if s.startswith('B') and s.endswith('A'):
       headAndTail += 1
    elif s.startswith('B'):
        head_b += 1
    elif s.endswith('A'):
        tail_a += 1

ans += min([head_b, tail_a])

if head_b == 0 and tail_a == 0:
    ans += max([0,headAndTail-1])
else:
    ans += headAndTail

print(ans)
h, a = map(int, input())

print(h // a + int(h%a != 0))


### FIXED CODE ###

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

print(h//a + int(h%a!=0))
n, A, B, C = (int(i) for i in input().split())  #a=1, b=3, c=5, d=7
l = [int(input()) for i in range(n)]
INF = 10 ** 9

def dfs(cur, a, b, c):
    if cur == N:
        return abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) > 0 else INF
    ret0 = dfs(cur + 1, a, b, c)
    ret1 = dfs(cur + 1, a + l[cur], b, c) + 10
    ret2 = dfs(cur + 1, a, b + l[cur], c) + 10
    ret3 = dfs(cur + 1, a, b, c + l[cur]) + 10
    return min(ret0, ret1, ret2, ret3)
    
print(dfs(0, 0, 0, 0))

### FIXED CODE ###

n, A, B, C = (int(i) for i in input().split())  #a=1, b=3, c=5, d=7
l = [int(input()) for i in range(n)]
INF = 10 ** 9

def dfs(cur, a, b, c):
    if cur == n:
        return abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) > 0 else INF
    ret0 = dfs(cur + 1, a, b, c)
    ret1 = dfs(cur + 1, a + l[cur], b, c) + 10
    ret2 = dfs(cur + 1, a, b + l[cur], c) + 10
    ret3 = dfs(cur + 1, a, b, c + l[cur]) + 10
    return min(ret0, ret1, ret2, ret3)
    
print(dfs(0, 0, 0, 0))
N, K = list(map(int, input().strip().split()))
grid = []
k = 0
j = 0
for i in range(N):
	array = list(map(int, input().strip().split()))
	grid.append(array)
for i in range(N):
	if k < K:
		k += grid[i-1][1]
		j += 1
print(str(grid[j][0])[K-k])

### FIXED CODE ###

import numpy as np
N,K = map(int, input().split())
ab = [tuple(map(int, input().split())) for i in range(N)]
ab.sort()
num = 0
for i in range(N):
	num += ab[i][1]
	if num >= K:
		ans = ab[i][0]
		break

print(ans)
num =input()


for i in range(num):
    x = map(float, raw_input().split(' '))

    if (x[0]-x[2])/(x[1]-x[3]) == (x[4]-x[6])/(x[5]-x[7]):
        print 'YES'
    else:
        print 'NO'

### FIXED CODE ###

num =input()


for i in range(num):
    x = map(float, raw_input().split(' '))

    if x[1]-x[3] == 0 or x[5]-x[7] == 0:
        if x[1]-x[3] == 0 and x[5]-x[7] == 0:
            print 'YES'
        else:
            print 'NO'
        
    elif (x[0]-x[2])/(x[1]-x[3]) == (x[4]-x[6])/(x[5]-x[7]):
        print 'YES'
    else:
        print 'NO'
n = int(input())
a=list(map(int,input().split()))
a.sort()
dp = [True for _ in range(a[n-1])]
for val in set(a):
    for i in range(2,a[n-1],i):
        dp[i-1]=False
ans = 0
for val in a:
    if dp[val-1] and a.count(val)==1:
        ans+=1
print(ans)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
a.sort()
dp=[True]*a[-1]
def hantei(i):
    ans = True
    if i!=n-1:
        if a[i]==a[i+1]: ans = False
    if i!=0:
        if a[i]==a[i-1]: ans=False
    return ans
for val in set(a):
    for i in range(2*val,a[-1]+1,val): dp[i-1]=False
ans=0
for i in range(n):
    if dp[a[i]-1] and hantei(i)==1: ans+=1
print(ans)
N, M = map(int, input().split())
ab = [tuple(map(int, input().split())) for _ in range(M)]

class UnionFind:
    def __init__(self, size):
        self.rank = [-1]*(size+1)
        self.number = [1]*(size+1)
        
    def find(self, x):
        while self.rank[x] >= 0:
            x = self.rank[x]
        return x
    
    def union(self, a, b):
        if a == b:
            return
        if self.rank[a] == self.rank[b]:
            self.rank[b] = a
            self.rank[a] -= 1
            self.number[a] += self.number[b]
        elif self.rank[a] < self.rank[b]:
            self.rank[b] = a
            self.number[a] += self.number[b]
        else:
            self.rank[a] = b
            self.number[b] += sekf.number[a]
            
p = N * (N - 1) // 2
ans = [p]
uf = UnionFind(N)

for a, b in ab[::-1]:
    ar = uf.find(a)
    br = uf.find(b)
    
    if ar != br:
        p -= uf.number[ar] * uf.number[br]
        uf.union(ar, br)
    ans.append(p)

print(*ans[::-1], sep='\n')

### FIXED CODE ###

N, M = map(int, input().split())
ab = [tuple(map(int, input().split())) for _ in range(M)]

class UnionFind:
    def __init__(self, size):
        self.rank = [-1]*(size+1)
        self.number = [1]*(size+1)
        
    def find(self, x):
        while self.rank[x] >= 0:
            x = self.rank[x]
        return x
    
    def union(self, a, b):
        if a == b:
            return
        if self.rank[a] == self.rank[b]:
            self.rank[b] = a
            self.rank[a] -= 1
            self.number[a] += self.number[b]
        elif self.rank[a] < self.rank[b]:
            self.rank[b] = a
            self.number[a] += self.number[b]
        else:
            self.rank[a] = b
            self.number[b] += self.number[a]
            
p = N * (N - 1) // 2
ans = [p]
uf = UnionFind(N)

for a, b in ab[::-1]:
    ar = uf.find(a)
    br = uf.find(b)
    
    if ar != br:
        p -= uf.number[ar] * uf.number[br]
        uf.union(ar, br)
    ans.append(p)

print(*ans[::-1][1:], sep='\n')
import numpy as np
N=int(input())
a=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
A=np.zeros(11,dtype=int)
for i in range(11):
  A[i]=(26**(i+1))
B=np.cumsum(A)
for i in range(11):
  if N<=B[i]:
    name=[" "]*(i+1)
    if i==0:
      N=N
    else:
      N-B[i-1]
    for j in reversed(range(i+1)):
      if j>=1:
        name[i-j]=a[N//A[j-1]-1]
        N-=N//A[j-1]*A[j-1]
      else:
        name[i-j]=a[N-1]
    break

print(''.join(name))

### FIXED CODE ###

import numpy as np
N=int(input())
a=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
A=np.zeros(11,dtype=int)
for i in range(11):
  A[i]=(26**(i+1))
B=np.cumsum(A)
for i in range(11):
  if N<=B[i]:
    name=[" "]*(i+1)
    if i==0:
      N=N
    else:
      N-=B[i-1]
    for j in reversed(range(i+1)):
      if j>=1:
        if N==0:
          name[i-j]="z"
        else:
          name[i-j]=a[(N-1)//A[j-1]]
        N-=N//A[j-1]*A[j-1]
      else:
        if N==0:
          name[i-j]="z"
        else:
          name[i-j]=a[N-1]
    break

print(''.join(name))
import collections


n = int(input())
v = list(map(int, input().split()))
odd = []
even = []
for i in range(int(n/2)):
    even.append(v[2*i])
    odd.append(v[2*i + 1])
evencount = collections.Counter(even)
oddcount = collections.Counter(odd)


def hoge(i):
    global ans
    try:
        if evencount.most_common()[i][0] == oddcount.most_common()[i][0]:

            if evencount.most_common()[i][1] > oddcount.most_common()[i][1]:
                ans = n - evencount.most_common()[i][1] - oddcount.most_common()[i][1]
                print(ans)
            elif evencount.most_common()[i][1] < oddcount.most_common()[i][1]:
                ans = n - evencount.most_common()[i][1] - oddcount.most_common()[i][1]
                print(ans)
            else:
                if len(evencount) == 1:
                    ans = int(n/2)
                    print(ans)
                else:
                    hoge(i+1)

        else: 
            ans = n - evencount.most_common()[i][1] - oddcount.most_common()[i][1]
            print(ans)
    except IndexError:   
        ans = n - evencount.most_common()[0][1] - oddcount.most_common()[1][1]
        print(ans) 


hoge(0)

### FIXED CODE ###

import numpy as np

n = int(input())

ans = 0

if n % 10 == 9:
    ans += 1
else:
    ans += 9
n = int(n/10)


if n % 10 == 9:
    ans += 10
else:
    ans += 90
n = int(n/10)
if n % 10 == 9:
    ans += 100
else:
    ans += 900


print(ans)
n = int(input())
max_f = int(n / 4)
max_s = int(n / 7)
switch = 0
for i in range(max_s + 1):
    for j in range(max_f + 1):
        if (7 * i + 4 * j) == n:
            switch = 1
if switch == 1:
    print(Yes)
else:
    print(No)

### FIXED CODE ###

n = int(input())
max_f = int(n / 4)
max_s = int(n / 7)
switch = 0
for i in range(max_s + 1):
    for j in range(max_f + 1):
        if (7 * i + 4 * j) == n:
            switch = 1
if switch == 1:
    print("Yes")
else:
    print("No")
n=int(input())
a=list(map(int,input().split()))
if n%2==1:
    dp=[[0 for j in range(3)] for i in range(n//2)]
    dp[0][0]=a[0]
    dp[0][1]=a[1]
    dp[0][2]=a[2]
    for i in range(n//2-1):
        dp[i+1][0]=(dp[i][0]+a[2*(i+1)])
        dp[i+1][1]=max(dp[i][0],dp[i][1])+a[2*(i+1)+1]
        dp[i+1][2]=max(dp[i])+a[2*(i+2)+2]
    print(max(dp[-1]))
if n%2==0:
    dp=[[0 for j in range(2)] for i in range(n//2)]
    dp[0][0]=a[0]
    dp[0][1]=a[1]
    for i in range(n//2-1):
        dp[i+1][0]=(dp[i][0]+a[2*(i+1)])
        dp[i+1][1]=max(dp[i][0],dp[i][1])+a[2*(i+1)+1]
        #dp[i+1][2]=max(dp[i])+a[2*(i+2)+2]
    print(max(dp[-1]))   

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
if n%2==1:
    dp=[[0 for j in range(3)] for i in range(n//2)]
    dp[0][0]=a[0]
    dp[0][1]=a[1]
    dp[0][2]=a[2]
    for i in range(n//2-1):
        dp[i+1][0]=(dp[i][0]+a[2*(i+1)])
        dp[i+1][1]=max(dp[i][0],dp[i][1])+a[2*(i+1)+1]
        dp[i+1][2]=max(dp[i])+a[2*(i+1)+2]
    print(max(dp[-1]))
if n%2==0:
    dp=[[0 for j in range(2)] for i in range(n//2)]
    dp[0][0]=a[0]
    dp[0][1]=a[1]
    for i in range(n//2-1):
        dp[i+1][0]=(dp[i][0]+a[2*(i+1)])
        dp[i+1][1]=max(dp[i][0],dp[i][1])+a[2*(i+1)+1]
        #dp[i+1][2]=max(dp[i])+a[2*(i+2)+2]
    print(max(dp[-1]))
a, b = [int(c) for c in input().split(" ")]
S = input()
count = 0
for i in range(1, a):
  for j in range(0, a):
      if (j+i <= a+1):
          subStr = S[j:j+i]
          if (len(subStr) == i):
            if (int(subStr) % b == 0):
                count+=1
if (int(S) % b == 0):
    count+=1
print(count)
    

### FIXED CODE ###

code = input()
if (len(set(list(code))) != 1):
  print("Yes")
else:
  print("No")
x, a, b = list(map(int, input().split())
print("a" if abs(x-a) < abs(x-b) else "b")

### FIXED CODE ###

x, a, b = list(map(int, input().split()))
print("A" if abs(x-a) < abs(x-b) else "B")
# 幅優先探索（行きがけ）
import collections
import sys
import copy
import re


def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())


def main():
    N = I()
    ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
    name_roop = []

    level = 1

    ans = ""
    n = 26
    for i in range(10):
        if N > n:
            n += 26**(i+2)
            level += 1
        else:
            break

    for i in range(level, 1, -1):
        count = 0
        a = 26**(i-1)
        for i in range(26):
            N -= a
            count += 1
            if N <= a:
                name_roop.append(count)
                break

    name_roop.append(N)
    for i in name_roop:
        ans += ascii_lowercase[i-1]

    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

# 幅優先探索（行きがけ）
import collections
import sys
import copy
import re


def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())


def main():
    N = I()
    ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
    name_roop = []

    level = 1

    ans = ""
    while N > 0:
        N -= 1
        n = N % 26
        ans += ascii_lowercase[n]
        N //= 26
    print(ans[::-1])
    # for i in range(level, 1, -1):
    #     count = 0
    #     a = 26**(i-1)
    #     for j in range(26):
    #         if N-a > 26**(i-2):
    #             N -= a
    #             count += 1
    #     name_roop.append(count)

    # name_roop.append(N)
    # for i in name_roop:
    #     ans += ascii_lowercase[i-1]
    # print(ans)


if __name__ == '__main__':
    main()
import sys
import collections


def solve():
    readline = sys.stdin.buffer.readline
    h, w = list(map(int, input().rstrip('\n').split()))
    a = [["."] * w for _ in range(h)]
    ql = []
    ql = collections.deque(ql)
    fq = collections.defaultdict(list)
    for i in range(h):
        s = str(readline().rstrip().decode('utf-8'))
        for j in range(w):
            if s[j] == "#":
                a[i][j] = "#"
                ql.append([0, i, j])
                fq[i, j]

    mt = 0
    while True:
        if len(ql) != 0:
            cost, x, y = ql.popleft()
            mt = max(mt, cost)
            for xv, yv in [[x + 1, y], [x - 1, y], [x, y + 1], [x, y - 1]]:
                if 0 <= xv < h and 0 <= yv < w:
                    if (xv, yv) not in fq and a[xv][yv] == ".":
                        ql.append([cost + 1, xv, yv])
                        fq[xv, yv]
        else:
            break
    print(mt)


if __name__ == '__main__':
    solve()


### FIXED CODE ###

import sys
import collections


def solve():
    readline = sys.stdin.buffer.readline
    h, w = list(map(int, readline().split()))
    a = [[True] * w for _ in range(h)]
    ql = collections.deque()
    for i in range(h):
        s = list(str(readline().rstrip().decode('utf-8')))
        for j in range(w):
            if s[j] == "#":
                ql.append([0, i, j])
                a[i][j] = False
    while ql:
        cost, x, y = ql.popleft()
        for xv, yv in ((x + 1, y), (x - 1, y), (x, y + 1), (x, y - 1)):
            if 0 <= xv < h and 0 <= yv < w:
                if a[xv][yv]:
                    ql.append([cost + 1, xv, yv])
                    a[xv][yv] = False
    print(cost)


if __name__ == '__main__':
    solve()
s = sorted(input())
for i in range(len(s)-1):
  if ord(s[i+1])-ord(s[i])>=2:
    print(chr(ord(s[i]+1)))
    break


### FIXED CODE ###

s = set(input())
al = set(list(map(chr, [i for i in range(97, 97+26)])))
print('None' if len(s)==len(al) else min(al-s))
num_str = input()
num_str = num_str.split("")
N = int(num_str[0])
K = int(num_str[2])

S = input()

if S[K-1] == "A":
  S[K-1] = "a"
elif S[K-1] == "B":
  S[K-1] = "b"
elif S[K-1] == "C":
  S[K-1] = "c"
  
print(S)


### FIXED CODE ###

num_str = input().split(" ")
S = input()

N = int(num_str[0])
K = int(num_str[1])
s = list(S)

if s[K-1] == "A":
  s[K-1] = "a"
elif s[K-1] == "B":
  s[K-1] = "b"
elif s[K-1] == "C":
  s[K-1] = "c"

S = "".join(s)
print(S)
N, X, M = map(int, input().split())

rec = []
s = set()
rec.append(X)
s.add(X)
r = X

for i in range(N):
    r = (r**2)%M
    if(r not in s):
        rec.append(r)
        s.add(r)
    else:
        rec.append(r)
        idx = i+1
        break
    
for i in range(len(rec)):
    if(rec[i] == rec[idx]):
        idx1 = i
        break

if(idx1 != idx):       
    ans = sum(rec[:idx1])
    ans += sum(rec[idx1:idx])*((N-idx1)//(idx-idx1))+sum(rec[idx1:(idx1+(N-idx1)%(idx-idx1))])
    print(ans)
else:
    ans = sum(rec[:idx1])
    ans += rec[idx]*(N-idx1)
    print(ans)

### FIXED CODE ###

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

rec = []
s = set()
rec.append(X)
s.add(X)
r = X
idx = -1
idx1 = -1
for i in range(N+1):
    r = (r**2)%M
    if(r not in s):
        rec.append(r)
        s.add(r)
    else:
        rec.append(r)
        idx = i+1
        break
    
for i in range(len(rec)):
    if(rec[i] == rec[idx]):
        idx1 = i
        break

if(idx == -1 or idx1 == -1):
    print(sum(rec[:N]))
elif(idx1 != idx):       
    ans = sum(rec[:idx1])
    ans += sum(rec[idx1:idx])*((N-idx1)//(idx-idx1))+sum(rec[idx1:(idx1+(N-idx1)%(idx-idx1))])
    print(ans)
else:
    ans = sum(rec[:idx1])
    ans += rec[idx]*(N-idx1)
    print(ans)
n, k = map(int, input().split())
A = list(map(int, input().split()))

A = sorted(A)

def cmb(m, n):
    if m - n < n:
        n = m - n
    if n == 0:
        return 1
    if n == 1:
        return m
    
    numerator = [m - n + k + 1 for k in range(n)]
    denominator = [k + 1 for k in range(n)]

    for p in range(2, n+1):
        pivot = denominator[p-1]
        if pivot > 1:
            offset = (m-n) % p
            for k in range(p-1, n, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot
    
    result = 1
    for k in range(n):
        if numerator[k] > 1:
            result *= int(numerator[k])
            
            # mod(10**9+7)
            # result = result % (10**9+7)

    return result

ans = 0
CMB = [[] for _ in range(n)]
for i in range(n):
    if i <= k:
        for j in range(i, k):
            CMB[i].append(cmb(i, j))

for i in range(n):
    if n-i-1 < k-1:
        pass
    else:
        ans -= A[i] * CMB[n-i-1][k-1]
    if i < k-1:
        pass
    else:
        ans += A[i] * cmb[i][k-1]

ans = ans % (10**9 + 7)
print(ans)

### FIXED CODE ###

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

mod = 10**9 + 7

# factorial
factorial = [1,1]
# factorial inverse
factorial_inverse = [1,1]
# inverse for calculation
inverse = [0,1]

for i in range(2, n+1):
    factorial.append((factorial[-1]*i) % mod)
    inverse.append((- inverse[mod % i] * (mod//i)) % mod)
    factorial_inverse.append(factorial_inverse[-1] * inverse[-1] % mod)

def Binominal_theorem(n, k, mod):
    if n < k:
        return 0
    if (n < 0) or (k < 0):
        return 0
    return factorial[n] * factorial_inverse[k] * factorial_inverse[n-k] % mod

ans_min = 0
for i in range(n-k+1):
    ans_min += (A[i] * Binominal_theorem(n-i-1, k-1, mod)) % mod

A = A[::-1]
ans_max = 0
for i in range(n-k+1):
    ans_max += (A[i] * Binominal_theorem(n-i-1, k-1, mod)) % mod

ans = (ans_max - ans_min) % mod
print(ans)
N=input()
print(N**3)


### FIXED CODE ###

N=int(input())
print(N**3)
i = list(map(int, input().split())) 

int a = int(i[0])
int b = int(i[0])

int result_a = a % 2;
int result_b = b % 2;

if(result_a == 0 || result_b == 0){
    print("Even")
}else{
    print("Odd")
}


### FIXED CODE ###

i = list(map(int, input().split())) 

a = int(i[0])
b = int(i[1])

result_a = a % 2
result_b = b % 2

if (result_a == 0 or result_b == 0 ):
    print("Even")
else :
    print("Odd")
S, T = input(), input()

def func(S, T):

    S_2 = S+S
    len_s = len(S)
    merge_S = list(set(S))
    merge_T = list(set(T))
    alp2num = {t: merge_T.index(t) for t in merge_T}
    dis_S = [[-1]*len(merge_T) for _ in range(len_s)]
    pt = S.index(T[0])
    ans = pt+1

    for t in merge_T:
        if t not in merge_S:
            return -1

    for t in T[1:]:
        it = alp2num[t]
        if dis_S[pt][it] == -1:
            dis_S[pt][it] = S_2[pt+1:].index(t) + 1
        ans += dis_S[pt][it]
        pt = (pt + dis_S[pt][it]) % len_s

    return ans

print(func(S,T))


### FIXED CODE ###

S, T = input(), input()

def func(S, T):

    merge_S = list(set(S))
    merge_T = list(set(T))
    for t in merge_T:
        if t not in merge_S:
            return -1

    S_2 = S+S
    len_s = len(S)

    ans = -1

    for t in T:
        ans += S_2[(ans+1)%len_s:].index(t) + 1

    return ans + 1

print(func(S,T))
N=int(input())
if 1000-N%1000>0:
  print(1000-N%1000)
else print(0)

### FIXED CODE ###

N=int(input())
if N%1000>0:
  print(1000-N%1000)
else:
  print(0)
m = int(input())
a = []
sosu = []
import math
def sosuuhantei(x):
    p = x
    if p < 2:
        return False
    elif  n == 2:
        return p
    else:
        for i in range(3,math.floor(math.sqrt(x)) + 1,2):
            if x % i == 0:
                return False
        else:
             sosu.append(x)
            
    


for i in range(55556):
    sosuuhantei(i)
    
import random
print(random.sample(sosu,m))

### FIXED CODE ###

import math
import random
m = int(input())
n = 10000
def sosuuhantei(x):
    p = x
    if p < 2:
        return false
    elif  n == 2:
        return p
    else:
        for i in range(3,math.floor(math.sqrt(x)) + 1,2):
            if x % i == 0:
                return False
        else:
             return x
sosulist = []
 
if n < 2:
    None
elif n == 2:
    sosulist.append(2)
else:
    sosulist.append(2)
    for i in range(3,n+1,2):
        sosulist.append(sosuuhantei(i))
        
while False in sosulist:
    sosulist.remove(False)

s = []
for i in range(len(sosulist)):
    if sosulist[i] % 5 == 1:
        s.append(sosulist[i])

strs = ''
for i in range(m):
    strs = strs + str(s[i]) + ' '
print(strs)
#include <iostream>

using namespace std;

int main() {
  int a, b; cin >> a >> b;
  for (int i = 0; i <= 10000; i++) {
    if ( i*8/100 == a && i*10/100 == b) {
      cout << i << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}

### FIXED CODE ###

def main():
    a, b = map(int, input().split())
    for x in range(1, 100005):
        aa = x * 8 // 100
        bb = x // 10
        if aa == a and bb == b:
            print(x)
            return

    print(-1)

main()
list1 = input()
list1 = list1.split(' ')
S = list1[0]
T = list1[1]
lenS = int(list1[2])
lenT = int(list1[3])
select = list1[4]
if select == S:
    lenS -= 1
else:
    lenT -= 1
print(lenS,lenT)

### FIXED CODE ###

list1 = input()
list2 = input()
list3 = input()
nlist1 = list1.split(' ')
nlist2 = list2.split(' ')
S = nlist1[0]
T = nlist1[1]
lenS = int(nlist2[0])
lenT = int(nlist2[1])
select = list3
if select == S:
    lenS -= 1
elif select == T:
    lenT -= 1
print(lenS,lenT)
from sys import stdin
lines = stdin.readlines()
 
C = str(lines[0])
 
print(chr(ord(C) + 1))

### FIXED CODE ###


C = str(input())

print(chr(ord(C) + 1))
a = int(input())
b = int(input())
c = int(input())

if a==b or b==c or a==c:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

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

c1 = n.count(n[0])
c2 = n.count(n[1])
if c1==2 or c2 == 2:
  print('Yes')
else:
  print("No")
import math

inp = str(input())
m = [x.split() for x in inp]

count = 0
j = 0
for i in inp:
    x, y = i.split()
    if j == 0:
        D = int(y)
        print(D)
    else:
        xx = int(x) ** 2
        yy = int(y) ** 2

        ans = math.sqrt(xx + yy)
        print(ans)

        if ans >= int(D):
            count += 1
    j += 1
print(count)

### FIXED CODE ###

import math

N, D = map(int, input().split())
count = 0
for _ in range(N):
    x, y = map(int, input().split())
    xx = x ** 2
    yy = y ** 2

    ans = math.sqrt(xx + yy)
    if ans <= D:
        count += 1

print(count)
option = int(input())
ref_t, tmp_id = int(input().split())
height = (int(n) for n in input().split())

ave_t = []
for i in range(option):
  ave_t.append(abs(tmp_id - (ref_t - height[i] * 0.06)))

print(ave_t.index(min(ave_t)) + 1)

### FIXED CODE ###

option = int(input())
ref_t, tmp_id = (int(n) for n in input().split())
height = list((int(n) for n in input().split()))

ave_t = []
for i in range(option):
  ave_t.append(abs(tmp_id - (ref_t - height[i] * 0.006)))

print(ave_t.index(min(ave_t)) + 1)
n = input()
s = input()
R = len([e for e in s if e == 'R'])
B = len(s) - R
if R > B:
  return 'Yes'
else:
  return 'No'

### FIXED CODE ###

n = input()
s = input()
R = len([e for e in s if e == 'R'])
B = len(s) - R
if R > B:
  print('Yes')
else:
  print('No')
N = int(input())
m = [0]*N
s = input()
m = s.split()
c = 99999999
k = 0
for i in range(N):
	if m[i] > c:
		c = m[i]
		k +=1

print(c)

### FIXED CODE ###

N = int(input())
m = [0]*N
s = input()
m = s.split()
c = 99999999
k = 0
for i in range(N):
	m[i] = int(m[i])
	if m[i] <= c:
		c = m[i]
		k +=1

print(k)