#include <bits/stdc++.h>
using namespace std;
int s1[100005], s2[100005];
int n;
long long ans;
long long calc(int *s) {
  long long ret = 0, sum = 0, a1 = 0, ak = 0, k = 0, sq = 0;
  for (int i = 1; i <= n; i++) {
    ret = 100 * ret % 1000000007 + 100 * sq % 1000000007 +
          220 * sum % 1000000007 + 70 * (ak - a1) % 1000000007 +
          56 * (k - 1) % 1000000007;
    ret = (ret % 1000000007 + 1000000007) % 1000000007;
    sq = 200 * sq % 1000000007 + 220 * sum % 1000000007 +
         65 * (k - 1) % 1000000007;
    sq = (sq % 1000000007 + 1000000007) % 1000000007;
    sum = 20 * sum % 1000000007 + 11 * (k - 1) % 1000000007;
    sum = (sum % 1000000007 + 1000000007) % 1000000007;
    if (s[i] == 7) {
      ret = (ret + (ak * 10 + 4) % 1000000007 * ((ak * 10 + 7) % 1000000007) %
                       1000000007) %
            1000000007;
      sq = (sq + (ak * 10 + 4) % 1000000007 * ((ak * 10 + 4) % 1000000007) %
                     1000000007) %
           1000000007;
      sum = (sum + ak * 10 + 4) % 1000000007;
    }
    ak = (ak * 10 + s[i]) % 1000000007;
    a1 = (a1 * 10 + 4) % 1000000007;
    k = (k - 1) * 2;
    if (s[i] == 4)
      k++;
    else
      k += 2;
    k = (k % 1000000007 + 1000000007) % 1000000007;
  }
  return ret;
}
int main() {
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') {
    s1[++s1[0]] = c - '0';
    ++n;
    c = getchar();
  }
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') {
    s2[++s2[0]] = c - '0';
    c = getchar();
  }
  ans = calc(s2);
  ans -= calc(s1);
  ans = (ans % 1000000007 + 1000000007) % 1000000007;
  printf("%lld", ans);
  return 0;
}
