Harryxun/stf_run huggingface dataset:
N = int(input())
name_list = [input() for name in range(N)]
char_list = ['M', 'A', 'R', 'C', 'H']
count_list = [0 for _ in range(N)]

for name in name_list:
    if name[0] in char_list:
        count_list[char_list.index(name[0])] += 1
score=0
for x in range(len(count_list)):
    for y in range(x+1,len(count_list)):
        for z in range(y+1,len(count_list)):
            score+=count_list[x]*count_list[y]*count_list[z]

print(score)


### FIXED CODE ###

N = int(input())
name_list = [input() for name in range(N)]
char_list = ['M', 'A', 'R', 'C', 'H']
count_list = [0 for _ in range(len(char_list))]

flag = False

for name in name_list:
    if name[0] in char_list:
        count_list[char_list.index(name[0])] += 1
score = 0
for x in range(5):
    for y in range(x + 1, 5):
        for z in range(y + 1, 5):
            score += count_list[x] * count_list[y] * count_list[z]

print(score)
n, m = map(int, raw_input().split())

f = dict()
for i in range(m):
    a, b = map(int, raw_input().split())
    f[a] = b

if m == 1:
    print("IMPOSSIBLE")
    exit()

for k, v in f.iteritems():
    if k == 1:
        if f[v] == n:
            print("POSSIBLE")
            exit()
print("IMPOSSIBLE")

### FIXED CODE ###

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

f = dict()
for i in range(m):
    a, b = map(int, raw_input().split())
    if a in f:
        f[a].append(b)
    else:
        f[a] = [b]
if m < 2:
    print("IMPOSSIBLE")
    exit()

for k, v in f.iteritems():
    if k == 1:
        for vv in v:
            if vv not in f:
                continue
            if n in f[vv]:
                print("POSSIBLE")
                exit()
print("IMPOSSIBLE")
while True:
    h, w = map(int, input().split())
    if h == 0: break

    for i in range(h)
        for j in range(w)
            if (i+j) % 2 == 0 : print("#")
            else : print(".")
        print() 


### FIXED CODE ###


while True:
    h, w = map(int, input().split())
    if h == 0: break

    for i in range(h):
        for j in range(w):
            if (i+j) % 2 == 0 : print("#",end="")
            else : print(".",end="")
        print() 
    print()
import sys
input = sys.stdin.readline
from collections import *
from math import gcd

N = int(input())
cnt = defaultdict(int)
abzero = 0
azero = 0
bzero = 0

for _ in range(N):
    A, B = map(int, input().split())
    
    if A==0 and B==0:
        abzero += 1
    elif A==0:
        azero += 1
    elif B==0:
        bzero += 1
        
    G = gcd(abs(A), abs(B))
    A //= G
    B //= G
    
    if (A<0 and B>0) or (A<0 and B<0):
        A *= -1
        B *= -1
    
    cnt[(A, B)] += 1


### FIXED CODE ###

import sys
input = sys.stdin.readline
from collections import *

def gcd(a, b):
    while b:
        a, b = b, a%b
    return a

N = int(input())
zero1 = 0
zero2 = 0
zero3 = 0
cnt = defaultdict(int)
MOD = 10**9+7

for _ in range(N):
    A, B = map(int, input().split())
    
    if A==0 and B==0:
        zero1 += 1
    elif A>0 and B>0:
        G = gcd(A, B)
        A //= G
        B //= G
        cnt[(A, B)] += 1
    elif A>0 and B<0:
        B *= -1
        G = gcd(A, B)
        A //= G
        B //= G
        cnt[(-A, B)] += 1
    elif A<0 and B>0:
        A *= -1
        G = gcd(A, B)
        A //= G
        B //= G
        cnt[(-A, B)] += 1
    elif A<0 and B<0:
        A *= -1
        B *= -1
        G = gcd(A, B)
        A //= G
        B //= G
        cnt[(A, B)] += 1
    elif A==0:
        zero2 += 1
    elif B==0:
        zero3 += 1

s = set()
ans = 1

