private void sub (String s, int start, List<List<String>> ret, List<String> tmp)
    {
    	if (start == s.length())
    	{
    		ret.add(new ArrayList<String>(tmp));
    		return;
    	}
    	
        for (int end = start + 1; end <= s.length(); ++end)
        {
            String curr = s.substring(start, end);
            if (isValid(curr, 0, curr.length()-1))
            {
            	tmp.add(curr);
            	sub(s, end, ret, tmp);
            	tmp.remove(tmp.size()-1);
            }
        }
    }