input: 
  class Vector3D:
      """
      A Python class which represents a 3D Vector.
      The class should have an initializer to set the x, y, and z components,
      and a string method to return the vector in the format (x, y, z).
      
      Example:
      >>> vector = Vector3D(1, 2, 3)
      >>> print(vector)
      (1, 2, 3)
      """
      def __init__(self, x, y, z):
          self.x = x
          self.y = y
          self.z = z
      
      def __str__(self):
          return "(" + str(self.x) + ", " + str(self.y) + ", " + str(self.z) + ")"
  
output:     def __add__(self, other):
          return Vector3D(self.x + other.x, self.y + other.y, self.z + other.z)
  
      def __sub__(self, other):
          return Vector3D(self.x - other.x, self.y - other.y, self.z - other.z)
  
      def __mul__(self, scalar):
          return Vector3D(self.x * scalar, self.y * scalar, self.z * scalar)
  
      def __truediv__(self, scalar):
          return Vector3D(self.x / scalar, self.y / scalar, self.z / scalar)
  
      def magnitude(self):
          return (self.x ** 2 + self.y ** 2 + self.z ** 2) ** 0.5
  
      def dot(self, other):
          return self.x * other.x + self.y * other.y + self.z * other.z
  
      def cross(self, other):
          return Vector3D(self.y * other.z - self.z * other.y,
                          self.z * other.x - self.x * other.z,
                          self.x * other.y - self.y * other.x)