You are given a directed graph with $$$n$$$ nodes and $$$m$$$ edges. The color of the $$$i$$$-th edge is $$$c_i$$$.
We call a path (does not have to be a simple path) colorful iff it does not have two consecutive edges of the same color.
Find all nodes $$$x$$$ such that there exist a colorful path starting from $$$1$$$ and ending at $$$x$$$.
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^5$$$) — the number of test cases. The description of the test cases follows.
The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 10^6$$$, $$$0 \le m \le 10^6$$$) — the number of nodes and the number of edges.
Next $$$m$$$ lines describe edges: $$$i$$$-th line contains three integers $$$u_i, v_i, c_i$$$ ($$$1 \le u_i, v_i, \le n$$$; $$$u_i \ne v_i$$$; $$$1 \le c_i \le m$$$) — defining the edge from $$$u_i$$$ to $$$v_i$$$ of color $$$c_i$$$.
The sum of $$$n$$$ and the sum of $$$m$$$ over all test cases does not exceed $$$10^6$$$.
For each test case, output all the nodes $$$x$$$ such that there exist a colorful path starting from $$$1$$$ and ending at $$$x$$$ in ascending order.
45 61 2 12 3 12 4 24 2 33 4 33 5 13 21 3 12 1 15 51 2 12 3 23 4 34 2 22 5 11 0
1 2 3 4 1 3 1 2 3 4 5 1