L = str(input())

n = len(L)
MOD = 10**9+7
 
dp = [[0]*2 for i 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 == 1:
        dp[ni][nk] += (dp[i][k]*2)%MOD
      else:
        dp[ni][nk] += (dp[i][k])%MOD
        
#print(dp)
print(sum(dp[-1])%MOD) L = str(input()) L str(input()) str input() input n = len(L) n len(L) len L MOD = 10**9+7 MOD 10**9+7 10**9 10 9 7 [0]*2 for i in range(n+1) for i in range(n+1) i range(n+1) range n+1 n 1 for i in range(n+1) [0]*2 [0] 0 2 dp = [[0]*2 for i in range(n+1)] dp [[0]*2 for i 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 == 1:
        dp[ni][nk] += (dp[i][k]*2)%MOD
      else:
        dp[ni][nk] += (dp[i][k])%MOD
        
#print(dp) 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 == 1:
        dp[ni][nk] += (dp[i][k]*2)%MOD
      else:
        dp[ni][nk] += (dp[i][k])%MOD
        
#print(dp) 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 == 1:
        dp[ni][nk] += (dp[i][k]*2)%MOD
      else:
        dp[ni][nk] += (dp[i][k])%MOD
        
#print(dp) 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 == 1:
        dp[ni][nk] += (dp[i][k]*2)%MOD
      else:
        dp[ni][nk] += (dp[i][k])%MOD
        
#print(dp) d == 1 d 1 dp[ni][nk] += (dp[i][k]*2)%MOD dp[ni][nk] [ni] dp ni nk (dp[i][k]*2)%MOD dp[i][k]*2 dp[i][k] [i] dp i k 2 MOD dp[ni][nk] += (dp[i][k])%MOD dp[ni][nk] [ni] dp ni nk (dp[i][k])%MOD dp[i][k] [i] dp i k MOD print(sum(dp[-1])%MOD) print sum(dp[-1])%MOD sum(dp[-1]) sum dp[-1] dp -1 MOD n = len(L) len(L) n ni = i+1 i+1 ni MOD = 10**9+7 10**9+7 MOD nk = 1 1 nk L = str(input()) str(input()) L dp = [[0]*2 for i in range(n+1)] [[0]*2 for i in range(n+1)] dp nk = k k nk nd = int(L[i]) int(L[i]) nd
L = str(input())

n = len(L)
MOD = 10**9+7
 
dp = [[0]*2 for i 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 == 1:
        dp[ni][nk] += (dp[i][k]*2)%MOD
      else:
        dp[ni][nk] += (dp[i][k])%MOD
        
#print(dp)
print(sum(dp[-1])%MOD)