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 < 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 ai is the i-th (in increasing order) number of them. Find a1·a2 + a2·a3 + ... + an - 1·an. As the answer can be rather large, print the remainder after dividing it by 1000000007 (109 + 7).

Input

The first line contains a positive integer l, and the second line contains a positive integer r (1 ≤ l < r ≤ 10100000). 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.

Output

In the single line print a single integer — the answer to the problem modulo 1000000007 (109 + 7).

Examples

Input

4
7


Output

28


Input

474
777


Output

2316330
#include <bits/stdc++.h>
using namespace std;
long long ans;
long long cnt[101000];
long long sum[101000];
long long ten[101000];
long long mn[101000];
long long mx[101000];
long long mulp[101000];
long long tmp[101000];
long long valA[101000];
long long valB[101000];
long long sumA[101000];
long long sumB[101000];
long long binA[101000];
long long binB[101000];
int minA, maxA, minB, maxB;
int SZ;
char a[101000], b[101000];
char *ff, *fs, *ss, *sf;
char *A, *B;
bool isMax(char* aa) {
  if (aa == ss) return 1;
  if (aa == ff || aa == fs || aa == sf) return 0;
  if (aa - a >= 0 && aa - a < SZ) return aa - a >= maxA;
  if (aa - b >= 0 && aa - b < SZ) return aa - b >= maxB;
  return false;
}
bool isMin(char* aa) {
  if (aa == ff) return 1;
  if (aa == fs || aa == sf || aa == ss) return 0;
  if (aa - a >= 0 && aa - a < SZ) return aa - a >= minA;
  if (aa - b >= 0 && aa - b < SZ) return aa - b >= minB;
  return false;
}
long long getSum(char* aa, char* origin, int sz) {
  if (origin == (char*)ff) {
    return mn[sz];
  }
  if (origin == (char*)fs) {
    return (sum[sz - 1] + ((4 * ten[sz - 1]) % 1000000007LL) * cnt[sz - 1]) %
           1000000007LL;
  }
  if (origin == (char*)sf) {
    return (((sum[sz - 1] + ((4 * ten[sz - 1]) % 1000000007LL) * cnt[sz - 1]) %
             1000000007LL) +
            7 * ten[sz - 1] + mn[sz - 1]) %
           1000000007LL;
  }
  if (origin == (char*)ss) {
    return sum[sz];
  }
  if (aa - a >= 0 && aa - a < SZ) return sumA[aa - a];
  if (aa - b >= 0 && aa - b < SZ) return sumB[aa - b];
}
long long toVal(char* aa, char* origin, int sz) {
  if (origin == (char*)ff) {
    return mn[sz];
  }
  if (origin == (char*)fs) {
    return (mx[sz - 1] + 4 * ten[sz - 1]) % 1000000007LL;
  }
  if (origin == (char*)sf) {
    return (mn[sz - 1] + 7 * ten[sz - 1]) % 1000000007LL;
  }
  if (origin == (char*)ss) {
    return mx[sz];
  }
  if (aa - a >= 0 && aa - a < SZ) return valA[aa - a];
  if (aa - b >= 0 && aa - b < SZ) return valB[aa - b];
  long long ret = 0;
  for (int i = 0; i < sz; i++) {
    ret = ret * 10 + (a[i] - '0');
    ret %= 1000000007LL;
  }
  return ret;
}
bool eq7(char* origin, int i) {
  if (origin == (char*)ff) {
    return 0;
  }
  if (origin == (char*)fs) {
    return i;
  }
  if (origin == (char*)sf) {
    return i == 0;
  }
  if (origin == (char*)ss) {
    return 1;
  }
  return origin[i] == '7';
}
bool eq4(char* origin, int i) {
  if (origin == (char*)ff) {
    return 1;
  }
  if (origin == (char*)fs) {
    return i == 0;
  }
  if (origin == (char*)sf) {
    return i;
  }
  if (origin == (char*)ss) {
    return 0;
  }
  return origin[i] == '4';
}
int ext(char* origin, int i) {
  if (origin == ff) return 4;
  if (origin == fs) return i == 0 ? 4 : 7;
  if (origin == sf) return i == 0 ? 7 : 4;
  if (origin == ss) return 7;
  return origin[i] - '0';
}
long long getDist(char* p, int idx, int sz) {
  if (p - a >= 0 && p - a < SZ) {
    return binA[p - a + idx];
  }
  if (p - b >= 0 && p - b < SZ) {
    return binB[p - b + idx];
  }
  if (p == ff) {
    return 0;
  }
  if (p == ss) {
    return (cnt[sz - idx] - 1) % 1000000007LL;
  }
  if (p == sf) {
    if (idx) return 0;
    return cnt[sz - idx];
  }
  if (p == fs) {
    if (idx) return cnt[sz - idx] - 1;
    return cnt[sz - idx - 1] - 1;
  }
}
bool eq(char* a, char* b) {
  if (a == b) return true;
  if (a == ff || a == fs || a == sf || a == ss) {
    if (b == ff || b == fs || b == sf || b == ss)
      return a == b;
    else {
      if (a == ff) return isMin(b);
      if (a == ss) return isMax(b);
      if (a == sf) return isMin(b + 1) && b[0] == '7';
      if (a == fs) return isMax(b + 1) && b[0] == '4';
    }
  } else {
    if (b == ff)
      return isMin(a);
    else if (b == fs)
      return isMax(a + 1) && a[0] == '4';
    else if (b == sf)
      return isMin(a + 1) && a[0] == '7';
    else if (b == ss)
      return isMax(a);
    return strcmp(a, b) == 0;
  }
  return false;
}
void solve(char* a, char* ora, char* b, char* orb, int sz) {
  if (eq(a, b)) return;
  if (ext(a, 0) == ext(b, 0)) {
    long long mul = 0;
    long long dif = 0;
    int idx = -1;
    for (int i = 0; i < sz; i++) {
      mul *= 10;
      if ((ext(a, i) == ext(b, i)) && idx == -1) mul += ext(a, i);
      if ((eq7(a, i) && eq4(b, i) || eq4(a, i) && eq7(b, i)) && idx == -1) {
        idx = i;
        break;
      }
      mul %= 1000000007LL;
    }
    mul *= ten[sz - idx - 1];
    mul %= 1000000007LL;
    dif = (getDist(b, idx, sz) - getDist(a, idx, sz)) % 1000000007LL;
    ans += (((mul * mul) % 1000000007LL) * dif) % 1000000007LL;
    char *nxta = a, *nxtb = b;
    if (a != ff && a != fs && a != sf && a != ss)
      nxta += idx;
    else {
      if (a == fs && idx) {
        nxta = ss;
        a = ss;
      }
      if (a == sf && idx) {
        nxta = ff;
        a = ff;
      }
    }
    if (b != ff && b != fs && b != sf && b != ss)
      nxtb += idx;
    else {
      if (b == fs && idx) {
        nxtb = ss;
        b = ss;
      }
      if (b == sf && idx) {
        nxtb = ff;
        b = ff;
      }
    }
    long long tmp =
        (1000000007LL +
         (getSum(nxtb, b, sz - idx) - getSum(nxta, a, sz - idx)) * 2 -
         toVal(nxtb, b, sz - idx) + toVal(nxta, a, sz - idx)) %
        1000000007LL;
    if (tmp < 0) tmp += 1000000007LL;
    ans += (tmp * mul) % 1000000007LL;
    ans %= 1000000007LL;
    solve(nxta, a, nxtb, b, sz - idx);
  } else {
    if (isMin(a) && isMax(b)) {
      ans += mulp[sz];
      ans %= 1000000007LL;
      return;
    }
    solve(a, a, (char*)fs, (char*)fs, sz);
    solve((char*)sf, (char*)sf, b, b, sz);
    ans += (toVal((char*)fs, (char*)fs, sz) * toVal((char*)sf, (char*)sf, sz)) %
           1000000007LL;
    ans %= 1000000007LL;
  }
}
int main() {
  ff = new char[2];
  *ff = 'c';
  *(ff + 1) = '\0';
  fs = new char[2];
  *fs = 'd';
  *(fs + 1) = '\0';
  ss = new char[2];
  *ss = 'e';
  *(ss + 1) = '\0';
  sf = new char[2];
  *sf = 'f';
  *(sf + 1) = '\0';
  cnt[0] = 1;
  sum[0] = 0;
  mulp[0] = 0;
  cnt[1] = 2;
  sum[1] = 11;
  mulp[1] = 28;
  ten[0] = 1;
  ten[1] = 10;
  mn[1] = 4;
  mx[1] = 7;
  for (int i = 2; i <= 100000; i++) {
    cnt[i] = (cnt[i - 1] * 2) % 1000000007LL;
    ten[i] = (ten[i - 1] * 10) % 1000000007LL;
    mn[i] = (mn[i - 1] * 10 + 4) % 1000000007LL;
    mx[i] = (mx[i - 1] * 10 + 7) % 1000000007LL;
    sum[i] =
        (sum[i - 1] * 2 + ((11 * ten[i - 1]) % 1000000007LL) * cnt[i - 1]) %
        1000000007LL;
    mulp[i] = (mulp[i - 1] * 2 +
               ((((mx[i - 1] + 4 * ten[i - 1]) % 1000000007LL) *
                 ((mn[i - 1] + 7 * ten[i - 1]) % 1000000007LL)) %
                1000000007LL) +
               (((((sum[i - 1] * 2 - mx[i - 1] - mn[i - 1]) % 1000000007LL) +
                  1000000007LL) %
                 1000000007LL) *
                ((11 * ten[i - 1]) % 1000000007LL)) +
               (((((4 * ten[i - 1]) % 1000000007LL) *
                  ((4 * ten[i - 1]) % 1000000007LL)) %
                 1000000007LL) +
                ((((7 * ten[i - 1]) % 1000000007LL) *
                  ((7 * ten[i - 1]) % 1000000007LL)) %
                 1000000007LL)) *
                   ((1000000007LL + cnt[i - 1] - 1) % 1000000007LL)) %
              1000000007LL;
    if (mulp[i] < 0) mulp[i] += 1000000007LL;
  }
  scanf("%s %s", a, b);
  int sz = strlen(a);
  SZ = sz;
  minA = maxA = minB = maxB = sz;
  for (int i = sz - 1; i >= 0; i--) {
    valA[i] = (ext(a, i) * ten[sz - i - 1] + valA[i + 1]) % 1000000007LL;
    binA[i] =
        (cnt[sz - 1 - i] * (a[i] == '7' ? 1 : 0) + binA[i + 1]) % 1000000007LL;
    if (a[i] == '7') {
      if (maxA == i + 1) maxA = i;
      sumA[i] = (sum[sz - 1 - i] +
                 ((ten[sz - 1 - i] * cnt[sz - 1 - i]) % 1000000007LL) * 4) %
                1000000007LL;
      sumA[i] += (ten[sz - 1 - i] * 7 * (binA[i + 1] + 1)) % 1000000007LL;
    } else {
      if (minA == i + 1) minA = i;
      sumA[i] = ten[sz - 1 - i] * 4 * (binA[i + 1] + 1);
    }
    sumA[i] = (sumA[i] + sumA[i + 1]) % 1000000007LL;
    valB[i] = (ext(b, i) * ten[sz - i - 1] + valB[i + 1]) % 1000000007LL;
    binB[i] =
        (cnt[sz - 1 - i] * (b[i] == '7' ? 1 : 0) + binB[i + 1]) % 1000000007LL;
    if (b[i] == '7') {
      if (maxB == i + 1) maxB = i;
      sumB[i] = (sum[sz - 1 - i] +
                 ((ten[sz - 1 - i] * cnt[sz - 1 - i]) % 1000000007LL) * 4) %
                1000000007LL;
      sumB[i] += (ten[sz - 1 - i] * 7 * (binB[i + 1] + 1)) % 1000000007LL;
    } else {
      if (minB == i + 1) minB = i;
      sumB[i] = ten[sz - 1 - i] * 4 * (binB[i + 1] + 1);
    }
    sumB[i] = (sumB[i] + sumB[i + 1]) % 1000000007LL;
  }
  A = a;
  B = b;
  solve(a, a, b, b, sz);
  cout << ans << endl;
}
