Building a tree from the given input

how to build tree from the given code?

1 2
2 2
3 0
4 0
5 2
6 0
7 0