Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/kopaytmaning-oxirgi-raqami

Last digit of a product

Easy 1000 ms 64 MB 10%
Share

Positive integers $a$ and $b$ are given. Find the last digit of their product $a * b$.

The last digits of the two numbers are highlighted; the last digit of the product is found

Input

One line with two positive integers: $a$ and $b$.

Output

One digit — the last digit of $a * b$.

Note

$1 \le a, b \le 10^{18}$

Examples

Input #1
127 43
Output #1
1
Input #2
25 1000000000000000000
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.