n = int(input()) m = int(input()) edges = [[] for _ in range(n)] sum_c = [0] * n for _ in range(m): a, b, c = map(int, input().split()) edges[a].append((b, c)) sum_c[a] += c current = [10.0] * n for _ in range(100): next_pop = [0.0] * n for u in range(n): total = sum_c[u] for (v, c) in edges[u]: contribution = current[u] * (c / total) next_pop[v] += contribution current = next_pop for val in current: print("{0:.6f}".format(val))