Andy is a famous explorer at Nanjing University second to none. One day he was trapped in a maze. The maze consisted of several rooms, and there was a precious gem in each room. There were also some bidirectional roads connecting some pairs of these rooms. It took some time to travel along the road in either direction.
Andy was in a room, but he didn't know which room he was in. Suddenly, he heard a low voice, saying that, "if you want to get out of the maze, you must collect kk gems." Andy wanted to know, what was the maximum possible time to get out of the maze, or it was impossible at all? Note that he couldn't visit the same room more than once.
Input
The first line of input consists of a single integer TT(1≤T≤35)(1≤T≤35), denoting the number of test cases. Each test case starts with a line of three integers n,m,kn,m,k(2≤n≤104,1≤m≤104,2≤k≤6)(2≤n≤104,1≤m≤104,2≤k≤6), denoting the number of rooms and the number of roads in the maze, and the number of gems he needed to collect, respectively. Each of the next mm lines contains three intergers u,v,tu,v,t(1≤u,v≤n,u≠v,1≤t≤108)(1≤u,v≤n,u≠v,1≤t≤108), specifying a road connecting the uuth and the vvth rooms, which took tt minutes to travel in either direction. No two roads connected the same pair of rooms. There are at most 5 test cases with max{n,m}>100max{n,m}>100.
Output
For each test case, print the maximum possible time in minute to get out of the maze in one line. If it was impossible to get out of the maze, print impossibleimpossible instead.