L = str(input())
mod =10**9+7

n = len(L)

dp = [[0]*2 for j in range(n+1)]
dp[0][0] = 1

for i in range(n):
    for k in range(2):
        nd = int(L[i])
        for d in range(2):
            ni = i+1
            nk = k
            if k == 0:
                if d > nd:
                    continue
                elif d < nd:
                    nk = 1
                else:
                    pass
            if d == 0:
                dp[ni][nk] += dp[i][k]
                dp[ni][nk] %= mod
            else:
                dp[ni][nk] += dp[i][k]*2
                dp[ni][nk] %= mod
print((dp[n][0]+dp[n][1])%mod) L = str(input()) L str(input()) str input() input mod =10**9+7 mod 10**9+7 10**9 10 9 7 n = len(L) n len(L) len L [0]*2 for j in range(n+1) for j in range(n+1) j range(n+1) range n+1 n 1 for j in range(n+1) [0]*2 [0] 0 2 dp = [[0]*2 for j in range(n+1)] dp [[0]*2 for j in range(n+1)] dp[0][0] = 1 dp[0][0] [0] dp 0 0 1 for i in range(n):
    for k in range(2):
        nd = int(L[i])
        for d in range(2):
            ni = i+1
            nk = k
            if k == 0:
                if d > nd:
                    continue
                elif d < nd:
                    nk = 1
                else:
                    pass
            if d == 0:
                dp[ni][nk] += dp[i][k]
                dp[ni][nk] %= mod
            else:
                dp[ni][nk] += dp[i][k]*2
                dp[ni][nk] %= mod i range(n) range n for k in range(2):
        nd = int(L[i])
        for d in range(2):
            ni = i+1
            nk = k
            if k == 0:
                if d > nd:
                    continue
                elif d < nd:
                    nk = 1
                else:
                    pass
            if d == 0:
                dp[ni][nk] += dp[i][k]
                dp[ni][nk] %= mod
            else:
                dp[ni][nk] += dp[i][k]*2
                dp[ni][nk] %= mod k range(2) range 2 nd = int(L[i]) nd int(L[i]) int L[i] L i for d in range(2):
            ni = i+1
            nk = k
            if k == 0:
                if d > nd:
                    continue
                elif d < nd:
                    nk = 1
                else:
                    pass
            if d == 0:
                dp[ni][nk] += dp[i][k]
                dp[ni][nk] %= mod
            else:
                dp[ni][nk] += dp[i][k]*2
                dp[ni][nk] %= mod d range(2) range 2 ni = i+1 ni i+1 i 1 nk = k nk k if k == 0:
                if d > nd:
                    continue
                elif d < nd:
                    nk = 1
                else:
                    pass
             k == 0 k 0 if d > nd:
                    continue
                elif d < nd:
                    nk = 1
                else:
                    pass
             d > nd d nd continue elif d < nd:
                    nk = 1
                 d < nd d nd nk = 1 nk 1 if d == 0:
                dp[ni][nk] += dp[i][k]
                dp[ni][nk] %= mod
            else:
                dp[ni][nk] += dp[i][k]*2
                dp[ni][nk] %= mod d == 0 d 0 dp[ni][nk] += dp[i][k] dp[ni][nk] [ni] dp ni nk dp[i][k] [i] dp i k dp[ni][nk] %= mod dp[ni][nk] [ni] dp ni nk mod dp[ni][nk] += dp[i][k]*2 dp[ni][nk] [ni] dp ni nk dp[i][k]*2 dp[i][k] [i] dp i k 2 dp[ni][nk] %= mod dp[ni][nk] [ni] dp ni nk mod print((dp[n][0]+dp[n][1])%mod) print (dp[n][0]+dp[n][1])%mod dp[n][0]+dp[n][1] dp[n][0] [n] dp n 0 dp[n][1] [n] dp n 1 mod nk = 1 1 nk L = str(input()) str(input()) L dp = [[0]*2 for j in range(n+1)] [[0]*2 for j in range(n+1)] dp nd = int(L[i]) int(L[i]) nd n = len(L) len(L) n mod =10**9+7 10**9+7 mod ni = i+1 i+1 ni nk = k k nk
L = str(input())
mod =10**9+7

n = len(L)

dp = [[0]*2 for j in range(n+1)]
dp[0][0] = 1

for i in range(n):
    for k in range(2):
        nd = int(L[i])
        for d in range(2):
            ni = i+1
            nk = k
            if k == 0:
                if d > nd:
                    continue
                elif d < nd:
                    nk = 1
                else:
                    pass
            if d == 0:
                dp[ni][nk] += dp[i][k]
                dp[ni][nk] %= mod
            else:
                dp[ni][nk] += dp[i][k]*2
                dp[ni][nk] %= mod
print((dp[n][0]+dp[n][1])%mod)
