public void pathSumRec(TreeNode root, int sum, Stack<Integer> tmp) {
		if(root == null) return;
		if(root.left == null && root.right == null) {
			if(root.val == sum){
				res.add(new ArrayList(tmp));
			}
		}
		if(root.left != null){
			tmp.add(root.left.val);
			pathSumRec(root.left, sum - root.val, tmp);
			tmp.pop();
		}
		if(root.right != null){
			tmp.add(root.right.val);
			pathSumRec(root.right, sum - root.val, tmp);
			tmp.pop();
		}
    }