import java.util.*;

public class Main {
    
    static void mycmd(String[] args) {
        System.out.println("You ran: " + String.join(" ", args));
    }
    
    static List<String> mycompletions(String[] words, int cword) {
        String[] options = {"start", "stop", "restart", "status", "file"};
        String cur = words[cword];
        List<String> matches = new ArrayList<>();
        for (String opt : options) {
            if (cur.isEmpty() || opt.startsWith(cur)) {
                matches.add(opt);
            }
        }
        return matches;
    }
    
    public static void main(String[] args) {
        
        // Simulate tab completion for "st"
        String[] words1 = {"mycmd", "st"};
        List<String> suggestions1 = mycompletions(words1, 1);
        System.out.println("Input: st → Suggestions: " + String.join(" ", suggestions1));
        
        // Simulate tab completion for "re"
        String[] words2 = {"mycmd", "re"};
        List<String> suggestions2 = mycompletions(words2, 1);
        System.out.println("Input: re → Suggestions: " + String.join(" ", suggestions2));
        
        // Simulate tab completion for "s"
        String[] words3 = {"mycmd", "s"};
        List<String> suggestions3 = mycompletions(words3, 1);
        System.out.println("Input: s → Suggestions: " + String.join(" ", suggestions3));
        
        // Run the actual command
        mycmd(new String[]{"hello", "world"});
    }
}