for k in cnt.keys():
    if k in s:
        continue
    
    k2 = (-k[1], k[0])
    
    if k2[0]<0 and k2[1]<0:
        k2 = (-k2[0], -k2[1])
        
    a = cnt[k]
    
    if k2 not in cnt:
        ans *= pow(2, a, MOD)
        ans %= MOD
    else:
        b = cnt[k2]
        ans *= pow(2, a, MOD)+pow(2, b, MOD)-1
        ans %= MOD
        s.add(k2)

ans *= pow(2, zero2, MOD)+pow(2, zero3, MOD)-1
ans += zero1
ans %= MOD
ans -= 1
ans %= MOD

print(ans)
import math
n, x = map(int, input().split())
cities = list(map(int, input().split()))
cities.append(x)
cities.sort()
 
def get_res(cities):
    if len(cities) < 2:
        return 1
    if len(cities) == 2:
        return cities[1] - cities[0]
    else:
        gcds = []
        for i in range(len(cities) - 2):
            c1 = cities[i]
            c2 = cities[i + 1]
            c3 = cities[i + 2]
            gcds.append(math.gcd(c2 - c1, c3 - c2))
        return min(gcds)


print(get_res(cities))

### FIXED CODE ###

n, x = map(int, input().split())
cities = list(map(int, input().split()))
cities.append(x)
cities.sort()

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def get_res(cities):
    if len(cities) == 2:
        return cities[1] - cities[0]
    else:
        gcds = []
        for i in range(len(cities) - 2):
            c1 = cities[i]
            c2 = cities[i + 1]
            c3 = cities[i + 2]
            gcds.append(gcd(c2 - c1, c3 - c2))
        return min(gcds)

print(get_res(cities))
row_num, col_num = (int(i) for i in input().split())
matrix = [ list(input()) for i in range(row_num)]
transpose_matrix = []
for i in range(row_num):
    transpose_matrix.append([])
    for j in range(col_num):
        transpose_matrix[i].append(matrix[j][i])

empty_rows = []
# row check
for i,line in enumerate(matrix):
    if '#' in line:
        continue
    empty_rows.append(i)
empty_cols = []
# col check
for i,line in enumerate(transpose_matrix):
    if '#' in line:
        continue
    empty_cols.append(i)

for i in range(row_num):
    if i in empty_rows:
        continue
    for j in range(col_num):
        if j in empty_cols:
            continue
        print(matrix[i][j],end="")
    print()
        

### FIXED CODE ###

row_num, col_num = (int(i) for i in input().split())
matrix = [ list(input()) for i in range(row_num)]
transpose_matrix = []
for i in range(col_num):
    transpose_matrix.append([])
    for j in range(row_num):
        transpose_matrix[i].append(matrix[j][i])

empty_rows = []
# row check
for i,line in enumerate(matrix):
    if '#' in line:
        continue
    empty_rows.append(i)
empty_cols = []
# col check
for i,line in enumerate(transpose_matrix):
    if '#' in line:
        continue
    empty_cols.append(i)

for i in range(row_num):
    if i in empty_rows:
        continue
    for j in range(col_num):
        if j in empty_cols:
            continue
        print(matrix[i][j],end="")
    print()
n,k=map(int,input().split())
s=k
if k>n:
  print(i)
  exit()
for i in range(1000000):
  s*=k
  if s>n:
    print(i+2)
    exit()

### FIXED CODE ###

n,k=map(int,input().split())
for i in range(100000000000):
  if k**i>n:print(i);exit()
import math
N=int(input())
A=list(map(int,input().split()))
tmp=A[0]
ans=0

for i in range(N):
    tmp=math.floor((tmp*A[i])/(math.gcd(tmp,A[i])))

for i in range(N):
    ans+=(tmp/A[i])
    ans%=1000000007
    
print(int(ans))

### FIXED CODE ###

MOD=10**9+7
def factorization(n):
    arr=[]
    tmp=n
    for i in range(2,int(n**0.5)+1):
        if(tmp%i==0):
            cnt=0
            while tmp%i==0:
                cnt+=1
                tmp//=i
            arr.append([i,cnt])
    if(not arr):
        arr.append([1,1])
    if(tmp!=1):
        arr.append([tmp,1])
    return arr
