Amagi Brilliant Contests runs a business making and hosting contests on its online platform to competitive programmers who want to run their own contests.
From their last contest, ABC has some submissions they need to rejudge to ensure an accurate score. The submissions each have their own status code. The four types of status codes that occurred during the contest were AC
, WA
, TLE
, and IR
.
When the submissions are rejudged, all of the existing AC
will stay AC
; the first (rounded down) WA
will turn to AC
and the rest will stay WA
; all existing TLE
will turn to WA
; and up to the first IR
will turn to AC
, up to the next will turn to WA
, and the rest will stay IR
.
You are the head of the technical troubleshooting department at Amagi Brilliant Contests, and so you have been tasked with determining the final list of status codes after rejudging (the initial list is given in order of rejudging).
Constraints
Input Specification
The first line of input will have , the number of status codes.
The next lines of input will each contain a status code in the order that they are rejudged. A status code is guaranteed to be one of AC
, WA
, TLE
, or IR
.
Output Specification
There should be lines of output, each containing the new status code of the corresponding submission after rejudging, in the order they are rejudged.
Sample Input 1
4
AC
AC
TLE
IR
Sample Output 1
AC
AC
WA
AC
Explanation for Sample Output 1
The first two AC
s stayed the same, the TLE
turned to WA
, and the IR
turned to AC
.
Sample Input 2
21
IR
IR
IR
WA
IR
WA
IR
IR
IR
IR
WA
IR
IR
WA
IR
WA
IR
IR
IR
WA
IR
Sample Output 2
AC
AC
AC
AC
AC
WA
AC
AC
AC
AC
WA
AC
AC
WA
WA
WA
WA
WA
WA
WA
WA
Comments
The statement: "the first 30% (rounded down) WA will turn to AC" is a little bit misleading. Do you mean the first 30% of submissions or first 30% of WA submissions?
Though the statement could be made more clear, it is not ambiguous.
You know that it is the first of
WA
submissions because the rest of the sentence goes:I didn't understand why my submissions were slower than BobHob's, so I copy and pasted his and submitted it, and it was as slow as mine (0.5), yet it says his submission was 0.3.
Does the judging change after the contest is over?
The times are only a rough guideline. There are multiple judges, and each may be slightly faster/slower than the others. However, for most problems it is guaranteed that a correct solution will not time out on all the judges it can be judged on.