Problem10306--CF EDU - DSU - Step 2 - H. Oil business

10306: CF EDU - DSU - Step 2 - H. Oil business

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 512 MiB

Description

You are given an undirected connected graph on $n$ vertices and $m$ edges. For each edge, you know the cost of deletion. You want to delete as many edges as possible so that the graph remains connected and the total cost of deleted edges does not exceed $s$.

Input

The first line of the input contains three integers $n, m, s\ (2 ≤n≤ 50 ,000,\ 1 ≤m≤ 100 ,000,\ 0 ≤s≤ 10^{18})$ — the number of vertices, the number of edges and the total provided cost, respectively.

Next $m$ lines contain a description of the edges, one per line. Each description consists of three integers — the ends of the edge and the cost of deletion that does not exceed $10^9$. There are no multi edges or loops in the graph.

Output

The first line of the output should contain the maximal number of deleted edges. 

The second line should contain the indices of the deleted edges. The edges are indexed from one and respect the input order.

Sample 1 Input

6 7 10
1 2 3
1 3 3
2 3 3
3 4 1
4 5 5
5 6 4
4 6 5

Sample 1 Output

2
1 6

HINT

CF EDU.

Source/Category