TCCC '24 June P3 - Ruining Research

View as PDF

Submit solution

Points: 5
Time limit: 2.0s
Memory limit: 256M

Author:
Problem type

Richard is conducting an study where participants are given a series of N (2 \le N \le 10^5) words. If they have not seen the word before, they mark it with the word NEW. If they have, that word is marked SEEN. However, you know Richard secretly works for an evil organization trying to collect your data, so you decide to cheat to ruin the experiment's results and stop their plans. Can you do it?

Input Specification

The first line will contain the integer N.
The next N lines each contain a string S_i consisting only of uppercase letters. This string will not be longer than 10 characters.

Output Specification

Output N lines containing either SEEN or NEW, depending on if the corresponding string has occurred before or not.

Sample Input

4
EGG
NEST
EGG
FLOCK

Sample Output

NEW
NEW
SEEN
NEW

Sample Explanation

The first word EGG has not been seen before, so the answer is NEW.
When it occurs again as the 3rd word, it has been seen once before, so the answer is SEEN.


Comments

There are no comments at the moment.