#include <bits/stdc++.h>
using namespace std;
int read() {
  int n = 0, sign = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') sign = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    n = n * 10 + c - '0';
    c = getchar();
  }
  return n * sign;
}
const int Mod = 1000000007;
unsigned long long solve() {
  string s;
  cin >> s;
  int len = s.size();
  unsigned long long F = 0llu, suq = 0llu, sum = 0llu, ak = 0llu, a1 = 0llu,
                     K = 1llu;
  for (int i = 0; i < len; ++i) {
    F = 100 * F + 100 * suq + 220 * sum + 70 * (ak + Mod - a1) % Mod +
        56 * (K - 1);
    F %= Mod;
    suq = 200 * suq + 220 * sum + 65 * (K - 1);
    suq %= Mod;
    sum = 20 * sum + 11 * (K - 1);
    sum %= Mod;
    if (s[i] ^ '4') {
      F += ((ak * 10 + 4) % Mod) * ((ak * 10 + 7) % Mod);
      F %= Mod;
      suq += ((ak * 10 + 4) % Mod) * ((ak * 10 + 4) % Mod);
      suq %= Mod;
      sum += ak * 10 + 4;
      sum %= Mod;
    }
    ak = ak * 10 + s[i] - '0';
    ak %= Mod;
    a1 = a1 * 10 + 4;
    a1 %= Mod;
    K = (K + Mod - 1) * 2;
    K += s[i] == '4' ? 1 : 2;
    K %= Mod;
  }
  return F;
}
int main() {
  ios ::sync_with_stdio(false);
  unsigned long long res = -solve();
  res += solve();
  cout << (res + Mod) % Mod << endl;
  return 0;
}
