There is No Alternative

No attempts yetTime limit3sMemory limit256 MB

Problem

ICPC (Isles of Coral Park City) is made up of several islands. The residents asked the city to build bridges between the islands so that they no longer depend on boats, and they require that every island be reachable from every other island over one or more bridges.

The mayor picked a number of island pairs and had a construction company estimate the cost of a bridge for each pair. He now has to decide which bridges to build so that all the islands are connected and the total construction cost is as small as possible.

Several different sets of bridges can reach that same minimum total cost. The mayor decided to start by building only the bridges that appear in every minimum cost set. Such a bridge is called a no alternative bridge.

Given the candidate bridges and their costs, write a program that reports how many no alternative bridges there are and what their construction costs add up to.

Input

The input consists of a single test case.

N M
S1 D1 C1
.
.
.
SM DM CM

The first line contains the number of islands NN and the number of island pairs MM that a bridge may be built between. Each island is identified by an integer from 11 to NN.

Each of the next MM lines contains three integers SiS_i, DiD_i and CiC_i (1iM1 \le i \le M), meaning that building the bridge between island SiS_i and island DiD_i costs CiC_i.

3N5003 \le N \le 500, N1Mmin(50000,N(N1)/2)N - 1 \le M \le \min(50000, N(N-1)/2), 1Si<DiN1 \le S_i < D_i \le N, and 1Ci100001 \le C_i \le 10000. No two bridges connect the same pair of islands, that is, if iji \ne j and Si=SjS_i = S_j, then DiDjD_i \ne D_j. If all the candidate bridges are built, every island is reachable from every other island over one or more bridges.

Output

Print the number of no alternative bridges and the sum of their construction costs on one line, separated by a space.