def moddiv(a,m):
    return pow(a,m-2,m)
N=int(input())
A=list(map(int,input().split()))
cnt={}
for i in range(N):
    arr=factorization(A[i])
    for a,b in arr:
        cnt[a]=max(cnt.get(a,0),b)
g=1;res=0
for k,v in cnt.items():
    g=g*(pow(k,v,MOD))%MOD
for i in range(N):
    res=(res+(g*moddiv(A[i],MOD))%MOD)%MOD
print(res)
n = input() #これはstr型
int(n) #これでint型に直す
digit = n % 10
if digit == 3:
  print('bon')
elif digit == 0 or digit == 1 or digit == 6 or digit == 8:
  print('pon')
else:
  print('hon')


### FIXED CODE ###

ninput = input() #これはstr型
n = int(ninput) #これでint型に直す
digit = n % 10
if digit == 3:
  print('bon')
elif digit == 0 or digit == 1 or digit == 6 or digit == 8:
  print('pon')
else:
  print('hon')
N, M, K = map(int, input().split())

class UnionFind:
	def __init__(self, n):
		self.groups = [g for g in range(n)]

	def get_root(self, i):
		parent = self.groups[i]
		if parent == i:
			return parent
		else:
			root = self.get_root(parent)
			self.groups[i] = root
			return root
	
	def set_root(self, i, root):
		parent = self.groups[i]
		self.groups[i] = root
		if parent == i:
			return
		else:
			self.set_root(parent, root)
	
	def combine(self, i1, i2):
		self.set_root(i2, self.get_root(i1))
	
	def in_same_group(self, i1, i2):
		return self.get_root(i1) == self.get_root(i2)
	
	def to_dic(self):
		table = {}
		for i in range(len(self.groups)):
			g = self.get_root(i)
			if g in table:
				table[g].add(i)
			else:
				table[g] = {i}
		
		ret = [None] * len(self.groups)
		
		for t in table.values():
			for i in t:
				ret[i] = t
		
		return ret
	
	def to_list(self):
		table = self.to_dic()
		return [table[g] for g in table]


groups = UnionFind(N)

blocks = [set() for _ in range(N)]

for _ in range(M):
	a, b = map(int, input().split())
	groups.combine(a - 1, b - 1)
	blocks[a - 1].add(b - 1)
	blocks[b - 1].add(a - 1)

for _ in range(K):
	c, d = map(int, input().split())
	blocks[c - 1].add(d - 1)
	blocks[d - 1].add(c - 1)

groups = groups.to_dic()

print(" ".join((str(len(groups[i] - blocks[i]) - 1) for i in range(N))))




### FIXED CODE ###

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

class UnionFind:
	def __init__(self, n):
		self.groups = [g for g in range(n)]

	def get_root(self, i):
		parent = self.groups[i]
		if parent == i:
			return parent
		else:
			root = parent
			while True:
				tmp = self.groups[root]
				if tmp == root:
					break
				root = tmp
			
			while i != root:
				tmp = self.groups[i]
				self.groups[i] = root
				i = tmp
			
			return root
	
	def set_root(self, i, root):
		parent = self.groups[i]
		while parent != root:
			self.groups[i] = root
			i = parent
			parent = self.groups[i]
	
	def combine(self, i1, i2):
		self.set_root(i2, self.get_root(i1))
	
	def in_same_group(self, i1, i2):
		return self.get_root(i1) == self.get_root(i2)
	
	def counts(self):
		table = [None] * len(self.groups)
		for i in range(len(self.groups)):
			g = self.get_root(i)
			if table[g] != None:
				table[g] += 1
			else:
				table[g] = 1
		
		ret = [0] * len(self.groups)
		
		for i in range(len(self.groups)):
			ret[i] = table[self.get_root(i)]
		
		return ret
	
	def to_list(self):
		table = self.to_dic()
		return [table[g] for g in table]


groups = UnionFind(N)
minus_list = [0] * N

for _ in range(M):
	a, b = map(lambda x: int(x) - 1, input().split())
	groups.combine(a, b)
	minus_list[a] -= 1
	minus_list[b] -= 1

