a, b = map(int, input().split())
if b - a > 10:
print(0)
else:
d = 1
for i in range(a+1, b+1):
d = d * i % 10
print(d)
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
typedef long long ll;
#define go() ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
const int M=1e9+7;
int add(int a,int b)
{
return (a%M+b%M)%M;
}
ll multi(ll a,ll b,ll m)
{
return (a%m*b%m)%m;
}
ll factorial(ll n,ll x)
{
int ans=1;
return ( x == 0 ) ? 1 : multi(n , factorial(n - 1 , x - 1) , 10);
}
int main()
{
go();
ll a,b; cin>>a>>b;
ll x=b-a;
if(x>10) cout<<0<<endl;
else cout<<(factorial(b,x)%10);
}
991B - Getting an A | 246A - Buggy Sorting |
884A - Book Reading | 1180A - Alex and a Rhombus |
445A - DZY Loves Chessboard | 1372A - Omkar and Completion |
159D - Palindrome pairs | 981B - Businessmen Problems |
1668A - Direction Change | 1667B - Optimal Partition |
1668B - Social Distance | 88B - Keyboard |
580B - Kefa and Company | 960A - Check the string |
1220A - Cards | 897A - Scarborough Fair |
1433B - Yet Another Bookshelf | 1283B - Candies Division |
1451B - Non-Substring Subsequence | 1408B - Arrays Sum |
1430A - Number of Apartments | 1475A - Odd Divisor |
1454B - Unique Bid Auction | 978C - Letters |
501B - Misha and Changing Handles | 1496A - Split it |
1666L - Labyrinth | 1294B - Collecting Packages |
1642B - Power Walking | 1424M - Ancient Language |