This is my python code

```
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
# @param {TreeNode} root
# @return {integer[]}
def __init__(self):
self.res = []
def rightSideView(self, root):
if not root:
return self.res
self.res.append(root.val)
def trav(node):
if node:
self.res.append(node.val)
trav(node.left)
trav(node.right)
trav(root.right)
return self.res
```

The result

Input: [1,2]

Output: [1]

Expected: [1,2]

What is wrong?