def rivers_with_station(stations):
    """For a list of MonitoringStation objects (stations),
    returns a set object containing the names of the rivers monitored by the given stations."""

    # Set with the river names. Using "set" objects prevents duplicate names.
    rivers = set()

    for station in stations:
        # Add name to set
        rivers.add(station.river)

    return rivers