405141: GYM101806 S Segmentation

Memory Limit:1024 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

S. Segmentationtime limit per test1 secondmemory limit per test1024 megabytesinputstandard inputoutputstandard output

ZOYI is developing a tool called Channel which offers a tool to talk with online users in the site. Recently, ZOYI introduced a RF(Recency / Frequency) Model to distinguish users who are using the Channel and decided to classify the users through following calculations.

Figure : Distinguishing users in RF Channel. Horizontal axis represents Recency, while vertical axis represents Frequency.

(0 < f1 < f2 < f3 < f4, 0 < r1 < r2 < r3 < r4, all fi and ri are integers.)

x axis represents Recency and y axis represents Frequency. All online users are given values r,  f by their connection record, and are classified into one of twelve conditions shown below.

  • "New Customer"
  • "Promising"
  • "About to Sleep"
  • "Hibernating"
  • "Lost"
  • "Potential Loyalist"
  • "Need Attention"
  • "About to Leave"
  • "Champion"
  • "Loyal Customer"
  • "Can't Lose Them"
  • "None"

Among those, "None" means the user has no connection record to the server. If (r,  f) is located on two or more classification boundaries, it follows the classification of (r - 0.5, f - 0.5). For example, if the value of (r,  f) is (r4,  f2) it is classified as "Hibernating", while if the value is (r3,  f4), it is classified as "Loyal Customer".

You want to investigate users' statuses who are interested in RUN, so you are trying to install the program in the following way :

  • r: if the current time is t,
  • f: number of visited times

Given events of site users, make a program which classifies the users following the given picture above.

Input

First line contains four space-separated integers r1,  r2,  r3,  r4. (0 < r1 < r2 < r3 < r4 ≤ 10, 000)

Second line consists four space-separated integers f1,  f2,  f3,  f4. (0 < f1 < f2 < f3 < f4 ≤ 10, 000)

Third line contains a single integer N. (1 ≤ N ≤ 100, 000)

Next N lines contains events in time order, where ith element represents the event held at time i.

Each event is given as space-separated A and B, where B is the username which contains no whitespace with at most 10 alphabets. A has a value of 1 or 2, where 1 means the user entered the site while 2 means you should print how the user is classified.

Output

For events where A is 2, print how the user is classified in each line (without quotes).

ExampleInput
1 2 3 4
1 2 3 4
8
1 RUN
1 Alex
2 Alex
1 RUN
1 RUN
1 Alex
2 Alex
2 RUN
Output
New Customer
Potential Loyalist
Need Attention
Note

The connection status of Alex is f = 1 (first visit), r = 1 (time 3 - 2 = 1) at time 3. Thus, Alex is classified as "New Customer".

At time 7, the connection status of Alex is f = 2 (second visit), r = 1 (time 7 - 6 = 1). Thus, Alex is classified as "Potential Loyalist".

At time 8, the connection status of RUN is f = 3 (third visit), r = 3 (time 8 - 5 = 3). Thus, RUN is classified as "Need Attention".

加入题单

算法标签: