def aquifer_demand(aquifer_area_sqkm, num_correlated_wells):
    """
    Calculates the aquifer demand
    """
    if aquifer_area_sqkm is None or num_correlated_wells == 0:
        return 'L'

    num_wells_per_km_sq = num_correlated_wells / aquifer_area_sqkm
    if num_wells_per_km_sq <= 4:
        return 'L'
    elif num_wells_per_km_sq > 20:
        return 'H'
    else:
        return 'M'