def read_file(name):
    """Given the path/nname of the file, return the list of the weights of the nodes.
    """
    file = open(name,'r')
    data = file.readlines()
    
    weights = [0]*(int(data[0])+1)
    for index,line in enumerate(data[1:]):
        item = line.split()
        weights[index+1] = int(item[0])
    
    return weights