def rivers_with_station(stations):
    """Given list of MonitoringStation objects; returns a set of names of rivers
    with a monitoring station given in the original list."""

    output = set()

    for station in stations:
        output.add(station.river)

    return output