Input format not understood

please elabrote input format

1 2
1 has 2 children now move to its childrens
2 2
2 has two children (als 2 is children of 1)
3 0
3 is one of the children of 2 and it has zero children means leaf node
4 0
4 is 2nd children of 2 and it has zero children means leaf node
5 2
5 is 2nd children of 1 and it has two children 6 and 7 see next two lines
6 0
7 0
2 (this is the level no)