public String notReplace(String str) {
        String result = "";
        for (int i = 0; i < str.length(); ) {
            if ((i == 0 || !Character.isLetter(str.charAt(i-1))) && i+2 <= str.length() && (i+3 > str.length() || !Character.isLetter(str.charAt(i+2))) && str.charAt(i) == 'i' && str.charAt(i+1) == 's') {
                result += "is not";
                i += 2;
            } else {
                result += String.valueOf(str.charAt(i++));
            }
        }
        return result;
    }