Programming contests

Magas szintű programozási nyelvek 1, egyéni verseny, 2014. április 13.

April 13, 2014, 10:15 AM – April 13, 2014, 3:15 PM

One-Two-Three

Your little brother has just learnt to write one, two, and three, in English. He has written a lot of those words in a paper, and your task is to recognize them. Note that your little brother is only a child, so he may make small mistakes: for each word, there might be at most one wrong letter. The word length is always correct. It is guaranteed that each letter he wrote is in lowercase, and each word he wrote has a unique interpretation.

Input Specification

The first line of the input contains the number of words that your little brother has written. Each of the following lines contains a single word with all letters in lowercase. The words satisfy the constraints above: at most one letter might be wrong, but the word length is always correct. There will be at most 10 words in the input.

Output Specification

For each test case, print the numerical value of the word on a line by itself.

Sample Input

  1. 3
  2. owe
  3. too
  4. theee
download as text file

Output for Sample Input

  1. 1
  2. 2
  3. 3
download as text file
University of Debrecen; Faculty of Informatics; v. 09/30/2024