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:
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
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:
It is guaranteed that all inputs are valid and follow the above formats.
For each prophecy, print "JUAN" if Juan is predicted to win, or "FRANK" if Frank is predicted to win.
10 71 2 3 4 5 6 7 8 9 10P 1 2P 1 3P 1 4R 3 1P 1 5P 1 6P 1 7
FRANK JUAN FRANK FRANK JUAN FRANK