def most_similar(train,
                 test,
                 distances):
    """
        get the most similar program name
        Parameters
        ----------
        train: list
            a list of string containing names of training programs
        test: list
            a list containing names of test programs
        distances: matrix 
            matrix of distances where distances[i][j]
            is the distance of train[i] to test[j]
        
        Return
        ------
        a list bench_list where bench_list[i] is the name of the
        closest program from train of test[i]
    """

    bench_list = {}#[None for i in range(len(test))]
    for j in range(len(test)):
        bench = train[0]
        dist = distances[0][j]
        for i in range(len(train)):
            #print(train[i],test[j],distances[i][j])
            if distances[i][j] < dist:
                bench = train[i]
                dist = distances[i][j]
        bench_list[test[j]] = bench

    return bench_list