n = int(input()) m = int(input()) # Initialize data structures to hold links and their sums links = [[] for _ in range(n)] sum_c = [0] * n for _ in range(m): a, b, c = map(int, input().split()) links[a].append((b, c)) sum_c[a] += c # Precompute the ratio for each link out_links = [[] for _ in range(n)] for a in range(n): total = sum_c[a] for (b, c) in links[a]: ratio = c / total out_links[a].append((b, ratio)) # Initialize current people current = [10.0] * n # Simulate 100 iterations for _ in range(100): next_people = [0.0] * n for a in range(n): people = current[a] for (b, ratio) in out_links[a]: next_people[b] += people * ratio current = next_people # Print the results formatted to six decimal places for val in current: print("{0:.6f}".format(val))