Hide

Problem B
Heimilisverk

Languages en is
/problems/heimilisverk/file/statement/en/img-0001.jpg
Image from Oliver Tacke

Ómar is a very responsible boy and has a list of chores he needs to do. The problem is that Ómar is very lazy, so the list of unfinished chores has become quite long. So long, in fact, that he does not remember what chores he has already put on the list and has thus put duplicates into the list every now and then.

Now he finally intends to do some chores from the list, but he doesn’t want to repeat himself. Can you help him remove duplicate chores from his list? That is to say, if it appears more than once, he only wants the first instance of it to remain on the list.

Input

The first line of the input contains the positive integer $N$, denoting the number of chores on the list. Then there are $N$ lines, each with one chore.

Output

The output should contain the filtered list, with one chore from the list on each line. The order matters and should be like in the input.

Scoring

The solution will be tested on input data of varying difficulty and the data is divided into groups as shown in the table below. The solution will then be scored according to how many groups are solved.

Group

Points

Constraints

1

20

$N \leq 10$, Each line is at most $10$ characters

2

20

$N \leq 10^5$, Each line is at most $2$ characters

3

20

$N \leq 10^5$, Each line is at most $10$ characters

4

20

$N \leq 10^3$, Each line is at most $1000$ characters

5

20

$N \leq 10^6$, The total number of characters in the input is at most $10^6$

Sample Input 1 Sample Output 1
4
Skuragolfid
Takatil
Skuragolfid
Thrifabilinn
Skuragolfid
Takatil
Thrifabilinn
Sample Input 2 Sample Output 2
2
Takaurvelinni
Ryksuga
Takaurvelinni
Ryksuga
Sample Input 3 Sample Output 3
5
Takatil
Takatil
Takatil
Takatil
Takatil
Takatil

Please log in to submit a solution to this problem

Log in