n = int(input()) m = int(input()) # Initialize outgoing links and sum of weights for each page outgoing = [[] for _ in range(n)] sum_c = [0] * n for _ in range(m): a, b, c = map(int, input().split()) outgoing[a].append((b, c)) sum_c[a] += c # Initialize current population current = [10.0] * n # Simulate for 100 steps for _ in range(100): next_people = [0.0] * n for u in range(n): people = current[u] if people == 0.0: continue total = sum_c[u] for (v, c) in outgoing[u]: contribution = people * (c / total) next_people[v] += contribution current = next_people # Print the result with 6 decimal places for val in current: print("{0:.6f}".format(val))