input: Write a python function to extract specific fields from a JSON string.
  assert extract_fields('{"name": "John","age": 30,"cars": {"car1": "Ford","car2": "BMW","car3": "Fiat"}}') == ('John', 30, 'BMW')
  assert extract_fields('{"name": "Alice","age": 25,"cars": {"car1": "Toyota","car2": "Honda","car3": "Tesla"}}') == ('Alice', 25, 'Honda')
  assert extract_fields('{"name": "Bob","age": 22,"cars": {"car1": "Hyundai","car2": "Chevrolet","car3": "Kia"}}') == ('Bob', 22, 'Chevrolet')
output: import json
  
  def extract_fields(json_str):
      data = json.loads(json_str)
      name = data["name"]
      age = data["age"]
      car2 = data["cars"]["car2"]
      return name, age, car2