def extract_arguments(fh):
    n, m = map(int, fh.readline().strip().split())
    c = list(map(int, fh.readline().strip().split()))
    roads = [tuple(map(int, fh.readline().strip().split())) for _ in range(m)]
    return n, m, c, roads