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

N = x[0]

A = x[1]

B = x[2]

ans = 0

for i in range(N):

  i = i+1

  to_int = [int(i) for i in list(str(i))]

  X = sum(to_int)

  if (X >= A) & (X <= B) :

    ans += i

print(ans)
x = [int(x) for x in input().split()]

N = x[0]

A = x[1]

B = x[2]

def check(x):

  ans = 0

  while x >= 10:

    ans += x%10

    x = x//10  

  ans += x

  return ans

ans1 = 0

for i in range(N):

  i = i+1

  if (check(i) >= A) & (check(i) <= B):

    ans1 += i



print(ans1)
x = [int(x) for x in input().split()]
N = x[0]
A = x[1]
B = x[2]
ans = 0
for i in range(N):
    i = i + 1
    to_int = [int(i) for i in list(str(i))]
    X = sum(to_int)
    if (X >= A) & (X <= B):
        ans += i
print(ans)

x = [int(x) for x in input().split()]
N = x[0]
A = x[1]
B = x[2]


def check(x):
    ans = 0
    while x >= 10:
        ans += x % 10
        x = x // 10
    ans += x
    return ans


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

-ans = 0 + + +def check(x): +    ans = 0 +    while x >= 10: +        ans += x % 10 +        x = x // 10 +    ans += x +    return ans + + +ans1 = 0 -    to_int = [int(i) for i in list(str(i))] -    X = sum(to_int) -    if (X >= A) & (X <= B): -        ans += i -print(ans) +    if (check(i) >= A) & (check(i) <= B): +        ans1 += i +print(ans1)