```
class Solution(object):
def findSecondMinimumValue(self, root):
self.ans = 0xffffffff
def dfs(r):
if not r:
return
if r.val == root.val:
dfs(r.left)
dfs(r.right)
else:
self.ans = min(r.val, self.ans)
dfs(root)
return self.ans if self.ans != 0xffffffff else -1
```