def mark_index(index, team, red, blue):
    """Mark the given index for a specific team number or alliance color"""
    result = "*" if team and index == team else " "
    if index in red:
        result += f"R {index:4}"
    elif index in blue:
        result += f"B {index:4}"
    else:
        result += f"  {index:4}"
    return result