F. BASIL
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
The photos in our album... They're not just photos. They're real memories. Our memories! It's proof of our friendship! Hold those pictures close... and remember what you want to protect.
— Basil, ???

Basil wants to play a game with his best friend Sunny; he starts by explaining the rules to him.

The game is played on an array of $$$n$$$ flower pots, where the $$$i$$$-th pot $$$(1 \le i \le n)$$$ has two values $$$a_i$$$, $$$t_i$$$, denoting the number of seeds initially in the $$$i$$$-th flower pot and the type of seeds in this flower pot, respectively.

During a move, the player has to choose a flower pot which has a non-zero number of seeds; let the index of this flower pot be $$$i$$$ $$$(1 \le i \le n)$$$, then he will do two things:

  1. Pick a positive integer value $$$x$$$ $$$(1 \le x \le a_i)$$$ and decrease $$$a_i$$$ by $$$x$$$ (Choose some non-zero number of seeds from some flower pot and remove them).
  2. For every flower pot $$$j$$$ such that $$$t_j \lt t_i$$$, you can set the value of $$$a_j$$$ to any non-negative integer of your choice; it can still be the original value of $$$a_j$$$ before the move (For every flower pot that has a seed type value less than the value of the type of the seeds you removed, you can either increase, do nothing to, or decrease the number of each of those flower pots to any number of your choice as Basil has an infinite supply of seeds of every type, but the number of seeds has to be non-negative after every change in each pot).

The player who can not make a move loses, and Sunny goes first.

Sunny and Basil are going to play $$$q$$$ matches; the $$$j$$$-th match $$$(1 \le j \le q)$$$ is going to be played on the subarray from index $$$l_j$$$ to index $$$r_j$$$, inclusive.

Assuming both Sunny and Basil are playing optimally, your task is to find which player wins in each of the $$$q$$$ matches.

Input

The first line of input contains one integer $$$n$$$ $$$(1 \le n \le 2\times 10^5)$$$ — The number of flower pots.

The next line contains $$$n$$$ integers $$$a_1, a_2, ..., a_n$$$ $$$(0 \le a_i \le 10^9)$$$ separated by spaces — The number of seeds in each flower pot.

The next line contains $$$n$$$ integers $$$t_1, t_2, ..., t_n$$$ $$$(1 \le t_i \le n)$$$ separated by spaces — The type of seeds in each flower pot.

The next line contains one integer $$$q$$$ $$$(1 \le q \le 2\times 10^5)$$$ — The number of matches played.

The $$$j$$$-th of the next $$$q$$$ lines contains two integers $$$l_j, r_j$$$ $$$(1 \le l_j \le r_j \le n)$$$ — The boundaries of the subarray on which the $$$j$$$-th match will be played.

Output

For each of the $$$q$$$ matches, output one line containing the name of the winner; output "SUNNY" (without quotes) if the winner was Sunny and "BASIL" (without quotes) otherwise.

Examples
Input
6
1 2 3 3 2 1
1 1 1 1 1 1
6
3 4
2 5
1 6
1 3
4 6
5 6
Output
BASIL
BASIL
BASIL
BASIL
BASIL
SUNNY
Input
3
1 1 1
1 2 3
2
1 2
1 3
Output
SUNNY
SUNNY
Note

In the first match in the second sample, there are two flower pots each having only one seed; one of them is of type $$$1$$$ and the other is of type $$$2$$$. Sunny can choose to take the seed from the flower pot of type $$$2$$$ and then set the number of seeds in the flower pot of type $$$1$$$ to $$$0$$$, making every pot empty and thus winning as Basil will not be able to do a move after Sunny's turn.

Basil explaining the rules of the game to Sunny