'''

```
def flatten(self, root):
last=TreeNode(-1)
qstack=[root]
while qstack:
node=qstack.pop()
last.right=node
last.left=None
if node and node.right:
qstack.append(node.right)
if node and node.left:
qstack.append(node.left)
last=node
'''
```