anchor.diff:          end do
       end subroutine
   
  +    subroutine read_puzzle(puzz)
  +        type(puzzle), intent(out) :: puzz
  +        integer                   :: n, w, i, j
  +
  +        read *, puzz%name_
  +        read *, n
  +        allocate(puzz%ps(n))
  +
  +        do j = 1, n
  +            read *, w, puzz%ps(j)%cnt
  +            allocate(puzz%ps(j)%s(3, w))
  +            do i = 1, 3
  +                read *, puzz%ps(j)%s(i, :)
  +            end do
  +        end do
  +    end subroutine
  +
       subroutine print_piece(p)
           integer, intent(in) :: p(:, :)
           integer             :: i
  
positive.code:                                                      (/ 3, 3 /))
      integer                   :: mrot(3, 3, 3, 4), cube(3, 3, 3), calls
      type(puts_t), allocatable :: puts_cache(:)
      type(piece), allocatable  :: ps(:)
      type(list)                :: sols
      real                      :: t0, t1
  
      call cpu_time(t0)
      call init_mrot(mrot)
      cube = 0
      call read_pieces(ps)
      sols%length = 0
      allocate(sols%d(3, 3, 3, 16))
  
      calls = 1
      call search(ps, size(ps), 1, cube, sols)
      call finish()
  
  contains
  
negative.code:         end do
      end subroutine
  
      subroutine print_puzzle(puzz)
          type(puzzle), intent(in) :: puzz
          type(piece)              :: p
          integer                  :: i
  
          write (*, "(a, a)")  "puzzle name: ", puzz%name_
          write (*, "(a, i3)") "unique pieces: ", size(puzz%ps)
          print *
          do i = 1, size(puzz%ps)
              p = puzz%ps(i)
              write (*, "(a, i2, a, i2, a, i2)") "piece ", i, ", volume ", size(p%s, 2), ", count ", p%cnt
              call print_piece(p%s)
              print *
          end do
          write (*, "(a, i3)") "total pieces: ", sum(puzz%ps%cnt)
          print *
      end subroutine
  
  