Harryxun/stf_run huggingface dataset:
def sum(n):
    str_n = str(n)
    ans = 0
    for i in range(len(str_n)):
        ans += int(str_n[i])
    return ans

N,A,B = map(int, [input() for i in range(3)])

ans1 = 0
for i in range(N+1):
    if A <= sum(i) <= B:
        ans1 += i
print(ans1)


### FIXED CODE ###

def sum(n):
    str_n = str(n)
    ans = 0
    for i in range(len(str_n)):
        ans += int(str_n[i])
    return ans

N,A,B = map(int,input().split())

ans1 = 0
for i in range(N+1):
    if A <= sum(i) <= B:
        ans1 += i
    else:
        continue
print(ans1)
import sys  
input = sys.stdin.readline
 
N, M = list(map(int, input().split()))
 
A = list(map(int, input().split()))



BC = []
for i in range(M):
    b, c = list(map(int, input().split()))
    BC.append([b, c])

BC=sorted(BC, reverse=True, key=lambda x:x[1])

cnt = 0
com = []
for b, c in BC:
    cnt += b
    if cnt > N:
        add = N-cnt+b
        com.extend([c]*add)
        break
    else:
        x = [c]*b 
        com.extend(x)

A.extend(com)
A = sorted(A, reverse=True)   

