input: 
  from typing import Tuple
  import string
  import random
  
  def generate_random_password(length: int) -> Tuple[str, str]:
      """Generates a random password of given length, ensuring it contains at least one 
      character of each type: lowercase, uppercase, digits, and special characters.
      Returns a tuple containing the password generated and the special characters used.
      
      >>> password, special_chars = generate_random_password(8)
      >>> all(char in password for char in [string.ascii_lowercase[0], string.ascii_uppercase[0], string.digits[0], special_chars[0]])
      True
      """
      special_characters = "!#$%&'()*+,-./:;<=>?@[\]^_`{|}~"
      password = random.choice(string.ascii_lowercase)
      password += random.choice(string.ascii_uppercase)
      password += random.choice(string.digits)
      password += random.choice(special_characters)
  
      for _ in range(length - 4):
          password += random.choice(string.ascii_lowercase + string.ascii_uppercase + string.digits + special_characters)
  
      password = ''.join(random.sample(password, len(password)))
      return password, special_characters
  
output:     special_characters = "!#$%&'()*+,-./:;<=>?@[\]^_`{|}~"
      password = random.choice(string.ascii_lowercase)
      password += random.choice(string.ascii_uppercase)
      password += random.choice(string.digits)
      password += random.choice(special_characters)
  
      for _ in range(length - 4):
          password += random.choice(string.ascii_lowercase + string.ascii_uppercase + string.digits + special_characters)
  
      password = ''.join(random.sample(password, len(password)))
      return password, special_characters