input: def min_steps_to_capture_queen(p1: int, q1: int, p2: int, q2: int, p3: int, q3: int) -> int:
      """
      You are given a 1-indexed 8 x 8 chessboard with 3 pieces positioned on it.
  
      The positions of these pieces are given by 6 integers p1, q1, p2, q2, p3, and q3 where:
  
      (p1, q1) is the position of the white rook.
      (p2, q2) is the position of the white bishop.
      (p3, q3) is the position of the black queen.
  
      You are allowed to move only the white pieces. Return the minimum number of moves required to capture the black queen.
  
      Note that:
  
      Rooks can move vertically or horizontally any number of squares but cannot leap over other pieces.
      Bishops can move diagonally any number of squares but cannot leap over other pieces.
      A piece can capture the queen if it moves to the queen's square.
      The queen remains stationary.
  
      Examples:
      >>> p1, q1 = 1, 1
      >>> p2, q2 = 8, 8
      >>> p3, q3 = 2, 3
      2
      >>> p1, q1 = 5, 3
      >>> p2, q2 = 3, 4
      >>> p3, q3 = 5, 2
      1
  
      Constraints:
      1 <= p1, q1, p2, q2, p3, q3 <= 8
      No two pieces occupy the same square.
      """
output:     
      def can_rook_capture():
          return p1 == p3 or q1 == q3
  
      def can_bishop_capture():
          return abs(p2 - p3) == abs(q2 - q3)
  
      if can_rook_capture() or can_bishop_capture():
          return 1
  
      # Check if rook and bishop can work together in 2 moves
      if (p1 % 2 == p3 % 2 and q1 % 2 == q3 % 2) == (p2 % 2 == q2 % 2):
          return 2
  
      return 3
  