```
class Solution(object):
inorder_sum = 0
def convertBST(self, root):
if(root != None):
self.convertBST(root.right)
root.val += self.inorder_sum
self.inorder_sum = root.val
self.convertBST(root.left)
return root
```