Everybody knows that lucky numbers are positive integers that contain only lucky digits 4 and 7 in their decimal representation. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.

Polo the Penguin have two positive integers *l* and *r* (*l* &lt; *r*), both of them are lucky numbers. Moreover, their lengths (that is, the number of digits in the decimal representation without the leading zeroes) are equal to each other.

Let's assume that *n* is the number of distinct lucky numbers, each of them cannot be greater than *r* or less than *l*, and *a*<sub class="lower-index">*i*</sub> is the *i*-th (in increasing order) number of them. Find *a*<sub class="lower-index">1</sub>·*a*<sub class="lower-index">2</sub> + *a*<sub class="lower-index">2</sub>·*a*<sub class="lower-index">3</sub> + ... + *a*<sub class="lower-index">*n* - 1</sub>·*a*<sub class="lower-index">*n*</sub>. As the answer can be rather large, print the remainder after dividing it by 1000000007 (10<sup class="upper-index">9</sup> + 7).
The first line contains a positive integer *l*, and the second line contains a positive integer *r* (1 ≤ *l* &lt; *r* ≤ 10<sup class="upper-index">100000</sup>). The numbers are given without any leading zeroes.

It is guaranteed that the lengths of the given numbers are equal to each other and that both of them are lucky numbers.
mod = 1000000007
N = 100000

two = [0] * (N + 1)
ten = [0] * (N + 1)
four = [0] * (N + 1)
seven = [0] * (N + 1)
prod = [0] * (N + 1)
sum_val = [0] * (N + 1)
Prod = [0] * (N + 1)
lar = [0] * (N + 1)
dp = [[False, False] for _ in range(N + 1)]
pa = [[-1, -1] for _ in range(N + 1)]

def init():
    two[0] = ten[0] = 1
    for i in range(1, N + 1):
        two[i] = 2 * two[i - 1] % mod
        ten[i] = 10 * ten[i - 1] % mod
    for i in range(1, N + 1):
        four[i] = (10 * four[i - 1] + 4) % mod
        seven[i] = (10 * seven[i - 1] + 7) % mod
    prod[1] = Prod[1] = 28
    sum_val[1] = 11
    for i in range(2, N + 1):
        prod[i] = (prod[i - 1] + 4 * ten[i - 1] % mod * (2 * sum_val[i - 1] - four[i - 1] - seven[i - 1]) % mod + 4 * ten[i - 1] % mod * 4 * ten[i - 1] % mod * (two[i - 1] - 1) + prod[i - 1] + 7 * ten[i - 1] % mod * (2 * sum_val[i - 1] - four[i - 1] - seven[i - 1]) % mod + 7 * ten[i - 1] % mod * 7 * ten[i - 1] % mod * (two[i - 1] - 1) + (4 * ten[i - 1] + seven[i - 1]) % mod * (7 * ten[i - 1] + four[i - 1]) % mod) % mod
        sum_val[i] = (2 * sum_val[i - 1] + 11 * ten[i - 1] % mod * two[i - 1] % mod) % mod
        Prod[i] = (Prod[i - 1] + prod[i] + seven[i - 1] * four[i] % mod) % mod

def sol(n, s):
    global pa, dp, lar
    pa = [[-1, -1] for _ in range(N + 1)]
    dp = [[False, False] for _ in range(N + 1)]
    
    if s[n - 1] >= '4':
        dp[n - 1][0] = True
    if s[n - 1] >= '7':
        dp[n - 1][1] = True
    
    for i in range(n - 2, -1, -1):
        if s[i] >= '4':
            if dp[i + 1][1]:
                dp[i][0] = True
                pa[i][0] = 1
            elif dp[i + 1][0]:
                dp[i][0] = True
                pa[i][0] = 0
        
        if s[i] >= '7':
            if dp[i + 1][1]:
                dp[i][1] = True
                pa[i][1] = 1
            elif dp[i + 1][0]:
                dp[i][1] = True
                pa[i][1] = 0
    
    now = 1 if dp[0][1] else 0 if dp[0][0] else -1
    lar[0] = now
    
    for i in range(1, n):
        now = pa[i - 1][now]
        lar[i] = now
    
    ans = Prod[n - 1]
    
    if now == -1:
        return ans
    
    now = 0
    las = 0
    
    if n > 1:
        las = seven[n - 2]
    
    for i in range(n):
        head = (10 * now + 4) % mod * ten[n - i - 1] % mod
        
        if lar[i] == 1:
            ans = (ans + las * (head + four[n - i - 1]) % mod + prod[n - i - 1] + head * (2 * sum_val[n - i - 1] - four[n - i - 1] - seven[n - i - 1]) % mod + head * head % mod * (two[n - i - 1] - 1) % mod) % mod
            las = (head + seven[n - i - 1]) % mod
        
        now = (10 * now + (4 if lar[i] == 0 else 7)) % mod
    
    ans = (ans + las * now) % mod
    return ans

def main():
    init()
    a = input()
    b = input()
    na = len(a)
    nb = len(b)
    result = ((sol(nb, b) - sol(na, a)) % mod + mod) % mod
    print(result)

if __name__ == "__main__":
    main()
