input: Write a function to create a Python class that represents a complex number and provides a method to return a string representation of the complex number. The class should have attributes for the real and imaginary parts, and the string representation should be formatted as "(real + imaginaryi)".
  
  class ComplexNumber:
      def __init__(self, real, imaginary):
          self.real = real
          self.imaginary = imaginary
  
      def __str__(self):
          return "({0} + {1}i)".format(self.real, self.imaginary)
  
  assert str(ComplexNumber(3, 4)) == "(3 + 4i)"
  assert str(ComplexNumber(-2, 5)) == "(-2 + 5i)"
  assert str(ComplexNumber(0, 0)) == "(0 + 0i)"
  assert str(ComplexNumber(1, -1)) == "(1 + -1i)"
  assert str(ComplexNumber(-3, -2)) == "(-3 + -2i)"
output: class ComplexNumber:
      def __init__(self, real, imaginary):
          self.real = real
          self.imaginary = imaginary
  
      def __str__(self):
          return "({0} + {1}i)".format(self.real, self.imaginary)