public static int minPress(String start, String end, String[] forbids) {
    String ff[][] = new String[forbids.length][];
    for (int i = 0; i < forbids.length; i++) {
      ff[i] = forbids[i].split(" ");
    }

//    int a1 = w2i("aaaa");
//    int a2 = w2i("zzzz");
//    System.out.println("aaaa="+a1+ " =>"+ i2w(a1));
//    System.out.println("zzzz="+a2+ " =>"+ i2w(a2));
    if (isForbid(ff, end)) return -1;
    int steps[] = new int[26 * 26 * 26 * 26];
    Arrays.fill(steps, 10000);
    steps[w2i(start)] = 0;
    for (int i = 0; i < 26 * 26; i++) {
      for (int j = 0; j < 26 * 26 * 26 * 26; j++) {
        if (steps[j] < 10000) {
          String next[] = getNext(i2w(j));
          for (String n : next)
            if (!isForbid(ff, n) && steps[j] + 1 < steps[w2i(n)]) {
              steps[w2i(n)] = steps[j] + 1;
              //   System.out.println("n="+n+" w="+w2i(n)+" s="+steps[w2i(n)]);
            }
        }
      }
    }
    System.out.println(steps[w2i(end)]);
    return steps[w2i(end)] == 10000 ? -1 : steps[w2i(end)];
  }