A control tower relays status messages, but throttles repeats: a given message text may be relayed at most once per cooldown window of w time units. A message is ALLOWed if it has never been relayed, or if at least w units have passed since it was last relayed (that is, the current time is greater than or equal to its last-allowed time plus w). Otherwise it is BLOCKed. Every ALLOWed message updates its last-allowed time to the current time; a BLOCKed message does not.
Input format
Line 1: two integers q and w.
Next q lines: each is t msg, a timestamp t and a message text msg (lowercase letters and digits, no spaces). Timestamps are given in non-decreasing order.
Output format
For each of the q messages, in order, print ALLOW or BLOCK on its own line.
Constraints
- 1 <= q <= 40
- 1 <= w <= 1000000
- 0 <= t <= 1000000, non-decreasing
- 1 <= length of msg <= 12