def extract_arguments(fh):
    N = int(fh.readline().strip())
    A = list(map(int, fh.readline().strip().split()))
    cables = []
    for _ in range(N - 1):
        U, V = map(int, fh.readline().strip().split())
        cables.append((U, V))
    return N, A, cables