import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class AbbreviationsEasy {
    private static final Scanner input = new Scanner(System.in);
    private static final String  COMMAND_TABLE
            =       "  Add ALTer  BAckup Bottom  CAppend Change SCHANGE  CInsert CLAst COMPress COpy\n" +
                    " COUnt COVerlay CURsor DELete CDelete Down DUPlicate Xedit EXPand EXTract Find\n" +
                    " NFind NFINDUp NFUp CFind FINdup FUp FOrward GET Help HEXType Input POWerinput\n" +
                    " Join SPlit SPLTJOIN  LOAD  Locate CLocate  LOWercase UPPercase  LPrefix MACRO\n" +
                    " MErge MODify MOve MSG Next Overlay PARSE PREServe PURge PUT PUTD  Query  QUIT\n" +
                    " READ  RECover REFRESH RENum REPeat  Replace CReplace  RESet  RESTore  RGTLEFT\n" +
                    " RIght LEft  SAVE  SET SHift SI  SORT  SOS  STAck STATus TOP TRAnsfer Type Up";

    public static void main(String[] args) {
        String[]             cmdTableArr = COMMAND_TABLE.split("\\s+");
        Map<String, Integer> cmd_table   = new HashMap<String, Integer>();

        for (String word : cmdTableArr) {