public void tryNext(ArrayList<String> res, String s, int pos, ArrayList<String> has,
			Map<Integer, ArrayList<Integer>> pos2word) {
		if(pos == 0) {
			StringBuilder sb = new StringBuilder();
			for(int i = has.size() - 1; i > 0; i--) sb.append(has.get(i) + " ");
			sb.append(has.get(0));
			res.add(sb.toString());
			return;
		}
		if(!pos2word.containsKey(pos)) return;
		for(int pre : pos2word.get(pos)) {
		    String temp = s.substring(pre, pos);
		    has.add(temp);
		    tryNext(res, s, pre, has, pos2word);
		    has.remove(has.size() - 1);
		}
	}