print(sum(A[:N])

### FIXED CODE ###

import sys  
input = sys.stdin.readline
 
N, M = list(map(int, input().split()))
 
A = list(map(int, input().split()))



BC = []
for i in range(M):
    b, c = list(map(int, input().split()))
    BC.append([b, c])

BC=sorted(BC, reverse=True, key=lambda x:x[1])

cnt = 0
com = []
for b, c in BC:
    cnt += b
    if cnt > N:
        add = N-cnt+b
        com.extend([c]*add)
        break
    else:
        x = [c]*b 
        com.extend(x)
A.sort()   
num = -1
for k in range(N):
    if k == len(com):
        num = k
        break
    if A[k] > com[k]:
        num = k
        break

if num == -1:
    print(sum(com))
else:
    print(sum(com[:num])+sum(A[num:]))
N=input()
B=0
B=len(N)
B=B-1
if N[B]=="2" or N[B]=="4" N[B]=="5" or N[B]=="7" or N[B]=="9":
    print('hon')
elif N[B]=="0" or N[B]=="1" or N[B]=="6"or N[B]=="8":
    print('pon')
else:
    print('bon')


### FIXED CODE ###

N=input()
B=0
B=len(N)
B=B-1
#print(B,N)
if N[B]=='2' or N[B]=='4' or N[B]=='5' or N[B]=='7' or N[B]=='9':
    print('hon')
elif N[B]=='0' or N[B]=='1' or N[B]=='6' or N[B]=='8':
    print('pon')
else:
    print('bon')
a=[1,2,2,4,4,4,4,8,8,8,8,8,8,8,8,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64]
print(a[(int(input()))])


### FIXED CODE ###

a=[0,1,2,2,4,4,4,4,8,8,8,8,8,8,8,8,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64]
print(a[(int(input()))])
a,b=map(int,(input().split())
print(a*b, 2*(a+b))


### FIXED CODE ###

a,b=map(int,input().split())
print(a*b, 2*(a+b))
N=input()
if N[0]='7' or N[1]='7' or N[2]='7':
  print('Yes')
else:
  print('No')

### FIXED CODE ###

N=input()
if N[0]=='7' or N[1]=='7' or N[2]=='7':
  print('Yes')
else:
  print('No')
#coding:utf-8
from scipy.special import comb

n, k = map(int, input().split())
m = pow(10,9) + 7

for i in range(k):
    # 赤と赤の間に青を配置する場所の組み合わせ
    blue = comb(n-k+1, i+1, exact=True)
    # 青をいくつずつ配置するかの組み合わせ
    blue_num = comb(k-1, i, exact=True)
    print(blue * blue_num % m)

### FIXED CODE ###

#coding:utf-8
from scipy.misc import comb

n, k = map(int, input().split())
m = pow(10,9) + 7

for i in range(k):
    # 赤と赤の間に青を配置する場所の組み合わせ
    blue = comb(n-k+1, i+1, exact=True)
    # 青をいくつずつ配置するかの組み合わせ
    blue_num = comb(k-1, i, exact=True)
    print(blue * blue_num % m)
import sys

N = int(input())
H = [int(x) for x in input().split()]

flag = 0

for i in range(len(H) - 1):
    if H[i] > H[i+1] + 1:
        print('No')
        sys.exit()
	
    elif H[i] == H[i+1] + 1:
	flag = 1
	
    if flag == 1:
        if H[i]	> H[i+1]:
            print('No')
            sys.exit()

print('Yes')

### FIXED CODE ###

a, b, c = (int(x) for x in input().split())
if c-a+b>0:
	print(c-a+b)
else:
 	print(0)
a,b = map(int,input().split())
c = a+b
if(c>=24):
  print(c-24):
else:
  print(c)


### FIXED CODE ###

a, b = map(int, input().split())
c = a + b
if c >= 24:
    print(c - 24)
else:
    print(c)
S, T = input().split()
print(T+S)

### FIXED CODE ###

A, B, K = map(int, input().split())
if K <= A:
    print(A-K, B)
elif K <= A+B:
    print(0, B-(K-A))
else:
    print(0, 0)
N = int(input())
S = input()
T = input()
A = ''
for i in S:
  A+=i
  for j in T:
    A+=j
print(A)

### FIXED CODE ###

N = int(input())
S,T = map(str,input().split())
A = ""
for (i,j) in zip(S,T):
  A+=i
  A+=j
print(A)
S=input()
K=int(input())
for j in S:
	if j=='1':
		if j==K:
			co='1'
			break
	else:
		co=j
		break
print(co)

### FIXED CODE ###

S=input()
K=int(input())
co=0	
a=0
for j in S:
	a=a+1
	if j!='1':
		print(j)
		co=1
		break
	if a==K:
		break
if co==0:
	print('1')
def f(a,b):
#a=7,5,3  b=0-7
#no=0, 3=1, 5=2, 7=4, all=7
    if a==7 and b>=4: return b
    if a==7 and b<4: return b+4
    if a==5 and b in (2,3,6,7): return b
    if a==5 and b not in (2,3,6,7): return b+2
    if a==3 and b in (1,3,5,7): return b
    if a==3 and b not in (1,3,5,7): return b+1

n=input()

#a,b=map(int, input().split())
#print(f(a,b))
l=[int(i) for i in "0"+n]
dp=[[[0]*9,[0]*9] for _ in "ww"]
dp[0][0][0]=1

chk=(7,5,3)
for i,j in enumerate(l):
    if i==0: continue
    elif i==1:
        if j in chk: dp[i%2][0][f(j,0)]=1
        if j not in chk: dp[i%2][0][0]=1
        if j>7: dp[i%2][1][4]+=1
        if j>5: dp[i%2][1][2]+=1
        if j>3: dp[i%2][1][1]+=1
        dp[i%2][1][0]=1
    else:
        dp[i%2][1][0]=1
        dp[i%2][1][4]+=1
        dp[i%2][1][2]+=1
        dp[i%2][1][1]+=1
        for k in range(8):
            if dp[i%2-1][0][k] and (k==0 or j not in chk): dp[i%2][0][0]=1
            elif dp[i%2-1][0][k] and j in chk: dp[i%2][0][f(j,k)]=1

            if dp[i%2-1][0][k] and k!=0:
                if j>7: dp[i%2][1][f(7,k)]+=1
                if j>5: dp[i%2][1][f(5,k)]+=1
                if j>3: dp[i%2][1][f(3,k)]+=1
            if dp[i%2-1][1][k] and k!=0:
                dp[i%2][1][f(7,k)]+=dp[i%2-1][1][k]
                dp[i%2][1][f(5,k)]+=dp[i%2-1][1][k]
                dp[i%2][1][f(3,k)]+=dp[i%2-1][1][k]
    for k in range(9):
        dp[i%2-1][0][k]=0
        dp[i%2-1][1][k]=0

print(dp[0][0][7]+dp[0][1][7]+dp[1][0][7]+dp[1][1][7]

### FIXED CODE ###

t=["0","3","5","7"]
s=["3","5","7"]
n=int(input())
ans=chk=0
for a in t:
    for b in t:
        for c in t:
            for d in t:
                for e in t:
                    for f in t:
                        for g in s:
                            for h in s:
                                for i in s:
                                    x=str(int(a+b+c+d+e+f+g+h+i))
                                    y=set(list(x))
                                    if ("0" not in y) and (len(y)==3) and (int(x)<=n):
                                        ans+=1
print(ans)
n,w = map(int, input().split())
    wv = []
    for _ in range(n):
        data = list(map(int,input().split()))
        wv.append(data)
     
    dct={}
     
    def solve(i,j):
        if i>=n:
            return 0
     
        ky = str(i)+"_"+str(j)
        if ky in dct:
            return dct[ky]
     
     
        weight=wv[i][0]
        value =wv[i][1]
     
        if j<weight: # can't push this item
            val = solve(i+1,j)
        else:# push or not push
            val =  max(solve(i+1,j-weight)+value, solve(i+1,j))
     
        dct[ky] = val
     
        return val
     
    print(solve(0,w))

### FIXED CODE ###

n,w = map(int, input().split())
wv = []
for _ in range(n):
    data = list(map(int,input().split()))
    wv.append(data)

dp = [[0 for i in range(w+1)] for j in range(n+1)]

for item in range(n):
    now_w=wv[item][0]
    now_v=wv[item][1]

    for weight in range(w+1):
        ans1=dp[item][weight]
        ans2=-1
        if weight - now_w >= 0:
            ans2=dp[item][weight-now_w]+now_v
        dp[item+1][weight] = max(ans1,ans2)

print(dp[n][w])
n=int(input())
s=input()
t=input()
word = 0
for i in range(n):
  word += s[i]
  for j in range(n):
    word += t[j]
 
print(word)
  

### FIXED CODE ###

n=int(input())
s,t=input().split()

word=""
for i in range(n):
    word+=(s[i]+t[i])
print(word)
n = int(input())
print(n＊＊3)

### FIXED CODE ###

n = int(input())
print(n**3)
a, b = input().split()
op = ['==', '>', '<']
result = int(a) - int(b)
if result != 0:
    result = result / abs(result)

print(a, op[result], b)

### FIXED CODE ###

a, b = input().split()
op = ['==', '>', '<']
result = int(a) - int(b)
if result != 0:
    result = result // abs(result)
 
print('a ' + op[result] + ' b')
h = int(input())
ans = 1
h //= 2
i = 2
while h > 0:
    ans += i
    i *= 2
    h //= 2
print(ans)
pow(2,n)-1

### FIXED CODE ###

h = int(input())
ans = 1
h //= 2
i = 2
while h > 0:
    ans += i
    i *= 2
    h //= 2
print(ans)
n, l = [ v for v in input().split() ]
string_list = sorted([ input() for v in range(n) ])
print("".join(string_list))

### FIXED CODE ###

n, l = [ int(v) for v in input().split() ]
string_list = sorted([ input() for v in range(n) ])
print("".join(string_list))
N = int(input())
A = list(map(int, input().split()))

number = defaultdict(int)
for a in A:
    number[a] += 1

def combination(n, r):
    denominator = 1
    for i in range(n, n - r, -1):
        denominator *= i
    numerator = factorial(r)
    return denominator // numerator

combi = {}
combi2 = {}
for k, v in number.items():
    combi[k] = combination(v, 2)
    combi2[k] = combination(v - 1, 2)
combination_all = sum(combi.values())
# print(f"number:{number} combi:{combi} combi2:{combi2} combination_all:{combination_all}", file=sys.stderr)

for a in A:
    # print(f"a:{a} n:{n}", file=sys.stderr)
    print(combination_all - (combi[a] - combi2[a]))

### FIXED CODE ###

from collections import defaultdict
from math import factorial

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

number = defaultdict(int)
for a in A:
    number[a] += 1

def combination(n, r):
    denominator = 1
    for i in range(n, n - r, -1):
        denominator *= i
    numerator = factorial(r)
    return denominator // numerator

combi = {}
combi2 = {}
for k, v in number.items():
    combi[k] = combination(v, 2)
    combi2[k] = combination(v - 1, 2)
combination_all = sum(combi.values())
# print(f"number:{number} combi:{combi} combi2:{combi2} combination_all:{combination_all}", file=sys.stderr)

for a in A:
    print(combination_all - (combi[a] - combi2[a]))
n, k = map(int, raw_input().split())
A = [int(raw_input())-k for i in xrange(n)]
su = 0
v = [(0, 0)]
for i in xrange(n):
    su += A[i]
    v.append((su, i+1))
v.sort()

data = [0]*(n+2)
def sum(i):
    s = 0
    while i > 0:
        s += data[i]
        i -= i & -i
    return s
def add(i, x):
    while i <= n+2:
        data[i] += x
        i += i & -i
ans = 0
tmp = 0
for e, i in v:
    ans += sum(i+1)
    add(i+1, 1)
print ans


### FIXED CODE ###

n, k = map(int, raw_input().split())
A = [int(raw_input())-k for i in xrange(n)]
su = 0
v = [(0, 0)]
for i in xrange(n):
    su += A[i]
    v.append((su, i+1))
v.sort()

data = [0]*(n+5)
def dsum(i):
    s = 0
    while i > 0:
        s += data[i]
        i -= i & -i
    return s
def add(i, x):
    while i <= n+2:
        data[i] += x
        i += i & -i
ans = 0
for e, i in v:
    ans += dsum(i+1)
    add(i+1, 1)
print ans
# -*- coding: <encoding name> -*-

n = int(input())
if '9' in n:
	print('Yes')
else:
	print('No')

### FIXED CODE ###

# -*- coding: <encoding name> -*-

n = input()
if '9' in n:
	print('Yes')
else:
	print('No')
A, B = input().split()
A = int(A)
B = int(B)*100 + int(B[-2:])

print(A*B // 100)

### FIXED CODE ###

A, B = input().split()
A = int(A)
B = int(B[:-3])*100 + int(B[-2:])

print(A*B // 100)
n = input()
a = map(int,input(). split ())

d=1

for b in a:
  
  	d=d*b
    if d>10**18:
      break
if d>10**18:
  print("-1")
else:
  print(d) 

### FIXED CODE ###

def main():

	n=input()
	a=list(map(int,input().split()))
	
	
	if 0 in a:
		print(0)
		return

	d=1
    
	

	for b in a:
		d=d*b
		if d>10**18:
			print("-1")
			return
	print(d)

main()
N = int(input())
A = list(map(int,input().split()))
SA = sorted(A,reverse=True)
ALI =0
BOB=0
for i in range(0,N,2):
    ALI += int(SA[i])
for n in range(1,N,2):
    BOB += int(SA[n])
ans = ALI - BOB
print(ans)

### FIXED CODE ###

n = int(input())
a = int(input())
print('Yes') if n%500<=a else print('No')
n = list(map(int, input().split()))
count_5 = 2
count_5 = 1
for i in range(len(n)):
    if n[i] == 5:
        count_5 -= 1
    elif n[i] == 7:
        count_7 -= 1
if count_5==0 and count_7==0:
    print('YES')
else:
    print('NO')


### FIXED CODE ###

n = list(map(int, input().split()))
count_5 = 2
count_7 = 1
for i in range(len(n)):
    if n[i] == 5:
        count_5 -= 1
    elif n[i] == 7:
        count_7 -= 1
if count_5==0 and count_7==0:
    print('YES')
else:
    print('NO')
import math
N = int(input())
print(int(2*N / math.gcd(2, N)))

### FIXED CODE ###

N = int(input())
if N%2==0:
    print(N)
else:
    print(N*2)
a,b=(int(x) for x in input().split())
 
for i in range(10000):
  if i//100*8==a and i//100*10==b:
    print(i)
  else:
    print(-1)

### FIXED CODE ###

S = input()
if S[0] == S[1] == S[2]:
  print('No')
else:
  print('Yes')
N = int(input())
g = [[] for _ in range(N)]
ans = [[] for _ in range(N-1)]

def dfs(v, c=-1, p=-1):
    k = 1
    for i in range(len(g[v])):
        u = g[v][i][0]
        ei = g[v][i][1]
        if u == p:
            continue
        if k == c:
            k += 1
        ans[ei] = k
        k += 1
        dfs(u, ans[ei], v)


for i in range(N-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    g[a].append((b, i))
    g[b].append((a, i))
dfs(0)
mx = 0

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
N = int(input())
g = [[] for _ in range(N)]
ans = [0 for _ in range(N-1)]

def dfs(v, c=-1, p=-1):
    k = 1
    for i in range(len(g[v])):
        u = g[v][i][0]
        ei = g[v][i][1]
        if u == p:
            continue
        if k == c:
            k += 1
        ans[ei] = k
        k += 1
        dfs(u, ans[ei], v)


for i in range(N-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    g[a].append([b, i])
    g[b].append([a, i])
dfs(0)
mx = 0
for i in range(N):
    mx = max(mx, len(g[i]))
print(mx)
for i in range(N-1):
    print(ans[i])
# -*- coding: utf-8 -*-
import sys
from collections import defaultdict
from heapq import heappush,heappop,heapify

H,W=map(int, sys.stdin.readline().split())
CH,CW=map(int, sys.stdin.readline().split())
CH-=1
CW-=1
DH,DW=map(int, sys.stdin.readline().split())
DH-=1
DW-=1
S=[ sys.stdin.readline().strip() for _ in range(W) ]

D=[(0,1),(0,-1),(1,0),(-1,0)]
WARP=[(1,1),(-1,1),(1,-1),(-1,-1),(2,0),(-2,0),(0,2),(0,-2),(1,2),(-1,2),(1,-2),(-1,-2),(2,1),(-2,1),(2,-1),(-2,-1),(2,2),(-2,2),(2,-2),(-2,-2)]

d=defaultdict(lambda: float("inf"))    #(h,w):kyori スタート地点からその点までの距離

def dij(h,w):
    d[(h,w)]=0
    hq=[]
    heappush(hq,(0,h,w))
    while hq:
        cost,fro_h,fro_w=heappop(hq)
        #歩いて移動
        for dh,dw in D:
            to_h, to_w=fro_h+dh, fro_w+dw
            if 0<=to_h<H and 0<=to_w<W:
                if S[to_h][to_w]=="#": continue
                if S[to_h][to_w]==".":
                    alt=d[(fro_h,fro_w)]+0
                    if alt<d[(to_h,to_w)]:
                        d[(to_h,to_w)]=alt
                        heappush(hq, (alt,to_h,to_w))
        #ワープ
        for dh,dw in WARP:
            to_h, to_w=fro_h+dh, fro_w+dw
            if 0<=to_h<H and 0<=to_w<W:
                if S[to_h][to_w]=="#": continue
                if S[to_h][to_w]==".":
                    alt=d[(fro_h,fro_w)]+1
                    if alt<d[(to_h,to_w)]:
                        d[(to_h,to_w)]=alt
                        heappush(hq, (alt,to_h,to_w))

dij(CH,CW)
if d[(DH,DW)]==float("inf"):
    print -1
else:
    print d[(DH,DW)]


### FIXED CODE ###

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

H,W=map(int, sys.stdin.readline().split())
CH,CW=map(int, sys.stdin.readline().split())
CH-=1
CW-=1
DH,DW=map(int, sys.stdin.readline().split())
DH-=1
DW-=1
S=[ sys.stdin.readline().strip() for _ in range(H) ]

D=[(0,1),(0,-1),(1,0),(-1,0)]
WARP=[]
for dh in range(-2,3):
    for dw in range(-2,3):
        if abs(dh)+abs(dw)<=1: continue
        WARP.append((dh,dw))

d=defaultdict(lambda: float("inf")) #スタート地点から各マスまでの距離

q=deque()
q.append((0,CH,CW))
d[(CH,CW)]=0

while q:
    kyori, fro_h, fro_w=q.popleft()
    if d[(fro_h, fro_w)]<kyori: continue
    #歩いて移動
    for dh,dw in D:
        to_h, to_w=fro_h+dh, fro_w+dw
        if 0<=to_h<H and 0<=to_w<W and S[to_h][to_w]==".":
            if kyori < d[(to_h, to_w)]:
                d[(to_h, to_w)]=kyori
                q.appendleft((kyori, to_h, to_w))
    #ワープ
    for dh,dw in WARP:
        to_h, to_w=fro_h+dh, fro_w+dw
        if 0<=to_h<H and 0<=to_w<W and S[to_h][to_w]==".":
            if kyori+1 < d[(to_h, to_w)]:
                d[(to_h, to_w)]=kyori+1
                q.append((kyori+1, to_h, to_w))

if d[(DH,DW)]==float("inf"):
    print -1
else:
    print d[(DH,DW)]
S = input()
N = len(S)
ans = 0
for i in range(N):
    for j in range(i, N):
        if all('ACGT'.count() == 1 for c in S[i:j+1]):
            ans = max(ans, j-i+1)
print(ans)

### FIXED CODE ###

S = input()
N = len(S)
ans = 0
for i in range(N):
    for j in range(i, N):
        if all('ACGT'.count(c) == 1 for c in S[i:j+1]):
            ans = max(ans, j-i+1)
print(ans)
x = input()
print(x ** 3)



### FIXED CODE ###

x = int(input())
print(x ** 3)
N,W = [int(s) for s in input().split()]
dp = [[10**10]*(1001) for _ in range(N+1)]#外側から内側のイメージ

dp[0][0] = 0
for i in range(N):
    w, v = [int(s) for s in input().split()]
    for sum_v in range(1000*100):
        if sum_v - v >= 0:
            dp[i+1][sum_v] = min(dp[i][sum_v], dp[i][sum_v-v] + w)
        else:
            dp[i+1][sum_v] = dp[i][sum_v]

ans = 0
for sum_v in range(1000*100):
    if dp[N][sum_v] <= W:
        ans = sum_v

print(ans)

### FIXED CODE ###

N,W = [int(s) for s in input().split()]
dp = [[10**10]*(1000*100+1) for _ in range(N+1)]#外側から内側のイメージ

dp[0][0] = 0
for i in range(N):
    w, v = [int(s) for s in input().split()]
    for sum_v in range(1000*100+1):
        if sum_v - v >= 0:
            dp[i+1][sum_v] = min(dp[i][sum_v], dp[i][sum_v-v] + w)
        else:
            dp[i+1][sum_v] = dp[i][sum_v]

ans = 0
for sum_v in range(1000*100+1):
    if dp[N][sum_v] <= W:
        ans = sum_v

print(ans)
import sys
import heapq


def input(): return sys.stdin.readline().strip()


def main():
    N, M = map(int, input().split())

    w = [[] for _ in range(10 ** 5)]
    for _ in range(N):
        a, b = map(int, input().split())
        w[a].append(b)

    ans = 0
    hq = []
    for i in range(1, M+1):
        for x in w[i]:
            heapq.heappush(hq, -x)

        if not hq:
            continue

        ans += -heapq.heappop(hq)

    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
import heapq


def input(): return sys.stdin.readline().strip()


def main():
    N, M = map(int, input().split())

    w = [[] for _ in range(10 ** 5 + 1)]
    for _ in range(N):
        a, b = map(int, input().split())
        w[a].append(b)

    ans = 0
    hq = []
    for i in range(1, M+1):
        for x in w[i]:
            heapq.heappush(hq, -x)

        if not hq:
            continue

        ans += -heapq.heappop(hq)

    print(ans)


if __name__ == "__main__":
    main()
n, m = map(int, input().split())
slist = []
clist = []

def check(numlist, slist, clist):
    for i in range(m):
        if int(numlist[slist[i]]) != clist[i]:
            return False
    return True

for i in range(m):
    s,c = map(int, input().split())
    slist.append(s-1)
    clist.append(c)
flag = 0
# if m > n:
#     print(-1)
# else:
    for num in range(10**(n-1), 10**n):
        numstring = str(num)
        numlist = list(numstring)
        if check(numlist, slist, clist):
            print(num)
            flag = 1
            break
    if not flag:
        print(-1)



### FIXED CODE ###

n, m = map(int, input().split())
slist = []
clist = []

def check(numlist, slist, clist):
    for i in range(m):
        if int(numlist[slist[i]]) != clist[i]:
            return False
    return True

for i in range(m):
    s,c = map(int, input().split())
    slist.append(s-1)
    clist.append(c)

start = 10**(n-1)
end = 10**n
if n == 1:
    start = 0
flag = 0
for num in range(start, end):
    numstring = str(num)
    numlist = list(numstring)
    if check(numlist, slist, clist):
        print(num)
        flag = 1
        break
if not flag:
    print(-1)
x, y, a, b, c = map(int, input().split())
La = sorted(list(map(int, input().split())), reverse=True)
Lb = sorted(list(map(int, input().split())), reverse=True)
Lc = sorted(list(map(int, input().split())), reverse=True)

L = La[:x]
L.extend(Lb[:y])
L.sort(reverse=False)

for i in range(c):
    if L[i] < Lc[i]:
        L[i] = Lc[i]

print(sum(L))


### FIXED CODE ###

x, y, a, b, c = map(int, input().split())
La = sorted(list(map(int, input().split())), reverse=True)
Lb = sorted(list(map(int, input().split())), reverse=True)
Lc = sorted(list(map(int, input().split())), reverse=True)

L = La[:x]
L.extend(Lb[:y])
L.sort(reverse=False)
min = min(c, len(L))

for i in range(min):
    if L[i] < Lc[i]:
        L[i] = Lc[i]

print(sum(L))
x = input().split(" ")
if x[0] <= x[1] :
    print(x[0])
else:
    print(x[0]-1)

### FIXED CODE ###

x = [int(i) for i in input().split(" ")]
if x[0] <= x[1] :
    print(x[0])
else:
    print(x[0]-1)
N=int(input())
v=[int(i) for i in input().split()]
v.sort()
 
res = v[0]
for i in range(1,N):
    res = (res+v[i])/2
print(res)

### FIXED CODE ###

a = int(input())
s = input()
if a>=3200:
  print(s)
else:
  print("red")
def oneCol(mat,n):
  ans = ""
  for i in range(len(mat)):
    ans = ans + mat[i][n]
  return ans

def strCut(s,n):
  return s[0:n] + s[n+1:len(s)]

def lowCut(mat):
  for i in range(len(mat)):
    if not "#" in mat[len(mat)-i-1]:
      delete mat[len(mat)-i-1]
  return mat

def colCut(mat):
  for i in range(len(mat[0])):
    if not "#" in oneCol(mat,len(mat[0])-i-1):
      mat2 = []
      for k in range(len(mat)):
        mat2.append(strCut(mat[k],len(mat[0])-i-1))
  return mat
      

H,W=map(int, input().split())
s_list = []
for i in range(H):
  s = input()
  if "#" in s: s_list.append(s)

    
while True:
  lowCut(mat)
  colCut(mat)
  print(mat)

### FIXED CODE ###

def rotate(mat):
  mat2 = []
  for i in range(len(mat[0])):
    s = ""
    for k in range(len(mat)):
      s = s + mat[k][i]
    mat2.append(s)
  return mat2

H,W=map(int, input().split())
mat = []
for i in range(H):
  a = input()
  if "#" in a:
    mat.append(a)

for count in range(H+W):
  for i in range(len(mat)-1, -1, -1):
    if not "#" in mat[i]:
      del mat[i]
  mat = rotate(mat)
  for i in range(len(mat)-1, -1, -1):
    if not "#" in mat[i]:
      del mat[i]
  mat = rotate(mat)
  
for i in range(len(mat)):
  print(mat[i])
n = int(input())
a = list(map(int, input().split()))
b =[]
for i in range(n):
  b.append(1/a[n])
c = sum(b)
print(1/c)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
b =[]
for i in range(n):
  b.append(1/a[i])
c = sum(b)
print(1/c)