시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB74457.143%

문제

In positional base-$d$ notation, an integer $K = (A_1 A_2 \ldots A_m)_d$ (where $A_i \in [0, d)$ and $A_1 \neq 0$) is called \textit{good} if and only if $A_1, \ldots, A_m$ is a permutation of integers from $0$ to $d - 1$.

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

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

입력

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

출력

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

예제 입력 1

5 20

예제 출력 1

3

예제 입력 2

123456 123456789

예제 출력 2

114480