Codeforces Round 439 (Div. 2)
B
The Eternal Immortality
Codeforces
1100
原题
← AC →
翻译中…

Even if the world is full of counterfeits, I still regard it as wonderful.

翻译中…

Pile up herbs and incense, and arise again from the flames and ashes of its predecessor — as is known to many, the phoenix does it like this.

翻译中…

The phoenix has a rather long lifespan, and reincarnates itself once every $*a*!$ years. Here $*a*!$ denotes the factorial of integer $*a*$, that is, $*a*! = 1 × 2 × ... × *a*$. Specifically, $0! = 1$.

翻译中…

Koyomi doesn't care much about this, but before he gets into another mess with oddities, he is interested in the number of times the phoenix will reincarnate in a timespan of $*b*!$ years, that is, image. Note that when $*b* ≥ *a*$ this value is always integer.

翻译中…

As the answer can be quite large, it would be enough for Koyomi just to know the last digit of the answer in decimal representation. And you're here to provide Koyomi with this knowledge.

翻译中…

Input

翻译中…

The first and only line of input contains two space-separated integers $*a*$ and $*b*$ ($0 ≤ *a* ≤ *b* ≤ 10^{18}$).

翻译中…

Output

翻译中…

Output one line containing a single decimal digit — the last digit of the value that interests Koyomi.

翻译中…

Note

翻译中…

In the first example, the last digit of image is $2$;

翻译中…

In the second example, the last digit of image is $0$;

翻译中…

In the third example, the last digit of image is $2$.

翻译中…

样例

Input #1
2 4
Output #1
2
InputCopy OutputCopy
Input #2
0 10
Output #2
0
InputCopy OutputCopy
Input #3
107 109
Output #3
2
InputCopy OutputCopy
题目信息
题号
869B
时间限制
1 s
内存限制
256 MB
标签
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。