HMs and TMs

No attempts yetTime limit1sMemory limit128 MB

Problem

Teaching a Pokémon a new move needs a hidden machine or a technical machine.

There are 8 hidden machines, HM01 to HM08, and 50 technical machines, TM01 to TM50.

Given a list of machines, write a program that finds the numbers of the Pokémon that can learn every move on the list.

Assume that only the Pokémon from number 1, Bulbasaur, to number 151, Mew, exist.

Input

The first line contains the number of moves NN (1N581 \le N \le 58).

Each of the next NN lines contains one move name. A hidden machine is written as HM01 and a technical machine as TM01.

Output

On the first line, print the numbers of the Pokémon that can learn every given move in ascending order, separated by single spaces.

Hint

The data follows Pokémon FireRed Version and uses the generation 3 move list at https://pokemondb.net/pokedex/bulbasaur/moves/3.