input: def store_and_query_user_data(data: dict) -> dict:
      """A Python program to store and query user data in a JSON file.
      >>> 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"
  
      if os.path.exists(filename):
          with open(filename, 'r') as file:
              stored_data = json.load(file)
      else:
          stored_data = {}
  
      stored_data.update(data)
  
      with open(filename, 'w') as file:
          json.dump(stored_data, file)
  
      return stored_data