There is a pond where n turtles live. The pond also has n houses, numbered from 1 to n, and exactly one turtle lives in each house. A traveling crayfish, who is a friend of every turtle, is coming to the pond and will stay in one of the houses. The crayfish wants to pick a house from which it can visit as many friends as possible.
Visiting a friend means traveling from the house where the crayfish is staying to that friend's house and then coming back. The crayfish does not count the turtle in whose house it stays.
The crayfish moves between houses along one-way routes, following these rules:
Write a program that reads the routes of the pond and, for each house, prints how many friends the crayfish could visit if it stayed in that house.
The first line contains two integers n and m (1≤n≤10000, 1≤m≤100000): the number of houses and the number of routes. Each of the next m lines describes one route with three integers a, b and s (1≤a,b≤n, a=b, s∈{0,1}). Here a is the starting house and b is the ending house of the route, and the route is special if and only if s=1.
Print exactly n lines. Line i must contain a single integer: the number of friends the crayfish could visit if it stayed in house i.
The figure below illustrates a pond with five houses and five routes.

If the crayfish stays in house 1, it can visit houses 2, 3 and 4. Staying in house 2, it can visit houses 3, 4 and 5; staying in house 3, houses 2, 4 and 5; staying in house 4, houses 2, 3 and 5. Staying in house 5, it can visit none of its friends.