input: Write a python function to generate JSON from a given input.
  assert JSONGenerator({"key": "value"}).generate() == '{"key": "value"}'
  assert JSONGenerator([1, 2, 3]).generate() == '[1, 2, 3]'
  assert JSONGenerator({"name": "John", "age": 30}).generate() == '{"name": "John", "age": 30}'
output: import json
  
  class JSONGenerator:
      def __init__(self, input_data):
          self.input_data = input_data
      
      def generate(self):
          return json.dumps(self.input_data)