input: from typing import Tuple
  
  class Vector3D:
      def __init__(self, x: float, y: float, z: float) -> None:
          """ Initialize a 3D vector with components x, y, and z.
          >>> vec = Vector3D(1.0, 2.0, 3.0)
          >>> vec.__str__()
          '(1.0, 2.0, 3.0)'
          """
          self.x = x
          self.y = y
          self.z = z
      
      def __str__(self) -> str:
          """ Return the string representation of the vector.
          >>> Vector3D(1.0, 2.0, 3.0).__str__()
          '(1.0, 2.0, 3.0)'
          """
          return "(" + str(self.x) + ", " + str(self.y) + ", " + str(self.z) + ")"
output:     def __add__(self, other: 'Vector3D') -> 'Vector3D':
          """ Add two vectors and return the resulting vector.
          >>> vec1 = Vector3D(1.0, 2.0, 3.0)
          >>> vec2 = Vector3D(4.0, 5.0, 6.0)
          >>> (vec1 + vec2).__str__()
          '(5.0, 7.0, 9.0)'
          """
          return Vector3D(self.x + other.x, self.y + other.y, self.z + other.z)
      
      def __sub__(self, other: 'Vector3D') -> 'Vector3D':
          """ Subtract two vectors and return the resulting vector.
          >>> vec1 = Vector3D(1.0, 2.0, 3.0)
          >>> vec2 = Vector3D(4.0, 5.0, 6.0)
          >>> (vec1 - vec2).__str__()
          '(-3.0, -3.0, -3.0)'
          """
          return Vector3D(self.x - other.x, self.y - other.y, self.z - other.z)
      
      def __mul__(self, scalar: float) -> 'Vector3D':
          """ Multiply the vector by a scalar and return the resulting vector.
          >>> vec = Vector3D(1.0, 2.0, 3.0)
          >>> (vec * 2).__str__()
          '(2.0, 4.0, 6.0)'
          """
          return Vector3D(self.x * scalar, self.y * scalar, self.z * scalar)
      
      def __rmul__(self, scalar: float) -> 'Vector3D':
          """ Multiply the vector by a scalar and return the resulting vector.
          >>> vec = Vector3D(1.0, 2.0, 3.0)
          >>> (2 * vec).__str__()
          '(2.0, 4.0, 6.0)'
          """
          return self.__mul__(scalar)
      
      def dot(self, other: 'Vector3D') -> float:
          """ Compute the dot product of two vectors.
          >>> vec1 = Vector3D(1.0, 2.0, 3.0)
          >>> vec2 = Vector3D(4.0, 5.0, 6.0)
          >>> vec1.dot(vec2)
          32.0
          """
          return self.x * other.x + self.y * other.y + self.z * other.z
      
      def cross(self, other: 'Vector3D') -> 'Vector3D':
          """ Compute the cross product of two vectors.
          >>> vec1 = Vector3D(1.0, 2.0, 3.0)
          >>> vec2 = Vector3D(4.0, 5.0, 6.0)
          >>> vec1.cross(vec2).__str__()
          '(-3.0, 6.0, -3.0)'
          """
          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)
      
      def magnitude(self) -> float:
          """ Compute the magnitude (length) of the vector.
          >>> vec = Vector3D(1.0, 2.0, 2.0)
          >>> vec.magnitude()
          3.0
          """
          return (self.x ** 2 + self.y ** 2 + self.z ** 2) ** 0.5
      
      def normalize(self) -> 'Vector3D':
          """ Normalize the vector to a unit vector.
          >>> vec = Vector3D(1.0, 2.0, 2.0)
          >>> vec.normalize().__str__()
          '(0.3333333333333333, 0.6666666666666666, 0.6666666666666666)'
          """
          mag = self.magnitude()
          return Vector3D(self.x / mag, self.y / mag, self.z / mag)