J. Juan vs Frank
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

In ancient times, when the gods still contested the fate of mankind, two immortal brothers clashed in a sacred ritual: Juan, Lord of Chaos, and Frank, Guardian of Order. Before them stood $$$n$$$ ancestral columns, each filled with fragments of divine power.

The brothers played these duels to see who would rule over the mortal realm.

Each duel was foretold by a prophecy, specifying the columns from $$$l$$$ to $$$r$$$. Within this range, the brothers engaged in their duel under unbreakable laws:

  • Frank always starts the duel.
  • The players alternate turns.
  • On their turn, a player had to choose one column and remove any positive number of fragments from it.
  • The one who faced an empty field, with no fragments left to remove, was defeated.
  • Both players play optimally.

The high priests, gifted with the power of foresight, have recorded $$$Q$$$ events. Each event is either:

- A prophecy, foretelling a duel over a range of columns $$$(l,r)$$$.

- A ritual, adding $$$x$$$ fragments to column $$$k$$$, altering its power.

Now, the temple calls upon you to ensure the chronicles of Order and Chaos remain true

Input

The first line contains two integers $$$N$$$ and $$$Q$$$ $$$(1 \le N, Q \le 10^6)$$$ — the number of columns and the number of events.

The second line contains $$$N$$$ integers $$$B_1, B_2, \dots, B_N$$$ $$$(1 \le B_i \le 10^9)$$$ — the initial values of the columns.

Each of the next $$$Q$$$ lines contains a single event in one of the following formats:

  • P l r the character P denotes a prophecy on the range $$$[l, r]$$$ $$$(1 \le l \le r \le N)$$$.
  • R k x the character R denotes a ritual, adding the integer $$$x$$$ to the $$$k$$$-th column $$$(1 \le k \le N, -10^9 \le x \le 10^9)$$$.

It is guaranteed that all inputs are valid and follow the above formats.

Output

For each prophecy, print "JUAN" if Juan is predicted to win, or "FRANK" if Frank is predicted to win.

Example
Input
10 7
1 2 3 4 5 6 7 8 9 10
P 1 2
P 1 3
P 1 4
R 3 1
P 1 5
P 1 6
P 1 7
Output
FRANK
JUAN
FRANK
FRANK
JUAN
FRANK