```
def pathSum(self, root, exp):
if not root:
return []
if not root.left and not root.right:
return [[root.val]] if root.val == exp else []
return [[root.val] + i for i in self.pathSum(root.left, exp-root.val)] + [[root.val] + i for i in self.pathSum(root.right, exp-root.val)]
```