## GlobeX Cup '19 J3 - Codex

View as PDF

Points: 5 (partial)
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

Alex is creating a codex (list), , of all the planets known in the universe and their sizes. However, since there are so many of them, he wants to remove all planets such that , where and are arbitrary indexes.

#### Input Specification

The first line will contain two integers, () and ().

The next lines will each contain a string, (), the planet's name, followed by a space, followed by an integer, (), the diameter in kilometers of the planet.

#### Output Specification

The output will contain the space separated names of all the planets in Alex's codex, in lexicographical order.

#### Sample Input

4 2
Planet 100
AnotherPlanet 50
3rdPlanet 2
4thPlanet 3

#### Sample Output

AnotherPlanet Planet