def extract_arguments(fh):
    N = int(fh.readline().strip())
    g = list(map(int, fh.readline().strip().split()))
    roads = []
    for _ in range(N - 1):
        a, b, d = map(int, fh.readline().strip().split())
        roads.append((a, b, d))
    return N, g, roads