Birthday Numbers II

Add up the products of every neighboring pair among the integers between x and y that use only the digits 3, 5 and 8, and report the total modulo 19980305.

Hard8MathRecursionCombinatoricsStringNo attempts yetTime limit1sMemory limit256 MB

Problem

Seunghyun was born on March 5, 1998, so he is very fond of the digits 3, 5 and 8 that appear in his birth date. He decided to call a positive integer a birthday number when its decimal representation consists of the digits 3, 5 and 8 only. For example, 3, 533 and 858553 are birthday numbers, while 3518, 1642 and 88808 are not.

You are given two birthday numbers xx and yy (x<yx < y). List every birthday number that is at least xx and at most yy in increasing order as a1,a2,,aka_1, a_2, \dots, a_k, and write a program that computes a1×a2+a2×a3++ak1×aka_1 \times a_2 + a_2 \times a_3 + \cdots + a_{k-1} \times a_k. Handling huge numbers is always a bother, so print the value modulo 1998030519980305, which is Seunghyun's birth date.

Input

The first line contains xx and the second line contains yy. Neither line contains any character other than '3', '5' and '8'. (x<y10200000x < y \le 10^{200000})

Output

Print a1×a2+a2×a3++ak1×aka_1 \times a_2 + a_2 \times a_3 + \cdots + a_{k-1} \times a_k modulo 1998030519980305 on the first line.