#P1051E. Vasya and Big Integers

    ID: 5065 Type: RemoteJudge 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: 10 Uploaded By: Tags>binary searchdata structuresdphashingstrings*2600

Vasya and Big Integers

Description

Vasya owns three big integers — a,l,ra, l, r. Let's define a partition of xx such a sequence of strings s1,s2,,sks_1, s_2, \dots, s_k that s1+s2++sk=xs_1 + s_2 + \dots + s_k = x, where ++ is a concatanation of strings. sis_i is the ii-th element of the partition. For example, number 1234512345 has the following partitions: ["1", "2", "3", "4", "5"], ["123", "4", "5"], ["1", "2345"], ["12345"] and lots of others.

Let's call some partition of aa beautiful if each of its elements contains no leading zeros.

Vasya want to know the number of beautiful partitions of number aa, which has each of sis_i satisfy the condition lsirl \le s_i \le r. Note that the comparison is the integer comparison, not the string one.

Help Vasya to count the amount of partitions of number aa such that they match all the given requirements. The result can be rather big, so print it modulo 998244353998244353.

The first line contains a single integer a (1a101000000)a~(1 \le a \le 10^{1000000}).

The second line contains a single integer l (0l101000000)l~(0 \le l \le 10^{1000000}).

The third line contains a single integer r (0r101000000)r~(0 \le r \le 10^{1000000}).

It is guaranteed that lrl \le r.

It is also guaranteed that numbers a,l,ra, l, r contain no leading zeros.

Print a single integer — the amount of partitions of number aa such that they match all the given requirements modulo 998244353998244353.

Input

The first line contains a single integer a (1a101000000)a~(1 \le a \le 10^{1000000}).

The second line contains a single integer l (0l101000000)l~(0 \le l \le 10^{1000000}).

The third line contains a single integer r (0r101000000)r~(0 \le r \le 10^{1000000}).

It is guaranteed that lrl \le r.

It is also guaranteed that numbers a,l,ra, l, r contain no leading zeros.

Output

Print a single integer — the amount of partitions of number aa such that they match all the given requirements modulo 998244353998244353.

Sample Input 1

135
1
15

Sample Output 1

2

Sample Input 2

10000
0
9

Sample Output 2

1

Note

In the first test case, there are two good partitions 13+513+5 and 1+3+51+3+5.

In the second test case, there is one good partition 1+0+0+0+01+0+0+0+0.