public static void main(String[] args) {
        Random r = new Random();
        for (int times = 0; times < 100; ++times) {
            HashSet<String> D = new HashSet<String>();
            String s;
            if(args.length == 1) {
                s = args[0];
            } else {
                s = rand_string(r.nextInt(10) + 1);
            }
            int n = r.nextInt(10000) + 1;
            while(n-- > 0) {
                D.add(rand_string(r.nextInt(10) + 1));
            }
            System.out.println(s + " shortest prefix = " + find_shortest_prefix(s, D));
            assert(find_shortest_prefix(s, D).equals(check_ans(s, D)));
        }
    }