public List<String> dfs(List<String> result, String s, int index, String one){
        if(index == 4 && !isValid(s)) return result;
        else if(index == 4){
            result.add(one + "." + s);
            return result;
        }
        
        for(int i=1; i<=3 && i<s.length(); i++){
            String input = one;
            if(isValid(s.substring(0, i))){
                if(input == "") input += s.substring(0, i);
                else input += "." + s.substring(0, i);
                result = dfs(result, s.substring(i), index+1, input);
            }
        }
        return result;
    }