def get_valid_coastal_variant(split, possible_orders):
    """Find a variation on the `split` order that is in `possible_orders`
    Args:
        - split: a list of order string components,
                 e.g. ["F", "AEG", "S", "F", "BUL", "-", "GRE"]
        - possible_orders: a list of order strings,
                e.g. ["F AEG S F BUL/SC - GRE", "F AEG H", "F AEG - GRE", ...]
    This function tries variations (e.g. "BUL", "BUL/SC", etc.) of the `split`
    order until one is found in `possible_orders`.
    Returns a split order, or None if none is found
    e.g. for the example inputs above, this function returns:
            ["F", "AEG", "S", "F", "BUL/SC", "-", "GRE"]
    """
    for idx in [1, 4, 6]:  # try loc, from_loc, and to_loc
        if len(split) <= idx:
            continue
        for variant in [split[idx].split("/")[0] + x for x in ["", "/NC", "/EC", "/SC", "/WC"]]:
            try_split = split[:idx] + [variant] + split[(idx + 1) :]
            if " ".join(try_split) in possible_orders:
                return try_split
    return None