input: def store_and_query_user_data(user_data: dict) -> dict:
      """ Store user data in a JSON file and then retrieve it.
  
      >>> store_and_query_user_data({"Name": "John", "Age": 25, "City": "New York"})
      {'Name': 'John', 'Age': 25, 'City': 'New York'}
      """
output:     import json
      import os
  
      filename = "user_data.json"
  
      with open(filename, "w") as file:
          json.dump(user_data, file)
  
      if os.path.exists(filename):
          with open(filename, "r") as file:
              retrieved_data = json.load(file)
          os.remove(filename)
          return retrieved_data