for _ in range(K):
	c, d = map(lambda x: int(x) - 1, input().split())
	if groups.in_same_group(c, d):
		minus_list[c] -= 1
		minus_list[d] -= 1

counts = groups.counts()

print(" ".join((str(counts[i] + minus_list[i] - 1) for i in range(N))))
N=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
res=0
for i in range(len(a)):
  res+=a-b
if res<=0:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

N=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
res=0
for i in range(len(a)):
  tmp=a[i]-b[i]
  if tmp<0:
    tmp+=tmp%2
    tmp=tmp/2
  res+=tmp
if res>0:
  print('No')
else:
  print('Yes')
import math

n=int(input())
a=list(map(int,input().split()))
b=[a[i]-(i+1) for i in range(n)]
sumb2=0
sum2=0
for bb in b:
    sumb2 += (bb**2)

for bb in b:
    sum2+=bb*2
bb=[math.ceil(sum2/(2*n)), math.floor(sum2/(2*n))]
ans=math.inf

for bbb in bb:
    sumans=0
    for aa in b:
        sumans+=(math.fabs(aa-bbb))
    ans=min(ans,sumans)

print(int(ans))
    


### FIXED CODE ###

import statistics
import math

n=int(input())
a=list(map(int,input().split()))
b=[a[i]-(i+1) for i in range(n)]
midb=statistics.median(sorted(b))
ans=0

for bb in b:
    ans+=math.fabs(bb-midb)
print(int(ans))
a,b = map( input() , input().split() )

ans1 = a * b
ans2 = 2 * ( a + b )

print ans1 , ans2

### FIXED CODE ###

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

ans1 = a * b
ans2 = 2 * ( a + b )

print ans1 , ans2
a=int(input())
b=int(input())
c=int(input())
if a+b+c >=22:
	print('bust')
else:
	print('win')

### FIXED CODE ###

a,b,c = map(int,input().split())
if a+b+c >=22:
	print('bust')
else:
	print('win')
