**Compilation/Execution Result:**

Top view of a binary tree is the set of nodes visible when the tree is viewed from the top. You are required to complete the function **topView**, which should print the top view of the given binary tree.

```
1
/ \
2 3
/ \ / \
4 5 6 7
Top view of the above binary tree is
4 2 1 3 7
```

**Note:** For the problem the printing should be level wise, i.e. starting node should be root.

**Input:**

The first line of the input contains a single integer **T **denoting the number of test cases. For each test a root node is given to the **topView** function. The only input to the function is the **root** of the binary Tree.

**Output:**

For each test case output in a single line, top view of the binary tree.

**Constraints:**

1<=T<=100

1<=N<=50

**Example:
Input:**

2

2

1 2 L 1 3 R

5

10 20 L 10 30 R 20 40 L 20 60 R 30 90 L

**Output:**

1 2 3

10 20 30 40

**Explanation:**

**Test case 1:**

1

/ \

2 3

For the above test case the top view is: 1 2 3

**Test case 2:**

10

/ \

20 30

/ \ /

40 60 90

TopView is: 10 20 30 40

**Note:**The **Input/Ouput** format and **Example** given are used for system's internal purpose, and should be used by a user for **Expected Output** only. As it is a function problem, hence a user should not read any input from stdin/console. The task is to complete the function specified, and not to write the full code.

Author: Harshit Sidhwa

Shashank_Pathak | 200 |

surbhi_7 | 168 |

yati493 | 167 |

SANJAY5797 | 164 |

dark_knights | 162 |

surbhi_7 | 556 |

Shashank_Pathak | 556 |

dark_knights | 501 |

Infinty | 341 |

Vasudha Gupta | 308 |

akhayrutdinov | 4156 |

sanjay05 | 3597 |

Quandray | 2778 |

Ibrahim Nash | 2475 |

Michael Riegger | 2280 |