private void printResult (ArrayList<String> list) {
        System.out.println("Result: ");
        for(String elem: list) {
            String answer = getWordFromShifted(elem);
            System.out.print("# " + answer);
            System.out.println(" : " + invertIndex.get(answer).toString());
        }
    }