Increasing Costs

아직 제출이 없습니다시간 제한2초메모리 제한256 MB

문제

Berland consists of nn cities labeled from 11 to nn. The city number 11 is the capital of Berland. There are mm two-way roads between some cities. Roads can intersect only in cities. There is no more than one road between each pair of cities, and there is no road that connects a city to itself. If you are moving by jj-th road in any direction, you have to pay the tax equal to c_jc\_j. It is possible to reach any city from the capital using only the given mm roads.

You are the CEO of a delivery company, its main office is located in the capital. Your company delivers different goods to every city of Berland, so for each city, you chose some route from the capital to that city which minimized the total sum of taxes of all roads in the route. Let d_kd\_k be the total cost of the chosen route from the capital to city kk.

The government has decided to choose exactly one road (you don't know which one) and increase the tax for using it. So, for each road, you want to know how many cities will be affected if the tax for using this road is increased. City kk is affected if, after the tax is increased, you can't choose a route such that the total cost of this route is equal to d_kd\_k.

입력

The first line contains two integers nn and mm: the number of cities and the number roads in Berland (2n21052 \le n \le 2 \cdot 10^{5}, n1m2105n - 1 \le m \le 2 \cdot 10^{5}).

Each of the next mm lines contains three space-separated integers: u_ju\_j, v_jv\_j, and c_jc\_j (1u_j,v_jn1 \le u\_j, v\_j \le n, 1c_j1091 \le c\_j \le 10^{9}). These mean that the road number jj between cities u_ju\_j and v_jv\_j initially has tax equal to c_jc\_j.

There is no more than one road between each pair of cities, and there is no road that connects a city to itself. It is guaranteed that it is possible to reach every city from the capital using the given roads.

출력

Print mm integers, one per line. The jj-th integer must be the number of cities affected by increasing the cost of jj-th road.