Nice Numbers

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

In positional base-dd notation, an integer K=(A_1A_2A_m)_dK = (A\_1 A\_2 \ldots A\_m)\_d (where A_i\[0,d)A\_i \in \[0, d) and A_10A\_1 \neq 0) is called \textit{good} if and only if A_1,,A_mA\_1, \ldots, A\_m is a permutation of integers from 00 to d1d - 1.

A number KK is \textit{nice} if and only if there exists at least one d2d \geq 2 such that KK is good in positional base-dd notation.

Calculate the number of nice numbers in the interval \[L,R]\[L, R]. As the answer may be very large, find it modulo 998,244,353998\\,244\\,353.

입력

The first line of the input contains two integers LL and RR (1LR1050001 \leq L \leq R \leq 10^{5000}).

출력

Print a single line with a single integer: the answer modulo 998,244,353998\\,244\\,353.