{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003ch2\u003e\u003c/h2\u003e\n\n\u003cp\u003e\nACM is an organization of programming contests. The purpose of ACM does not matter to you. The only important thing is that workstyles of ACM members are polarized: each member is either a workhorse or an idle fellow.\n\u003c/p\u003e\n\n\u003cp\u003e\nEach member of ACM has a motivation level. The members are ranked by their motivation levels: a member who has a higher motivation level is ranked higher. When several members have the same value of motivation levels, the member who joined ACM later have a higher rank. The top 20% highest ranked members work hard, and the other (80%) members never (!) work. Note that if 20% of the number of ACM members is not an integer, its fraction part is rounded down.\n\u003c/p\u003e\n\n\u003cp\u003e\nYou, a manager of ACM, tried to know whether each member is a workhorse or an idle fellow to manage ACM. Finally, you completed to evaluate motivation levels of all the current members. However, your task is not accomplished yet because the members of ACM are dynamically changed from day to day due to incoming and outgoing of members. So, you want to record transitions of members from workhorses to idle fellows, and vice versa.\n\u003c/p\u003e\n\n\u003cp\u003e\nYou are given a list of the current members of ACM and their motivation levels in chronological order of their incoming date to ACM. You are also given a list of incoming/outgoing of members in chronological order.\n\u003c/p\u003e\n\n\u003cp\u003e\nYour task is to write a program that computes changes of workstyles of ACM members.\n\u003c/p\u003e\n\n\u003ch3\u003eInput\u003c/h3\u003e\n\n\u003cp\u003e\nThe first line of the input contains a single integer $N$ ($1 \\leq N \\leq 50,000$) that means the number of initial members of ACM. The ($i$ + 1)-th line of the input contains a string $s_i$ and an integer $a_i$ ($0 \\leq a_i \\leq 10^5$), separated by a single space. $s_i$ means the name of the $i$-th initial member and $a_i$ means the motivation level of the $i$-th initial member. Each character of $s_i$ is an English letter, and $1 \\leq |s_i| \\leq 20$. Note that those $N$ lines are ordered in chronological order of incoming dates to ACM of each member.\n\u003c/p\u003e\n\n\u003cp\u003e\nThe ($N$ + 2)-th line of the input contains a single integer $M$ ($1 \\leq M \\leq 20,000$) that means the number of changes of ACM members. The ($N$ + 2 + $j$)-th line of the input contains information of the $j$-th incoming/outgoing member. When the $j$-th information represents an incoming of a member, the information is formatted as \"$+ t_j b_j$\", where $t_j$ is the name of the incoming member and $b_j$ ($0 \\leq b_j \\leq 10^5$) is his motivation level. On the other hand, when the $j$-th information represents an outgoing of a member, the information is formatted as \"$- t_j$\", where $t_j$ means the name of the outgoing member. Each character of $t_j$ is an English letter, and $1 \\leq |t_j| \\leq 20$. Note that uppercase letters and lowercase letters are distinguished. Note that those $M$ lines are ordered in chronological order of dates when each event happens.\n\u003c/p\u003e\n\n\u003cp\u003e\nNo two incoming/outgoing events never happen at the same time. No two members have the same name, but members who left ACM once may join ACM again.\n\u003c/p\u003e\n\n\u003ch3\u003eOutput\u003c/h3\u003e\n\u003cp\u003e\nPrint the log, a sequence of changes in chronological order. When each of the following four changes happens, you should print a message corresponding to the type of the change as follows:\n\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e Member $name$ begins to work hard : \"$name$ is working hard now.\"\u003c/li\u003e\n\u003cli\u003e Member $name$ begins to not work : \"$name$ is not working now.\"\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003e\nFor each incoming/outgoing, changes happen in the following order:\n\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e Some member joins/leaves.\u003c/li\u003e\n\u003cli\u003e When a member joins, the member is added to either workhorses or idle fellows.\u003c/li\u003e\n\u003cli\u003e Some member may change from a workhorse to an idle fellow and vice versa. Note that there are no cases such that two or more members change their workstyles at the same time.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4\nDurett 7\nGayles 3\nFacenda 6\nDaughtery 0\n1\n+ Mccourtney 2\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eMccourtney is not working now.\nDurett is working hard now.\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n\n\u003cp\u003e\nInitially, no member works because $4 \\times 20$% $\u0026lt; 1$. When one member joins ACM, Durrett begins to work hard.\n\u003c/p\u003e\n\n\n\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\nBurdon 2\nOrlin 8\nTrumper 5\n1\n+ Lukaszewicz 7\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eLukaszewicz is not working now.\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n\n\u003cp\u003eNo member works.\u003c/p\u003e\n\n\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5\nAndy 3\nBob 4\nCindy 10\nDavid 1\nEmile 1\n3\n+ Fred 10\n- David\n+ Gustav 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eFred is working hard now.\nCindy is not working now.\nGustav is not working now.\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n\n\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e7\nLaplant 5\nVarnes 2\nWarchal 7\nDegregorio 3\nChalender 9\nRascon 5\nBurdon 0\n7\n+ Mccarroll 1\n- Chalender\n+ Orlin 2\n+ Chalender 1\n+ Marnett 10\n- Chalender\n+ Chalender 0\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eMccarroll is not working now.\nWarchal is working hard now.\nOrlin is not working now.\nChalender is not working now.\nMarnett is working hard now.\nWarchal is not working now.\nChalender is not working now.\nWarchal is working hard now.\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003cp\u003e\nSome member may repeat incoming and outgoing.\n\u003c/p\u003e\n\n\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4\nAoba 100\nYun 70\nHifumi 120\nHajime 50\n2\n- Yun\n- Aoba\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e(blank)\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n"}}]}