Roger is addicted to the game Fire Emblem Heroes! His main hero is Hector, who has ~h_H~ health and deals ~d_H~ damage per turn. Hector is up against a foe who deals ~d_F~ damage per turn, and has ~h_F~ health. However, Hector's special, Buckler, activates every 4th turn and negates all damage done against him in that turn, as well as continues to deal the regular amount of damage.
Given ~N~ of these enemies, can you find out who will come out victorious if Hector attacks first, and how many turns it will take?
Note: assume the turn counter, as well as Hector's health, reset with each foe.
Subtask 1 [60%]
~1 \le N \le 1\,000~
~1 \le h_H, d_H, h_F, d_F \le 100~
Subtask 2 [40%]
~1 \le N \le 10^6~
~1 \le h_H, d_H, h_F, d_F \le 10^9~
Line ~1~: Three space separated integers, ~N~, ~h_H~, and ~d_H~.
Lines ~2 \ldots N + 1~: Two space separated integer, the ~h_F~ and ~d_F~ for each foe.
~N~ lines, of the format
Win x if Hector wins in ~x~ turns, or
Lose x, if Hector loses in ~x~ turns.
4 12 5 4 2 999 999 5 12 20 3
Win 1 Lose 1 Win 1 Win 4