The n-th Fib number can be calculated using the following formula:
$fib(n) = \begin{cases}
a & \text{if } n = 1 \\\\
b & \text{if } n = 2 \\\\
fib(n-1) + fib(n-2) & \text{if } n \ge 3
\end{cases}$
**Task**: Given four positive integers $a$, $b$, $L$, and $R$ $(1 \leq a, b, L, R \leq 10^{18})$, find the last digit of $f(n)$.
#### Input
- The first line contains a positive integer $T$ $(1 \leq T \leq 10^5)$, which is the number of data sets.
- The following $T$ lines each contain four positive integers $a$, $b$, $L$, and $R$.
#### Output
- Print $T$ lines, each containing a single digit, which is the last digit of $f(n)$ for the corresponding input data set.
#### Example
Input:
```
2
1 1 1 3
1 1 3 3
```
Output:
```
4
2
```
#### Subtasks
- **Subtask 1 (40 points)**: $L \le R \leq 10^6$.
- **Subtask 2 (30 points)**: $R - L \leq 10^6$.
- **Subtask 3 (30 points)**: No additional constraints.