def stations_by_river(stations):
    """
    returns a river and its corresponding rivers

    Inputs
    ------
    stations: list of MonitoringStation objects

    Returns
    ------
    a dictionary in the form {river : list of stations corresponding to the river}
    """
    
    river_list = list(set([station.river for station in stations]))
    river_dict = {}
    for river in river_list:
        station_list = []
        for station in stations: 
            if station.river == river:
                station_list.append(station.name)
        river_dict[river] = station_list
    return river_dict