input: 
  def generate_random_password(length: int) -> str:
      """Generate a random password of a specified length, which contains at least one of each character type (lowercase, uppercase, digits, special characters).
      >>> generate_random_password(8)
      'A1b@c2d!'
      >>> generate_random_password(12)
      '1@X2b$Z3c!dA'
      """
      import string
      import random
      
      special_characters = "!#$%&'()*+,-./:;<=>?@[\]^_`{|}~"
      
      password = []
      password.append(random.choice(string.ascii_lowercase))
      password.append(random.choice(string.ascii_uppercase))
      password.append(random.choice(string.digits))
      password.append(random.choice(special_characters))
      
      all_characters = string.ascii_lowercase + string.ascii_uppercase + string.digits + special_characters
      
      while len(password) < length:
          password.append(random.choice(all_characters))
      
      random.shuffle(password)
      return ''.join(password)
  
output:     import string
      import random
      
      special_characters = "!#$%&'()*+,-./:;<=>?@[\]^_`{|}~"
      
      password = []
      password.append(random.choice(string.ascii_lowercase))
      password.append(random.choice(string.ascii_uppercase))
      password.append(random.choice(string.digits))
      password.append(random.choice(special_characters))
      
      all_characters = string.ascii_lowercase + string.ascii_uppercase + string.digits + special_characters
      
      while len(password) < length:
          password.append(random.choice(all_characters))
      
      random.shuffle(password)
      return ''.join(password)