n, u, v = map(int, input().split())
u -= 1
v -= 1
m_mat = [[] for i in range(n)]
for _ in range(n-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    m_mat[a].append(b)
    m_mat[b].append(a)
u_map = [-1]*n
v_map = [-1]*n
u_map[u] = 0
v_map[v] = 0
def dfs(current, depth, ma):
    for nex in m_mat[current]:
        if ma[nex] > -1:
            continue
        ma[nex] = depth
        dfs(nex, depth+1, ma)
dfs(u, 1, u_map)
dfs(v, 1, v_map)

ans = -1
for i in range(n):
    if u_map[i] < v_map[i] and v_map[i] > ans:
        ans = v_map[i]

print(ans-1)


### FIXED CODE ###

import sys

sys.setrecursionlimit(10**5)
n, u, v = map(int, input().split())
u -= 1
v -= 1
m_mat = [[] for i in range(n)]
for _ in range(n-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    m_mat[a].append(b)
    m_mat[b].append(a)
u_map = [-1]*n
v_map = [-1]*n
u_map[u] = 0
v_map[v] = 0


def dfs(current, depth, ma):
    for nex in m_mat[current]:
        if ma[nex] > -1:
            continue
        ma[nex] = depth
        dfs(nex, depth+1, ma)


dfs(u, 1, u_map)
dfs(v, 1, v_map)

ans = -1
for i in range(n):
    if u_map[i] < v_map[i] and v_map[i] > ans:
        ans = v_map[i]

print(ans-1)
a_s=a/1.08
a_t=(a+1)/1.08
b_s=b/1.1
b_t=(b+1)/1.1

a0=int(a_s)
a1=int(a_t)
b0=int(b_s)
b1=int(b_t)


if (a_s-a0)>0:
  a0+=1
if (a_t-a1)<=0:
  a1-=1
if (b_s-b0)>0:
  b0+=1
if (b_t-b1)<=0:
  b1-=1

lista=[i for i in range(a0,a1+1)]
listb=[i for i in range(b0,b1+1)]

ansl=[]
for j in range(len(lista)):
  if lista[j] in listb:
    ansl.append(lista[j])

if not ansl==[]:
  ans=ansl[0]
  print(ans)
else:
  print(-1)

### FIXED CODE ###

a,b=map(int,input().split())
a_s=a/0.08
a_t=(a+1)/0.08
b_s=b/0.1
b_t=(b+1)/0.1

a0=int(a_s)
a1=int(a_t)
b0=int(b_s)
b1=int(b_t)


if (a_s-a0)>0:
  a0+=1
if (a_t-a1)<=0:
  a1-=1
if (b_s-b0)>0:
  b0+=1
if (b_t-b1)<=0:
  b1-=1

lista=[i for i in range(a0,a1+1)]
listb=[i for i in range(b0,b1+1)]

ansl=[]
for j in range(len(lista)):
  if lista[j] in listb:
    ansl.append(lista[j])

if not ansl==[]:
  ans=ansl[0]
  print(ans)
else:
  print(-1)
N=int(input().strip())

xyh=[]
for i in range(N):
    xi,yi,hi = map(int, input().split(' '))
    if hi>0:
        xyh.append([xi,yi,hi])

fl=False
nh=0
for ny in range(101):
    if fl:
        break
    for nx in range(101):
        if fl:
            break
        for i in range(len(xyh)):
            if i==0:
                nh=abs(xyh[i][0]-nx)+abs(xyh[i][1]-ny)+xyh[i][2]
        #        print(abs(xyh[i][0]-nx)+abs(xyh[i][1]-ny)+xyh[i][2])
            elif i==len(xyh)-1:
                if nh!=abs(xyh[i][0]-nx)+abs(xyh[i][1]-ny)+xyh[i][2]:
                    break
                else:
                    fl=True
                    ax=nx
                    ay=ny
                    ah=nh
                    break
            else:
                if nh!=abs(xyh[i][0]-nx)+abs(xyh[i][1]-ny)+xyh[i][2]:
                    break

print("{} {} {}".format(ax,ay,ah))

### FIXED CODE ###

N=int(input().strip())
xyh=[]
for i in range(N):
    xi,yi,hi = map(int, input().split(' '))
    xyh.append([xi,yi,hi])
    if hi>=1:
        xyhset=[xi,yi,hi]
        
for nx in range(101):
    for ny in range(101):
        He = xyhset[2]+abs(xyhset[0]-nx)+abs(xyhset[1]-ny)
        He=max(0,He)
        flag=True
        for i in range(N):
            h=He-abs(xyh[i][0]-nx)-abs(xyh[i][1]-ny)
            h=max(0,h)
            if xyh[i][2]!=h:
                flag=False
        if flag:
            ax=nx
            ay=ny
            ah=He

print("{} {} {}".format(ax,ay,ah))
string_list = list(input())
string_len = len(string_list)
renzoku_list = []

def find_letter():
  renzoku = 0
  for i in range(string_len):
    if string_list[i]=='A':
      renzoku += 1
    elif string_list[i]=='C':
      renzoku += 1
    elif string_list[i]=='G':
      renzoku += 1
    elif string_list[i]=='T':
      renzoku += 1
    else:
      renzoku_list.append(renzoku)
      renzoku = 0

if 'A' in string_list:
  find_letter()
elif 'C' in string_list:
  find_letter()
elif 'G' in string_list:
  find_letter()
elif 'T' in string_list:
  find_letter()
else:
  print(0)
  
max_len = max(renzoku_list)
print(max_len)

### FIXED CODE ###

string_list = list(input())
string_len = len(string_list)
renzoku_list = []

def find_letter():
  renzoku = 0
  for i in range(string_len):
    if string_list[i]=='A':
      renzoku += 1
    elif string_list[i]=='C':
      renzoku += 1
    elif string_list[i]=='G':
      renzoku += 1
    elif string_list[i]=='T':
      renzoku += 1
    else:
      renzoku_list.append(renzoku)
      renzoku = 0
  renzoku_list.append(renzoku)

find_letter()
  
if renzoku_list:
  max_len = max(renzoku_list)
  print(max_len)
else:
  print(0)
def calc(dp,adj,i):
    if(len(adj[i])==0):
        dp[i]=0
    elif dp[i]<0:
        for j in adj[i]:
            dp[i]=max(dp[i],calc(dp,adj,j))
        dp[i]+=1
    return dp[i]
n,m=map(int,input().split())
adj=[]
for i in range(n+1):
    adj.append([])
for i in range (m):
    x,y=map(int,input().split())
    adj[x].append(y)
dp=[-1]*(n+1);
for i in range(1,n+1):
    calc(dp,adj,i)
print(max(dp))


### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)
def calc(dp,adj,i):
    if(len(adj[i])==0):
        dp[i]=0
    elif dp[i]>0:
        return dp[i]
    else:
        for j in adj[i]:
            dp[i]=max(dp[i],calc(dp,adj,j))
        dp[i]+=1
    return dp[i]
n,m=map(int,input().split())
adj=[]
for i in range(n+1):
    adj.append([])
for i in range (m):
    x,y=map(int,input().split())
    adj[x].append(y)
dp=[-1]*(n+1);
for i in range(1,n+1):
    calc(dp,adj,i)
print(max(dp))
S = list(input())
K = int(input())
for i in range(len(K)):
    if S[i] != 1:
        print(S[i])
        exit()
print(1)

### FIXED CODE ###

S = list(input())
K = int(input())
for i in range(min(len(S),K)):
    if S[i] != "1":
        print(int(S[i]))
        exit()
print(1)
n=int(input())
#n,k=list(map(int,input().split()))
ans=defaultdict(int)
for i in range(n):
    s=input()
    ans[s]+=1

print(len(ans.keys()))

### FIXED CODE ###

from collections import defaultdict
n=int(input())
#n,k=list(map(int,input().split()))
ans=defaultdict(int)
for i in range(n):
    s=input()
    ans[s]+=1

print(len(ans.keys()))
a, b, c = map(int, raw_input())
print(len(set([a,b,c])))

### FIXED CODE ###

a, b, c = map(int, raw_input().split())
print(len(set([a,b,c])))
number_1 = int(input())
number_2 = int(input())
if number_1>9 or number_2>9:
  print(-1)
else:
  print(number_1*number_2)

### FIXED CODE ###

S = input()
li = S.split(" ")
A = int(li[0])
B = int(li[1])
if A>9 or B>9:
    print(-1)
else:
    print(A*B)
n,k=[s for s in input().split()]
n=int(n)
k=int(k)
hate=list(map(int, input().split())) #hate取得
like=[]
for i in range(1,10): #like取得
	if i not in hate:
		like.append(i)
pointer=0
hate.sort()
like.sort()
		
for ichi in like: #1桁の場合
	if ichi>=n:
		kane=ichi
		pointer=1
		break

if pointer==0: #2桁の場合
	for ju in like:
		for ichi in like:
			if ju*10+ichi>=n:
				kane=ju*10+ichi
				pointer=1
				break
		if pointer==1:
			break


if pointer==0: #3桁の場合
	for hyaku in like:
		for ju in like:
			for ichi in like:
				if hyaku*100+ju*10+ichi>=n:
					kane=hyaku*100+ju*10+ichi
					pointer=1
					break
			if pointer==1:
				break
		if pointer==1:
			break

if pointer==0: #4桁の場合
	for sen in like:
		for hyaku in like:
			for ju in like:
				for ichi in like:
					if sen*1000+hyaku*100+ju*10+ichi>=n:
						kane=sen*1000+hyaku*100+ju*10+ichi
						pointer=1
						break
				if pointer==1:
					break
			if pointer==1:
				break
		if pointer==1:
			break

if pointer==1:
	print(kane)
else:
	print("Error!!")

### FIXED CODE ###

[a,b,c]=map(int, input().split())
list1=[a,b,c]
list1.sort()
if list1==[5,5,7]:
	print("YES")
else:print("NO")
count = 0
for i in range(x[0], x[1]):
	if x[2] % i == 0:
		count += 1
print(count)

### FIXED CODE ###

x = (list(map(lambda x : int(x), input().split(" "))))
count = 0
for i in range(x[0], x[1]+1):
	if x[2] % i == 0:
		count += 1
print(count)
a,b = map(int, raw_input().split())
d = a / b
r = a % b
f = float(a) / float(b)
print " ".join(map(str, [d, r, '%.5f'.f]))

### FIXED CODE ###

a,b = map(int, raw_input().split())
d = a / b
r = a % b
f = float(a) / float(b)
print " ".join([str(d), str(r), str('%.5f' % f)])
price, hate = input().split()
no_num = set([x for x in input().split()])
ok_num = sorted(list({'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} - no_num))

result = []
f = True
exe = True
for i in price:
    f = True
    for j in ok_num:
        if i <= j:
            print(j)
            result.append(j)
            f = False
            break
    if f and exe:
        exe = False
        result[-1] = str(int(result[-1]) + 1)
        for i in ok_num:
            if result[-1] < i:
                result[-1] = i
                break
        result.append(ok_num[-1])

print(''.join(result))


### FIXED CODE ###

kingaku, n = input().split()
no_num = input().split()
result = []
ok_num = []
kuriage_num = [-1, 0]

def kuriage(l):
    for i in ok_num:
        if result[l] < i:
            kuriage_num = [l, i]
            return
    if l <= 0:
        return
    return kuriage(l-1)

#使える数字のリストを作成
for i in range(10):
    if not str(i) in no_num:
        ok_num.append(str(i))

set_flg = False
for i in kingaku:
    set_flg = True
    for j in ok_num:
        if i == j:
            set_flg = False
            result.append(j)
            break
        elif i < j:
            result.append(j)
            print("".join(result).ljust(len(kingaku), ok_num[0]))
            exit()
            break
    
    if set_flg:
        n = 0
        if ok_num[0] == '0':
            n = 1
        print(ok_num[n].ljust(len(kingaku)+1, ok_num[0]))
        exit()

print(''.join(result))
import math
import numpy as np
import queue
from collections import deque,defaultdict
import heapq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    n,s = map(int,ipt().split())
    a = [int(i) for i in ipt().split()]
    mod = 998244353
    two = [1]*(n+1)
    for i in range(n):
        two[i+1] = two[i]*2%mod
    dp = np.zeros((n+1,s+1),dtype = int)
    for i,ai in enumerate(a):
        if ai > s:
            continue
        for si in range(s):
            dp[s-si][ai:] += dp[s-si-1][:-ai]
        dp[1][ai] += 1
    ans = 0
    for i in range(n+1):
        dpi = dp[i]
        ans = (ans+(dpi[s]*two[n-i])%mod)%mod
    print(ans)
    return

if __name__ == '__main__':
    main()


### FIXED CODE ###

import math
import numpy as np
import queue
from collections import deque,defaultdict
import heapq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    n,s = map(int,ipt().split())
    a = [int(i) for i in ipt().split()]
    mod = 998244353
    two = [1]*(n+1)
    for i in range(n):
        two[i+1] = two[i]*2%mod
    dp = np.zeros(3010,dtype = int)
    dp[0] = 1
    for i,ai in enumerate(a):
        ndp = dp*2
        ndp[ai:] += dp[:-ai]
        ndp %= mod
        dp = ndp
    print(dp[s])
    return

if __name__ == '__main__':
    main()
K, N = map(int, input().split())
A = list(map(int, input().split()))

for i in range(0, N): 
        for j in range(i + 1, N): 
            if A[i] + A[j] == K: 
                if A[i] > A[j]:
                    print(A[i] - A[j])
                else:
                    print(A[j] - A[i])

### FIXED CODE ###

s = input()

if s[2] == s[3] and s[4] == s[5]:
    print("Yes")
else:
    print("No")
c = 0
r = []
for i in input():
  if i=='R':
    c+=1
  else:
    r.append(c)
print(max(r))

### FIXED CODE ###

c = 0
r = []
for i in input():
  if i=='R':
    c+=1
  else:
    r.append(c)
    c = 0
r.append(c)
if not len(r):
  print(c)
else:
  print(max(r))