public static ArrayList<ArrayList<Integer>> pathSum(TreeNode root, int sum) {
		List<List<Integer>> rel=new ArrayList<>();
		if (root!=null)
			pathSumHelper(root, sum, new ArrayList<>(), rel);
		ArrayList<ArrayList<Integer>> r=new ArrayList<>();
		for (List<Integer> i:rel)
			r.add((ArrayList<Integer>)i);
		return r;
	}