import java.util.Arrays;

public class Dictionary {
    
    static String[] allWords = {
        "TYPE English German French",
     /* ---------------------------- */
        "DET the der le",
        "DET a ein un",
        "NOUN table Tisch table",
        "NOUN chair Stuhl chaise",
        "NOUN person Mann personne",
        "NOUN man Mann homme",
        "NOUN woman Frau femme",
        "NOUN child Kind enfant",
        "NOUN tree Baum arbre",
        "NOUN book Buch livre",
        "PREP on auf sur",
        "ADJ big gross grande",
        "ADJ small klein petit",
        "ADJ red rot rouge",
        "ADJ blue blau bleu",
        "VERB sees sieht voit",
        "VERB runs lauft court",
        "VERB thinks denkt pense",
        "VERB understands versteht comprehend",
        "VERB laughs lacht rit",
        "VERB sleeps schlaft dort",
        "VERB is ist est",
        "VERB has hat a"
    };
    
    /**
     * Returns a list of words in the given language. Similar words
     * in different languages occupy the same position in the word list.
     * 
     * @param language One of "TYPE", "English", "German", or "French".
     * @return A list of words in the specified language, or (for "TYPE"),
     *         the corresponding part of speech.
     */
    public static String[] getWordList(String language) {
        String[] languages = allWords[0].split(" ");
        int column = -1;
        for (int i = 0; i < languages.length; i++) {
            if (languages[i].equals(language)) {
                column = i;
                break;
            }
        }
        if (column < 0) {
            throw new IllegalArgumentException(language);
        }
        String wordList[] = new String[allWords.length - 1];
        for (int i = 1; i < allWords.length; i++) {
            wordList[i - 1] = allWords[i].split(" ")[column];
            
        }
        return wordList;
    }
}
