(include "#.scm")

(define bool #f)

(define a0  (cons 0 1))
(define a1  (cons 2 3))
(define a2  (cons 4 5))
(define a3  (cons 6 7))
(define a4  (cons 8 9))
(define a5  (cons 10 11))
(define a6  (cons 12 13))
(define a7  (cons 14 15))
(define a8  (cons 16 17))
(define a9  (cons 18 19))
(define a10 (cons 20 21))
(define a11 (cons 22 23))
(define a12 (cons 24 25))
(define a13 (cons 26 27))
(define a14 (cons 28 29))
(define a15 (cons 30 31))

(define b0  (cons a0 a1))
(define b1  (cons a2 a3))
(define b2  (cons a4 a5))
(define b3  (cons a6 a7))
(define b4  (cons a8 a9))
(define b5  (cons a10 a11))
(define b6  (cons a12 a13))
(define b7  (cons a14 a15))

(define c0  (cons b0 b1))
(define c1  (cons b2 b3))
(define c2  (cons b4 b5))
(define c3  (cons b6 b7))

(define d0  (cons c0 c1))
(define d1  (cons c2 c3))

(define e0  (cons d0 d1))

(check-tail-exn type-exception? (lambda () (car bool)))
(check-eqv? (car a0) 0)
(check-eqv? (car a1) 2)
(check-eqv? (car a2) 4)
(check-eqv? (car a3) 6)
(check-eqv? (car a4) 8)
(check-eqv? (car a5) 10)
(check-eqv? (car a6) 12)
(check-eqv? (car a7) 14)
(check-eqv? (car a8) 16)
(check-eqv? (car a9) 18)
(check-eqv? (car a10) 20)
(check-eqv? (car a11) 22)
(check-eqv? (car a12) 24)
(check-eqv? (car a13) 26)
(check-eqv? (car a14) 28)
(check-eqv? (car a15) 30)
(check-eq? (car b0) a0)
(check-eq? (car b1) a2)
(check-eq? (car b2) a4)
(check-eq? (car b3) a6)
(check-eq? (car b4) a8)
(check-eq? (car b5) a10)
(check-eq? (car b6) a12)
(check-eq? (car b7) a14)
(check-eq? (car c0) b0)
(check-eq? (car c1) b2)
(check-eq? (car c2) b4)
(check-eq? (car c3) b6)
(check-eq? (car d0) c0)
(check-eq? (car d1) c2)
(check-eq? (car e0) d0)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (car)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (car a0 a0)))

(check-tail-exn type-exception? (lambda () (cdr bool)))
(check-eqv? (cdr a0) 1)
(check-eqv? (cdr a1) 3)
(check-eqv? (cdr a2) 5)
(check-eqv? (cdr a3) 7)
(check-eqv? (cdr a4) 9)
(check-eqv? (cdr a5) 11)
(check-eqv? (cdr a6) 13)
(check-eqv? (cdr a7) 15)
(check-eqv? (cdr a8) 17)
(check-eqv? (cdr a9) 19)
(check-eqv? (cdr a10) 21)
(check-eqv? (cdr a11) 23)
(check-eqv? (cdr a12) 25)
(check-eqv? (cdr a13) 27)
(check-eqv? (cdr a14) 29)
(check-eqv? (cdr a15) 31)
(check-eq? (cdr b0) a1)
(check-eq? (cdr b1) a3)
(check-eq? (cdr b2) a5)
(check-eq? (cdr b3) a7)
(check-eq? (cdr b4) a9)
(check-eq? (cdr b5) a11)
(check-eq? (cdr b6) a13)
(check-eq? (cdr b7) a15)
(check-eq? (cdr c0) b1)
(check-eq? (cdr c1) b3)
(check-eq? (cdr c2) b5)
(check-eq? (cdr c3) b7)
(check-eq? (cdr d0) c1)
(check-eq? (cdr d1) c3)
(check-eq? (cdr e0) d1)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cdr)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cdr a0 a0)))

(check-tail-exn type-exception? (lambda () (caar bool)))
(check-tail-exn type-exception? (lambda () (caar a0)))
(check-tail-exn type-exception? (lambda () (caar a1)))
(check-tail-exn type-exception? (lambda () (caar a2)))
(check-tail-exn type-exception? (lambda () (caar a3)))
(check-tail-exn type-exception? (lambda () (caar a4)))
(check-tail-exn type-exception? (lambda () (caar a5)))
(check-tail-exn type-exception? (lambda () (caar a6)))
(check-tail-exn type-exception? (lambda () (caar a7)))
(check-tail-exn type-exception? (lambda () (caar a8)))
(check-tail-exn type-exception? (lambda () (caar a9)))
(check-tail-exn type-exception? (lambda () (caar a10)))
(check-tail-exn type-exception? (lambda () (caar a11)))
(check-tail-exn type-exception? (lambda () (caar a12)))
(check-tail-exn type-exception? (lambda () (caar a13)))
(check-tail-exn type-exception? (lambda () (caar a14)))
(check-tail-exn type-exception? (lambda () (caar a15)))
(check-eqv? (caar b0) 0)
(check-eqv? (caar b1) 4)
(check-eqv? (caar b2) 8)
(check-eqv? (caar b3) 12)
(check-eqv? (caar b4) 16)
(check-eqv? (caar b5) 20)
(check-eqv? (caar b6) 24)
(check-eqv? (caar b7) 28)
(check-eq? (caar c0) a0)
(check-eq? (caar c1) a4)
(check-eq? (caar c2) a8)
(check-eq? (caar c3) a12)
(check-eq? (caar d0) b0)
(check-eq? (caar d1) b4)
(check-eq? (caar e0) c0)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (caar)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (caar a0 a0)))

(check-tail-exn type-exception? (lambda () (cadr bool)))
(check-tail-exn type-exception? (lambda () (cadr a0)))
(check-tail-exn type-exception? (lambda () (cadr a1)))
(check-tail-exn type-exception? (lambda () (cadr a2)))
(check-tail-exn type-exception? (lambda () (cadr a3)))
(check-tail-exn type-exception? (lambda () (cadr a4)))
(check-tail-exn type-exception? (lambda () (cadr a5)))
(check-tail-exn type-exception? (lambda () (cadr a6)))
(check-tail-exn type-exception? (lambda () (cadr a7)))
(check-tail-exn type-exception? (lambda () (cadr a8)))
(check-tail-exn type-exception? (lambda () (cadr a9)))
(check-tail-exn type-exception? (lambda () (cadr a10)))
(check-tail-exn type-exception? (lambda () (cadr a11)))
(check-tail-exn type-exception? (lambda () (cadr a12)))
(check-tail-exn type-exception? (lambda () (cadr a13)))
(check-tail-exn type-exception? (lambda () (cadr a14)))
(check-tail-exn type-exception? (lambda () (cadr a15)))
(check-eqv? (cadr b0) 2)
(check-eqv? (cadr b1) 6)
(check-eqv? (cadr b2) 10)
(check-eqv? (cadr b3) 14)
(check-eqv? (cadr b4) 18)
(check-eqv? (cadr b5) 22)
(check-eqv? (cadr b6) 26)
(check-eqv? (cadr b7) 30)
(check-eq? (cadr c0) a2)
(check-eq? (cadr c1) a6)
(check-eq? (cadr c2) a10)
(check-eq? (cadr c3) a14)
(check-eq? (cadr d0) b2)
(check-eq? (cadr d1) b6)
(check-eq? (cadr e0) c2)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cadr)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cadr a0 a0)))

(check-tail-exn type-exception? (lambda () (cdar bool)))
(check-tail-exn type-exception? (lambda () (cdar a0)))
(check-tail-exn type-exception? (lambda () (cdar a1)))
(check-tail-exn type-exception? (lambda () (cdar a2)))
(check-tail-exn type-exception? (lambda () (cdar a3)))
(check-tail-exn type-exception? (lambda () (cdar a4)))
(check-tail-exn type-exception? (lambda () (cdar a5)))
(check-tail-exn type-exception? (lambda () (cdar a6)))
(check-tail-exn type-exception? (lambda () (cdar a7)))
(check-tail-exn type-exception? (lambda () (cdar a8)))
(check-tail-exn type-exception? (lambda () (cdar a9)))
(check-tail-exn type-exception? (lambda () (cdar a10)))
(check-tail-exn type-exception? (lambda () (cdar a11)))
(check-tail-exn type-exception? (lambda () (cdar a12)))
(check-tail-exn type-exception? (lambda () (cdar a13)))
(check-tail-exn type-exception? (lambda () (cdar a14)))
(check-tail-exn type-exception? (lambda () (cdar a15)))
(check-eqv? (cdar b0) 1)
(check-eqv? (cdar b1) 5)
(check-eqv? (cdar b2) 9)
(check-eqv? (cdar b3) 13)
(check-eqv? (cdar b4) 17)
(check-eqv? (cdar b5) 21)
(check-eqv? (cdar b6) 25)
(check-eqv? (cdar b7) 29)
(check-eq? (cdar c0) a1)
(check-eq? (cdar c1) a5)
(check-eq? (cdar c2) a9)
(check-eq? (cdar c3) a13)
(check-eq? (cdar d0) b1)
(check-eq? (cdar d1) b5)
(check-eq? (cdar e0) c1)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cdar)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cdar a0 a0)))

(check-tail-exn type-exception? (lambda () (cddr bool)))
(check-tail-exn type-exception? (lambda () (cddr a0)))
(check-tail-exn type-exception? (lambda () (cddr a1)))
(check-tail-exn type-exception? (lambda () (cddr a2)))
(check-tail-exn type-exception? (lambda () (cddr a3)))
(check-tail-exn type-exception? (lambda () (cddr a4)))
(check-tail-exn type-exception? (lambda () (cddr a5)))
(check-tail-exn type-exception? (lambda () (cddr a6)))
(check-tail-exn type-exception? (lambda () (cddr a7)))
(check-tail-exn type-exception? (lambda () (cddr a8)))
(check-tail-exn type-exception? (lambda () (cddr a9)))
(check-tail-exn type-exception? (lambda () (cddr a10)))
(check-tail-exn type-exception? (lambda () (cddr a11)))
(check-tail-exn type-exception? (lambda () (cddr a12)))
(check-tail-exn type-exception? (lambda () (cddr a13)))
(check-tail-exn type-exception? (lambda () (cddr a14)))
(check-tail-exn type-exception? (lambda () (cddr a15)))
(check-eqv? (cddr b0) 3)
(check-eqv? (cddr b1) 7)
(check-eqv? (cddr b2) 11)
(check-eqv? (cddr b3) 15)
(check-eqv? (cddr b4) 19)
(check-eqv? (cddr b5) 23)
(check-eqv? (cddr b6) 27)
(check-eqv? (cddr b7) 31)
(check-eq? (cddr c0) a3)
(check-eq? (cddr c1) a7)
(check-eq? (cddr c2) a11)
(check-eq? (cddr c3) a15)
(check-eq? (cddr d0) b3)
(check-eq? (cddr d1) b7)
(check-eq? (cddr e0) c3)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cddr)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cddr a0 a0)))

(check-tail-exn type-exception? (lambda () (caaar bool)))
(check-tail-exn type-exception? (lambda () (caaar a0)))
(check-tail-exn type-exception? (lambda () (caaar a1)))
(check-tail-exn type-exception? (lambda () (caaar a2)))
(check-tail-exn type-exception? (lambda () (caaar a3)))
(check-tail-exn type-exception? (lambda () (caaar a4)))
(check-tail-exn type-exception? (lambda () (caaar a5)))
(check-tail-exn type-exception? (lambda () (caaar a6)))
(check-tail-exn type-exception? (lambda () (caaar a7)))
(check-tail-exn type-exception? (lambda () (caaar a8)))
(check-tail-exn type-exception? (lambda () (caaar a9)))
(check-tail-exn type-exception? (lambda () (caaar a10)))
(check-tail-exn type-exception? (lambda () (caaar a11)))
(check-tail-exn type-exception? (lambda () (caaar a12)))
(check-tail-exn type-exception? (lambda () (caaar a13)))
(check-tail-exn type-exception? (lambda () (caaar a14)))
(check-tail-exn type-exception? (lambda () (caaar a15)))
(check-tail-exn type-exception? (lambda () (caaar b0)))
(check-tail-exn type-exception? (lambda () (caaar b1)))
(check-tail-exn type-exception? (lambda () (caaar b2)))
(check-tail-exn type-exception? (lambda () (caaar b3)))
(check-tail-exn type-exception? (lambda () (caaar b4)))
(check-tail-exn type-exception? (lambda () (caaar b5)))
(check-tail-exn type-exception? (lambda () (caaar b6)))
(check-tail-exn type-exception? (lambda () (caaar b7)))
(check-eqv? (caaar c0) 0)
(check-eqv? (caaar c1) 8)
(check-eqv? (caaar c2) 16)
(check-eqv? (caaar c3) 24)
(check-eq? (caaar d0) a0)
(check-eq? (caaar d1) a8)
(check-eq? (caaar e0) b0)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (caaar)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (caaar a0 a0)))

(check-tail-exn type-exception? (lambda () (caadr bool)))
(check-tail-exn type-exception? (lambda () (caadr a0)))
(check-tail-exn type-exception? (lambda () (caadr a1)))
(check-tail-exn type-exception? (lambda () (caadr a2)))
(check-tail-exn type-exception? (lambda () (caadr a3)))
(check-tail-exn type-exception? (lambda () (caadr a4)))
(check-tail-exn type-exception? (lambda () (caadr a5)))
(check-tail-exn type-exception? (lambda () (caadr a6)))
(check-tail-exn type-exception? (lambda () (caadr a7)))
(check-tail-exn type-exception? (lambda () (caadr a8)))
(check-tail-exn type-exception? (lambda () (caadr a9)))
(check-tail-exn type-exception? (lambda () (caadr a10)))
(check-tail-exn type-exception? (lambda () (caadr a11)))
(check-tail-exn type-exception? (lambda () (caadr a12)))
(check-tail-exn type-exception? (lambda () (caadr a13)))
(check-tail-exn type-exception? (lambda () (caadr a14)))
(check-tail-exn type-exception? (lambda () (caadr a15)))
(check-tail-exn type-exception? (lambda () (caadr b0)))
(check-tail-exn type-exception? (lambda () (caadr b1)))
(check-tail-exn type-exception? (lambda () (caadr b2)))
(check-tail-exn type-exception? (lambda () (caadr b3)))
(check-tail-exn type-exception? (lambda () (caadr b4)))
(check-tail-exn type-exception? (lambda () (caadr b5)))
(check-tail-exn type-exception? (lambda () (caadr b6)))
(check-tail-exn type-exception? (lambda () (caadr b7)))
(check-eqv? (caadr c0) 4)
(check-eqv? (caadr c1) 12)
(check-eqv? (caadr c2) 20)
(check-eqv? (caadr c3) 28)
(check-eq? (caadr d0) a4)
(check-eq? (caadr d1) a12)
(check-eq? (caadr e0) b4)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (caadr)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (caadr a0 a0)))

(check-tail-exn type-exception? (lambda () (cadar bool)))
(check-tail-exn type-exception? (lambda () (cadar a0)))
(check-tail-exn type-exception? (lambda () (cadar a1)))
(check-tail-exn type-exception? (lambda () (cadar a2)))
(check-tail-exn type-exception? (lambda () (cadar a3)))
(check-tail-exn type-exception? (lambda () (cadar a4)))
(check-tail-exn type-exception? (lambda () (cadar a5)))
(check-tail-exn type-exception? (lambda () (cadar a6)))
(check-tail-exn type-exception? (lambda () (cadar a7)))
(check-tail-exn type-exception? (lambda () (cadar a8)))
(check-tail-exn type-exception? (lambda () (cadar a9)))
(check-tail-exn type-exception? (lambda () (cadar a10)))
(check-tail-exn type-exception? (lambda () (cadar a11)))
(check-tail-exn type-exception? (lambda () (cadar a12)))
(check-tail-exn type-exception? (lambda () (cadar a13)))
(check-tail-exn type-exception? (lambda () (cadar a14)))
(check-tail-exn type-exception? (lambda () (cadar a15)))
(check-tail-exn type-exception? (lambda () (cadar b0)))
(check-tail-exn type-exception? (lambda () (cadar b1)))
(check-tail-exn type-exception? (lambda () (cadar b2)))
(check-tail-exn type-exception? (lambda () (cadar b3)))
(check-tail-exn type-exception? (lambda () (cadar b4)))
(check-tail-exn type-exception? (lambda () (cadar b5)))
(check-tail-exn type-exception? (lambda () (cadar b6)))
(check-tail-exn type-exception? (lambda () (cadar b7)))
(check-eqv? (cadar c0) 2)
(check-eqv? (cadar c1) 10)
(check-eqv? (cadar c2) 18)
(check-eqv? (cadar c3) 26)
(check-eq? (cadar d0) a2)
(check-eq? (cadar d1) a10)
(check-eq? (cadar e0) b2)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cadar)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cadar a0 a0)))

(check-tail-exn type-exception? (lambda () (caddr bool)))
(check-tail-exn type-exception? (lambda () (caddr a0)))
(check-tail-exn type-exception? (lambda () (caddr a1)))
(check-tail-exn type-exception? (lambda () (caddr a2)))
(check-tail-exn type-exception? (lambda () (caddr a3)))
(check-tail-exn type-exception? (lambda () (caddr a4)))
(check-tail-exn type-exception? (lambda () (caddr a5)))
(check-tail-exn type-exception? (lambda () (caddr a6)))
(check-tail-exn type-exception? (lambda () (caddr a7)))
(check-tail-exn type-exception? (lambda () (caddr a8)))
(check-tail-exn type-exception? (lambda () (caddr a9)))
(check-tail-exn type-exception? (lambda () (caddr a10)))
(check-tail-exn type-exception? (lambda () (caddr a11)))
(check-tail-exn type-exception? (lambda () (caddr a12)))
(check-tail-exn type-exception? (lambda () (caddr a13)))
(check-tail-exn type-exception? (lambda () (caddr a14)))
(check-tail-exn type-exception? (lambda () (caddr a15)))
(check-tail-exn type-exception? (lambda () (caddr b0)))
(check-tail-exn type-exception? (lambda () (caddr b1)))
(check-tail-exn type-exception? (lambda () (caddr b2)))
(check-tail-exn type-exception? (lambda () (caddr b3)))
(check-tail-exn type-exception? (lambda () (caddr b4)))
(check-tail-exn type-exception? (lambda () (caddr b5)))
(check-tail-exn type-exception? (lambda () (caddr b6)))
(check-tail-exn type-exception? (lambda () (caddr b7)))
(check-eqv? (caddr c0) 6)
(check-eqv? (caddr c1) 14)
(check-eqv? (caddr c2) 22)
(check-eqv? (caddr c3) 30)
(check-eq? (caddr d0) a6)
(check-eq? (caddr d1) a14)
(check-eq? (caddr e0) b6)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (caddr)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (caddr a0 a0)))

(check-tail-exn type-exception? (lambda () (cdaar bool)))
(check-tail-exn type-exception? (lambda () (cdaar a0)))
(check-tail-exn type-exception? (lambda () (cdaar a1)))
(check-tail-exn type-exception? (lambda () (cdaar a2)))
(check-tail-exn type-exception? (lambda () (cdaar a3)))
(check-tail-exn type-exception? (lambda () (cdaar a4)))
(check-tail-exn type-exception? (lambda () (cdaar a5)))
(check-tail-exn type-exception? (lambda () (cdaar a6)))
(check-tail-exn type-exception? (lambda () (cdaar a7)))
(check-tail-exn type-exception? (lambda () (cdaar a8)))
(check-tail-exn type-exception? (lambda () (cdaar a9)))
(check-tail-exn type-exception? (lambda () (cdaar a10)))
(check-tail-exn type-exception? (lambda () (cdaar a11)))
(check-tail-exn type-exception? (lambda () (cdaar a12)))
(check-tail-exn type-exception? (lambda () (cdaar a13)))
(check-tail-exn type-exception? (lambda () (cdaar a14)))
(check-tail-exn type-exception? (lambda () (cdaar a15)))
(check-tail-exn type-exception? (lambda () (cdaar b0)))
(check-tail-exn type-exception? (lambda () (cdaar b1)))
(check-tail-exn type-exception? (lambda () (cdaar b2)))
(check-tail-exn type-exception? (lambda () (cdaar b3)))
(check-tail-exn type-exception? (lambda () (cdaar b4)))
(check-tail-exn type-exception? (lambda () (cdaar b5)))
(check-tail-exn type-exception? (lambda () (cdaar b6)))
(check-tail-exn type-exception? (lambda () (cdaar b7)))
(check-eqv? (cdaar c0) 1)
(check-eqv? (cdaar c1) 9)
(check-eqv? (cdaar c2) 17)
(check-eqv? (cdaar c3) 25)
(check-eq? (cdaar d0) a1)
(check-eq? (cdaar d1) a9)
(check-eq? (cdaar e0) b1)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cdaar)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cdaar a0 a0)))

(check-tail-exn type-exception? (lambda () (cdadr bool)))
(check-tail-exn type-exception? (lambda () (cdadr a0)))
(check-tail-exn type-exception? (lambda () (cdadr a1)))
(check-tail-exn type-exception? (lambda () (cdadr a2)))
(check-tail-exn type-exception? (lambda () (cdadr a3)))
(check-tail-exn type-exception? (lambda () (cdadr a4)))
(check-tail-exn type-exception? (lambda () (cdadr a5)))
(check-tail-exn type-exception? (lambda () (cdadr a6)))
(check-tail-exn type-exception? (lambda () (cdadr a7)))
(check-tail-exn type-exception? (lambda () (cdadr a8)))
(check-tail-exn type-exception? (lambda () (cdadr a9)))
(check-tail-exn type-exception? (lambda () (cdadr a10)))
(check-tail-exn type-exception? (lambda () (cdadr a11)))
(check-tail-exn type-exception? (lambda () (cdadr a12)))
(check-tail-exn type-exception? (lambda () (cdadr a13)))
(check-tail-exn type-exception? (lambda () (cdadr a14)))
(check-tail-exn type-exception? (lambda () (cdadr a15)))
(check-tail-exn type-exception? (lambda () (cdadr b0)))
(check-tail-exn type-exception? (lambda () (cdadr b1)))
(check-tail-exn type-exception? (lambda () (cdadr b2)))
(check-tail-exn type-exception? (lambda () (cdadr b3)))
(check-tail-exn type-exception? (lambda () (cdadr b4)))
(check-tail-exn type-exception? (lambda () (cdadr b5)))
(check-tail-exn type-exception? (lambda () (cdadr b6)))
(check-tail-exn type-exception? (lambda () (cdadr b7)))
(check-eqv? (cdadr c0) 5)
(check-eqv? (cdadr c1) 13)
(check-eqv? (cdadr c2) 21)
(check-eqv? (cdadr c3) 29)
(check-eq? (cdadr d0) a5)
(check-eq? (cdadr d1) a13)
(check-eq? (cdadr e0) b5)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cdadr)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cdadr a0 a0)))

(check-tail-exn type-exception? (lambda () (cddar bool)))
(check-tail-exn type-exception? (lambda () (cddar a0)))
(check-tail-exn type-exception? (lambda () (cddar a1)))
(check-tail-exn type-exception? (lambda () (cddar a2)))
(check-tail-exn type-exception? (lambda () (cddar a3)))
(check-tail-exn type-exception? (lambda () (cddar a4)))
(check-tail-exn type-exception? (lambda () (cddar a5)))
(check-tail-exn type-exception? (lambda () (cddar a6)))
(check-tail-exn type-exception? (lambda () (cddar a7)))
(check-tail-exn type-exception? (lambda () (cddar a8)))
(check-tail-exn type-exception? (lambda () (cddar a9)))
(check-tail-exn type-exception? (lambda () (cddar a10)))
(check-tail-exn type-exception? (lambda () (cddar a11)))
(check-tail-exn type-exception? (lambda () (cddar a12)))
(check-tail-exn type-exception? (lambda () (cddar a13)))
(check-tail-exn type-exception? (lambda () (cddar a14)))
(check-tail-exn type-exception? (lambda () (cddar a15)))
(check-tail-exn type-exception? (lambda () (cddar b0)))
(check-tail-exn type-exception? (lambda () (cddar b1)))
(check-tail-exn type-exception? (lambda () (cddar b2)))
(check-tail-exn type-exception? (lambda () (cddar b3)))
(check-tail-exn type-exception? (lambda () (cddar b4)))
(check-tail-exn type-exception? (lambda () (cddar b5)))
(check-tail-exn type-exception? (lambda () (cddar b6)))
(check-tail-exn type-exception? (lambda () (cddar b7)))
(check-eqv? (cddar c0) 3)
(check-eqv? (cddar c1) 11)
(check-eqv? (cddar c2) 19)
(check-eqv? (cddar c3) 27)
(check-eq? (cddar d0) a3)
(check-eq? (cddar d1) a11)
(check-eq? (cddar e0) b3)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cddar)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cddar a0 a0)))

(check-tail-exn type-exception? (lambda () (cdddr bool)))
(check-tail-exn type-exception? (lambda () (cdddr a0)))
(check-tail-exn type-exception? (lambda () (cdddr a1)))
(check-tail-exn type-exception? (lambda () (cdddr a2)))
(check-tail-exn type-exception? (lambda () (cdddr a3)))
(check-tail-exn type-exception? (lambda () (cdddr a4)))
(check-tail-exn type-exception? (lambda () (cdddr a5)))
(check-tail-exn type-exception? (lambda () (cdddr a6)))
(check-tail-exn type-exception? (lambda () (cdddr a7)))
(check-tail-exn type-exception? (lambda () (cdddr a8)))
(check-tail-exn type-exception? (lambda () (cdddr a9)))
(check-tail-exn type-exception? (lambda () (cdddr a10)))
(check-tail-exn type-exception? (lambda () (cdddr a11)))
(check-tail-exn type-exception? (lambda () (cdddr a12)))
(check-tail-exn type-exception? (lambda () (cdddr a13)))
(check-tail-exn type-exception? (lambda () (cdddr a14)))
(check-tail-exn type-exception? (lambda () (cdddr a15)))
(check-tail-exn type-exception? (lambda () (cdddr b0)))
(check-tail-exn type-exception? (lambda () (cdddr b1)))
(check-tail-exn type-exception? (lambda () (cdddr b2)))
(check-tail-exn type-exception? (lambda () (cdddr b3)))
(check-tail-exn type-exception? (lambda () (cdddr b4)))
(check-tail-exn type-exception? (lambda () (cdddr b5)))
(check-tail-exn type-exception? (lambda () (cdddr b6)))
(check-tail-exn type-exception? (lambda () (cdddr b7)))
(check-eqv? (cdddr c0) 7)
(check-eqv? (cdddr c1) 15)
(check-eqv? (cdddr c2) 23)
(check-eqv? (cdddr c3) 31)
(check-eq? (cdddr d0) a7)
(check-eq? (cdddr d1) a15)
(check-eq? (cdddr e0) b7)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cdddr)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cdddr a0 a0)))

(check-tail-exn type-exception? (lambda () (caaaar bool)))
(check-tail-exn type-exception? (lambda () (caaaar a0)))
(check-tail-exn type-exception? (lambda () (caaaar a1)))
(check-tail-exn type-exception? (lambda () (caaaar a2)))
(check-tail-exn type-exception? (lambda () (caaaar a3)))
(check-tail-exn type-exception? (lambda () (caaaar a4)))
(check-tail-exn type-exception? (lambda () (caaaar a5)))
(check-tail-exn type-exception? (lambda () (caaaar a6)))
(check-tail-exn type-exception? (lambda () (caaaar a7)))
(check-tail-exn type-exception? (lambda () (caaaar a8)))
(check-tail-exn type-exception? (lambda () (caaaar a9)))
(check-tail-exn type-exception? (lambda () (caaaar a10)))
(check-tail-exn type-exception? (lambda () (caaaar a11)))
(check-tail-exn type-exception? (lambda () (caaaar a12)))
(check-tail-exn type-exception? (lambda () (caaaar a13)))
(check-tail-exn type-exception? (lambda () (caaaar a14)))
(check-tail-exn type-exception? (lambda () (caaaar a15)))
(check-tail-exn type-exception? (lambda () (caaaar b0)))
(check-tail-exn type-exception? (lambda () (caaaar b1)))
(check-tail-exn type-exception? (lambda () (caaaar b2)))
(check-tail-exn type-exception? (lambda () (caaaar b3)))
(check-tail-exn type-exception? (lambda () (caaaar b4)))
(check-tail-exn type-exception? (lambda () (caaaar b5)))
(check-tail-exn type-exception? (lambda () (caaaar b6)))
(check-tail-exn type-exception? (lambda () (caaaar b7)))
(check-tail-exn type-exception? (lambda () (caaaar c0)))
(check-tail-exn type-exception? (lambda () (caaaar c1)))
(check-tail-exn type-exception? (lambda () (caaaar c2)))
(check-tail-exn type-exception? (lambda () (caaaar c3)))
(check-eqv? (caaaar d0) 0)
(check-eqv? (caaaar d1) 16)
(check-eq? (caaaar e0) a0)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (caaaar)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (caaaar a0 a0)))

(check-tail-exn type-exception? (lambda () (caaadr bool)))
(check-tail-exn type-exception? (lambda () (caaadr a0)))
(check-tail-exn type-exception? (lambda () (caaadr a1)))
(check-tail-exn type-exception? (lambda () (caaadr a2)))
(check-tail-exn type-exception? (lambda () (caaadr a3)))
(check-tail-exn type-exception? (lambda () (caaadr a4)))
(check-tail-exn type-exception? (lambda () (caaadr a5)))
(check-tail-exn type-exception? (lambda () (caaadr a6)))
(check-tail-exn type-exception? (lambda () (caaadr a7)))
(check-tail-exn type-exception? (lambda () (caaadr a8)))
(check-tail-exn type-exception? (lambda () (caaadr a9)))
(check-tail-exn type-exception? (lambda () (caaadr a10)))
(check-tail-exn type-exception? (lambda () (caaadr a11)))
(check-tail-exn type-exception? (lambda () (caaadr a12)))
(check-tail-exn type-exception? (lambda () (caaadr a13)))
(check-tail-exn type-exception? (lambda () (caaadr a14)))
(check-tail-exn type-exception? (lambda () (caaadr a15)))
(check-tail-exn type-exception? (lambda () (caaadr b0)))
(check-tail-exn type-exception? (lambda () (caaadr b1)))
(check-tail-exn type-exception? (lambda () (caaadr b2)))
(check-tail-exn type-exception? (lambda () (caaadr b3)))
(check-tail-exn type-exception? (lambda () (caaadr b4)))
(check-tail-exn type-exception? (lambda () (caaadr b5)))
(check-tail-exn type-exception? (lambda () (caaadr b6)))
(check-tail-exn type-exception? (lambda () (caaadr b7)))
(check-tail-exn type-exception? (lambda () (caaadr c0)))
(check-tail-exn type-exception? (lambda () (caaadr c1)))
(check-tail-exn type-exception? (lambda () (caaadr c2)))
(check-tail-exn type-exception? (lambda () (caaadr c3)))
(check-eqv? (caaadr d0) 8)
(check-eqv? (caaadr d1) 24)
(check-eq? (caaadr e0) a8)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (caaadr)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (caaadr a0 a0)))

(check-tail-exn type-exception? (lambda () (caadar bool)))
(check-tail-exn type-exception? (lambda () (caadar a0)))
(check-tail-exn type-exception? (lambda () (caadar a1)))
(check-tail-exn type-exception? (lambda () (caadar a2)))
(check-tail-exn type-exception? (lambda () (caadar a3)))
(check-tail-exn type-exception? (lambda () (caadar a4)))
(check-tail-exn type-exception? (lambda () (caadar a5)))
(check-tail-exn type-exception? (lambda () (caadar a6)))
(check-tail-exn type-exception? (lambda () (caadar a7)))
(check-tail-exn type-exception? (lambda () (caadar a8)))
(check-tail-exn type-exception? (lambda () (caadar a9)))
(check-tail-exn type-exception? (lambda () (caadar a10)))
(check-tail-exn type-exception? (lambda () (caadar a11)))
(check-tail-exn type-exception? (lambda () (caadar a12)))
(check-tail-exn type-exception? (lambda () (caadar a13)))
(check-tail-exn type-exception? (lambda () (caadar a14)))
(check-tail-exn type-exception? (lambda () (caadar a15)))
(check-tail-exn type-exception? (lambda () (caadar b0)))
(check-tail-exn type-exception? (lambda () (caadar b1)))
(check-tail-exn type-exception? (lambda () (caadar b2)))
(check-tail-exn type-exception? (lambda () (caadar b3)))
(check-tail-exn type-exception? (lambda () (caadar b4)))
(check-tail-exn type-exception? (lambda () (caadar b5)))
(check-tail-exn type-exception? (lambda () (caadar b6)))
(check-tail-exn type-exception? (lambda () (caadar b7)))
(check-tail-exn type-exception? (lambda () (caadar c0)))
(check-tail-exn type-exception? (lambda () (caadar c1)))
(check-tail-exn type-exception? (lambda () (caadar c2)))
(check-tail-exn type-exception? (lambda () (caadar c3)))
(check-eqv? (caadar d0) 4)
(check-eqv? (caadar d1) 20)
(check-eq? (caadar e0) a4)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (caadar)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (caadar a0 a0)))

(check-tail-exn type-exception? (lambda () (caaddr bool)))
(check-tail-exn type-exception? (lambda () (caaddr a0)))
(check-tail-exn type-exception? (lambda () (caaddr a1)))
(check-tail-exn type-exception? (lambda () (caaddr a2)))
(check-tail-exn type-exception? (lambda () (caaddr a3)))
(check-tail-exn type-exception? (lambda () (caaddr a4)))
(check-tail-exn type-exception? (lambda () (caaddr a5)))
(check-tail-exn type-exception? (lambda () (caaddr a6)))
(check-tail-exn type-exception? (lambda () (caaddr a7)))
(check-tail-exn type-exception? (lambda () (caaddr a8)))
(check-tail-exn type-exception? (lambda () (caaddr a9)))
(check-tail-exn type-exception? (lambda () (caaddr a10)))
(check-tail-exn type-exception? (lambda () (caaddr a11)))
(check-tail-exn type-exception? (lambda () (caaddr a12)))
(check-tail-exn type-exception? (lambda () (caaddr a13)))
(check-tail-exn type-exception? (lambda () (caaddr a14)))
(check-tail-exn type-exception? (lambda () (caaddr a15)))
(check-tail-exn type-exception? (lambda () (caaddr b0)))
(check-tail-exn type-exception? (lambda () (caaddr b1)))
(check-tail-exn type-exception? (lambda () (caaddr b2)))
(check-tail-exn type-exception? (lambda () (caaddr b3)))
(check-tail-exn type-exception? (lambda () (caaddr b4)))
(check-tail-exn type-exception? (lambda () (caaddr b5)))
(check-tail-exn type-exception? (lambda () (caaddr b6)))
(check-tail-exn type-exception? (lambda () (caaddr b7)))
(check-tail-exn type-exception? (lambda () (caaddr c0)))
(check-tail-exn type-exception? (lambda () (caaddr c1)))
(check-tail-exn type-exception? (lambda () (caaddr c2)))
(check-tail-exn type-exception? (lambda () (caaddr c3)))
(check-eqv? (caaddr d0) 12)
(check-eqv? (caaddr d1) 28)
(check-eq? (caaddr e0) a12)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (caaddr)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (caaddr a0 a0)))

(check-tail-exn type-exception? (lambda () (cadaar bool)))
(check-tail-exn type-exception? (lambda () (cadaar a0)))
(check-tail-exn type-exception? (lambda () (cadaar a1)))
(check-tail-exn type-exception? (lambda () (cadaar a2)))
(check-tail-exn type-exception? (lambda () (cadaar a3)))
(check-tail-exn type-exception? (lambda () (cadaar a4)))
(check-tail-exn type-exception? (lambda () (cadaar a5)))
(check-tail-exn type-exception? (lambda () (cadaar a6)))
(check-tail-exn type-exception? (lambda () (cadaar a7)))
(check-tail-exn type-exception? (lambda () (cadaar a8)))
(check-tail-exn type-exception? (lambda () (cadaar a9)))
(check-tail-exn type-exception? (lambda () (cadaar a10)))
(check-tail-exn type-exception? (lambda () (cadaar a11)))
(check-tail-exn type-exception? (lambda () (cadaar a12)))
(check-tail-exn type-exception? (lambda () (cadaar a13)))
(check-tail-exn type-exception? (lambda () (cadaar a14)))
(check-tail-exn type-exception? (lambda () (cadaar a15)))
(check-tail-exn type-exception? (lambda () (cadaar b0)))
(check-tail-exn type-exception? (lambda () (cadaar b1)))
(check-tail-exn type-exception? (lambda () (cadaar b2)))
(check-tail-exn type-exception? (lambda () (cadaar b3)))
(check-tail-exn type-exception? (lambda () (cadaar b4)))
(check-tail-exn type-exception? (lambda () (cadaar b5)))
(check-tail-exn type-exception? (lambda () (cadaar b6)))
(check-tail-exn type-exception? (lambda () (cadaar b7)))
(check-tail-exn type-exception? (lambda () (cadaar c0)))
(check-tail-exn type-exception? (lambda () (cadaar c1)))
(check-tail-exn type-exception? (lambda () (cadaar c2)))
(check-tail-exn type-exception? (lambda () (cadaar c3)))
(check-eqv? (cadaar d0) 2)
(check-eqv? (cadaar d1) 18)
(check-eq? (cadaar e0) a2)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cadaar)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cadaar a0 a0)))

(check-tail-exn type-exception? (lambda () (cadadr bool)))
(check-tail-exn type-exception? (lambda () (cadadr a0)))
(check-tail-exn type-exception? (lambda () (cadadr a1)))
(check-tail-exn type-exception? (lambda () (cadadr a2)))
(check-tail-exn type-exception? (lambda () (cadadr a3)))
(check-tail-exn type-exception? (lambda () (cadadr a4)))
(check-tail-exn type-exception? (lambda () (cadadr a5)))
(check-tail-exn type-exception? (lambda () (cadadr a6)))
(check-tail-exn type-exception? (lambda () (cadadr a7)))
(check-tail-exn type-exception? (lambda () (cadadr a8)))
(check-tail-exn type-exception? (lambda () (cadadr a9)))
(check-tail-exn type-exception? (lambda () (cadadr a10)))
(check-tail-exn type-exception? (lambda () (cadadr a11)))
(check-tail-exn type-exception? (lambda () (cadadr a12)))
(check-tail-exn type-exception? (lambda () (cadadr a13)))
(check-tail-exn type-exception? (lambda () (cadadr a14)))
(check-tail-exn type-exception? (lambda () (cadadr a15)))
(check-tail-exn type-exception? (lambda () (cadadr b0)))
(check-tail-exn type-exception? (lambda () (cadadr b1)))
(check-tail-exn type-exception? (lambda () (cadadr b2)))
(check-tail-exn type-exception? (lambda () (cadadr b3)))
(check-tail-exn type-exception? (lambda () (cadadr b4)))
(check-tail-exn type-exception? (lambda () (cadadr b5)))
(check-tail-exn type-exception? (lambda () (cadadr b6)))
(check-tail-exn type-exception? (lambda () (cadadr b7)))
(check-tail-exn type-exception? (lambda () (cadadr c0)))
(check-tail-exn type-exception? (lambda () (cadadr c1)))
(check-tail-exn type-exception? (lambda () (cadadr c2)))
(check-tail-exn type-exception? (lambda () (cadadr c3)))
(check-eqv? (cadadr d0) 10)
(check-eqv? (cadadr d1) 26)
(check-eq? (cadadr e0) a10)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cadadr)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cadadr a0 a0)))

(check-tail-exn type-exception? (lambda () (caddar bool)))
(check-tail-exn type-exception? (lambda () (caddar a0)))
(check-tail-exn type-exception? (lambda () (caddar a1)))
(check-tail-exn type-exception? (lambda () (caddar a2)))
(check-tail-exn type-exception? (lambda () (caddar a3)))
(check-tail-exn type-exception? (lambda () (caddar a4)))
(check-tail-exn type-exception? (lambda () (caddar a5)))
(check-tail-exn type-exception? (lambda () (caddar a6)))
(check-tail-exn type-exception? (lambda () (caddar a7)))
(check-tail-exn type-exception? (lambda () (caddar a8)))
(check-tail-exn type-exception? (lambda () (caddar a9)))
(check-tail-exn type-exception? (lambda () (caddar a10)))
(check-tail-exn type-exception? (lambda () (caddar a11)))
(check-tail-exn type-exception? (lambda () (caddar a12)))
(check-tail-exn type-exception? (lambda () (caddar a13)))
(check-tail-exn type-exception? (lambda () (caddar a14)))
(check-tail-exn type-exception? (lambda () (caddar a15)))
(check-tail-exn type-exception? (lambda () (caddar b0)))
(check-tail-exn type-exception? (lambda () (caddar b1)))
(check-tail-exn type-exception? (lambda () (caddar b2)))
(check-tail-exn type-exception? (lambda () (caddar b3)))
(check-tail-exn type-exception? (lambda () (caddar b4)))
(check-tail-exn type-exception? (lambda () (caddar b5)))
(check-tail-exn type-exception? (lambda () (caddar b6)))
(check-tail-exn type-exception? (lambda () (caddar b7)))
(check-tail-exn type-exception? (lambda () (caddar c0)))
(check-tail-exn type-exception? (lambda () (caddar c1)))
(check-tail-exn type-exception? (lambda () (caddar c2)))
(check-tail-exn type-exception? (lambda () (caddar c3)))
(check-eqv? (caddar d0) 6)
(check-eqv? (caddar d1) 22)
(check-eq? (caddar e0) a6)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (caddar)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (caddar a0 a0)))

(check-tail-exn type-exception? (lambda () (cadddr bool)))
(check-tail-exn type-exception? (lambda () (cadddr a0)))
(check-tail-exn type-exception? (lambda () (cadddr a1)))
(check-tail-exn type-exception? (lambda () (cadddr a2)))
(check-tail-exn type-exception? (lambda () (cadddr a3)))
(check-tail-exn type-exception? (lambda () (cadddr a4)))
(check-tail-exn type-exception? (lambda () (cadddr a5)))
(check-tail-exn type-exception? (lambda () (cadddr a6)))
(check-tail-exn type-exception? (lambda () (cadddr a7)))
(check-tail-exn type-exception? (lambda () (cadddr a8)))
(check-tail-exn type-exception? (lambda () (cadddr a9)))
(check-tail-exn type-exception? (lambda () (cadddr a10)))
(check-tail-exn type-exception? (lambda () (cadddr a11)))
(check-tail-exn type-exception? (lambda () (cadddr a12)))
(check-tail-exn type-exception? (lambda () (cadddr a13)))
(check-tail-exn type-exception? (lambda () (cadddr a14)))
(check-tail-exn type-exception? (lambda () (cadddr a15)))
(check-tail-exn type-exception? (lambda () (cadddr b0)))
(check-tail-exn type-exception? (lambda () (cadddr b1)))
(check-tail-exn type-exception? (lambda () (cadddr b2)))
(check-tail-exn type-exception? (lambda () (cadddr b3)))
(check-tail-exn type-exception? (lambda () (cadddr b4)))
(check-tail-exn type-exception? (lambda () (cadddr b5)))
(check-tail-exn type-exception? (lambda () (cadddr b6)))
(check-tail-exn type-exception? (lambda () (cadddr b7)))
(check-tail-exn type-exception? (lambda () (cadddr c0)))
(check-tail-exn type-exception? (lambda () (cadddr c1)))
(check-tail-exn type-exception? (lambda () (cadddr c2)))
(check-tail-exn type-exception? (lambda () (cadddr c3)))
(check-eqv? (cadddr d0) 14)
(check-eqv? (cadddr d1) 30)
(check-eq? (cadddr e0) a14)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cadddr)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cadddr a0 a0)))

(check-tail-exn type-exception? (lambda () (cdaaar bool)))
(check-tail-exn type-exception? (lambda () (cdaaar a0)))
(check-tail-exn type-exception? (lambda () (cdaaar a1)))
(check-tail-exn type-exception? (lambda () (cdaaar a2)))
(check-tail-exn type-exception? (lambda () (cdaaar a3)))
(check-tail-exn type-exception? (lambda () (cdaaar a4)))
(check-tail-exn type-exception? (lambda () (cdaaar a5)))
(check-tail-exn type-exception? (lambda () (cdaaar a6)))
(check-tail-exn type-exception? (lambda () (cdaaar a7)))
(check-tail-exn type-exception? (lambda () (cdaaar a8)))
(check-tail-exn type-exception? (lambda () (cdaaar a9)))
(check-tail-exn type-exception? (lambda () (cdaaar a10)))
(check-tail-exn type-exception? (lambda () (cdaaar a11)))
(check-tail-exn type-exception? (lambda () (cdaaar a12)))
(check-tail-exn type-exception? (lambda () (cdaaar a13)))
(check-tail-exn type-exception? (lambda () (cdaaar a14)))
(check-tail-exn type-exception? (lambda () (cdaaar a15)))
(check-tail-exn type-exception? (lambda () (cdaaar b0)))
(check-tail-exn type-exception? (lambda () (cdaaar b1)))
(check-tail-exn type-exception? (lambda () (cdaaar b2)))
(check-tail-exn type-exception? (lambda () (cdaaar b3)))
(check-tail-exn type-exception? (lambda () (cdaaar b4)))
(check-tail-exn type-exception? (lambda () (cdaaar b5)))
(check-tail-exn type-exception? (lambda () (cdaaar b6)))
(check-tail-exn type-exception? (lambda () (cdaaar b7)))
(check-tail-exn type-exception? (lambda () (cdaaar c0)))
(check-tail-exn type-exception? (lambda () (cdaaar c1)))
(check-tail-exn type-exception? (lambda () (cdaaar c2)))
(check-tail-exn type-exception? (lambda () (cdaaar c3)))
(check-eqv? (cdaaar d0) 1)
(check-eqv? (cdaaar d1) 17)
(check-eq? (cdaaar e0) a1)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cdaaar)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cdaaar a0 a0)))

(check-tail-exn type-exception? (lambda () (cdaadr bool)))
(check-tail-exn type-exception? (lambda () (cdaadr a0)))
(check-tail-exn type-exception? (lambda () (cdaadr a1)))
(check-tail-exn type-exception? (lambda () (cdaadr a2)))
(check-tail-exn type-exception? (lambda () (cdaadr a3)))
(check-tail-exn type-exception? (lambda () (cdaadr a4)))
(check-tail-exn type-exception? (lambda () (cdaadr a5)))
(check-tail-exn type-exception? (lambda () (cdaadr a6)))
(check-tail-exn type-exception? (lambda () (cdaadr a7)))
(check-tail-exn type-exception? (lambda () (cdaadr a8)))
(check-tail-exn type-exception? (lambda () (cdaadr a9)))
(check-tail-exn type-exception? (lambda () (cdaadr a10)))
(check-tail-exn type-exception? (lambda () (cdaadr a11)))
(check-tail-exn type-exception? (lambda () (cdaadr a12)))
(check-tail-exn type-exception? (lambda () (cdaadr a13)))
(check-tail-exn type-exception? (lambda () (cdaadr a14)))
(check-tail-exn type-exception? (lambda () (cdaadr a15)))
(check-tail-exn type-exception? (lambda () (cdaadr b0)))
(check-tail-exn type-exception? (lambda () (cdaadr b1)))
(check-tail-exn type-exception? (lambda () (cdaadr b2)))
(check-tail-exn type-exception? (lambda () (cdaadr b3)))
(check-tail-exn type-exception? (lambda () (cdaadr b4)))
(check-tail-exn type-exception? (lambda () (cdaadr b5)))
(check-tail-exn type-exception? (lambda () (cdaadr b6)))
(check-tail-exn type-exception? (lambda () (cdaadr b7)))
(check-tail-exn type-exception? (lambda () (cdaadr c0)))
(check-tail-exn type-exception? (lambda () (cdaadr c1)))
(check-tail-exn type-exception? (lambda () (cdaadr c2)))
(check-tail-exn type-exception? (lambda () (cdaadr c3)))
(check-eqv? (cdaadr d0) 9)
(check-eqv? (cdaadr d1) 25)
(check-eq? (cdaadr e0) a9)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cdaadr)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cdaadr a0 a0)))

(check-tail-exn type-exception? (lambda () (cdadar bool)))
(check-tail-exn type-exception? (lambda () (cdadar a0)))
(check-tail-exn type-exception? (lambda () (cdadar a1)))
(check-tail-exn type-exception? (lambda () (cdadar a2)))
(check-tail-exn type-exception? (lambda () (cdadar a3)))
(check-tail-exn type-exception? (lambda () (cdadar a4)))
(check-tail-exn type-exception? (lambda () (cdadar a5)))
(check-tail-exn type-exception? (lambda () (cdadar a6)))
(check-tail-exn type-exception? (lambda () (cdadar a7)))
(check-tail-exn type-exception? (lambda () (cdadar a8)))
(check-tail-exn type-exception? (lambda () (cdadar a9)))
(check-tail-exn type-exception? (lambda () (cdadar a10)))
(check-tail-exn type-exception? (lambda () (cdadar a11)))
(check-tail-exn type-exception? (lambda () (cdadar a12)))
(check-tail-exn type-exception? (lambda () (cdadar a13)))
(check-tail-exn type-exception? (lambda () (cdadar a14)))
(check-tail-exn type-exception? (lambda () (cdadar a15)))
(check-tail-exn type-exception? (lambda () (cdadar b0)))
(check-tail-exn type-exception? (lambda () (cdadar b1)))
(check-tail-exn type-exception? (lambda () (cdadar b2)))
(check-tail-exn type-exception? (lambda () (cdadar b3)))
(check-tail-exn type-exception? (lambda () (cdadar b4)))
(check-tail-exn type-exception? (lambda () (cdadar b5)))
(check-tail-exn type-exception? (lambda () (cdadar b6)))
(check-tail-exn type-exception? (lambda () (cdadar b7)))
(check-tail-exn type-exception? (lambda () (cdadar c0)))
(check-tail-exn type-exception? (lambda () (cdadar c1)))
(check-tail-exn type-exception? (lambda () (cdadar c2)))
(check-tail-exn type-exception? (lambda () (cdadar c3)))
(check-eqv? (cdadar d0) 5)
(check-eqv? (cdadar d1) 21)
(check-eq? (cdadar e0) a5)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cdadar)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cdadar a0 a0)))

(check-tail-exn type-exception? (lambda () (cdaddr bool)))
(check-tail-exn type-exception? (lambda () (cdaddr a0)))
(check-tail-exn type-exception? (lambda () (cdaddr a1)))
(check-tail-exn type-exception? (lambda () (cdaddr a2)))
(check-tail-exn type-exception? (lambda () (cdaddr a3)))
(check-tail-exn type-exception? (lambda () (cdaddr a4)))
(check-tail-exn type-exception? (lambda () (cdaddr a5)))
(check-tail-exn type-exception? (lambda () (cdaddr a6)))
(check-tail-exn type-exception? (lambda () (cdaddr a7)))
(check-tail-exn type-exception? (lambda () (cdaddr a8)))
(check-tail-exn type-exception? (lambda () (cdaddr a9)))
(check-tail-exn type-exception? (lambda () (cdaddr a10)))
(check-tail-exn type-exception? (lambda () (cdaddr a11)))
(check-tail-exn type-exception? (lambda () (cdaddr a12)))
(check-tail-exn type-exception? (lambda () (cdaddr a13)))
(check-tail-exn type-exception? (lambda () (cdaddr a14)))
(check-tail-exn type-exception? (lambda () (cdaddr a15)))
(check-tail-exn type-exception? (lambda () (cdaddr b0)))
(check-tail-exn type-exception? (lambda () (cdaddr b1)))
(check-tail-exn type-exception? (lambda () (cdaddr b2)))
(check-tail-exn type-exception? (lambda () (cdaddr b3)))
(check-tail-exn type-exception? (lambda () (cdaddr b4)))
(check-tail-exn type-exception? (lambda () (cdaddr b5)))
(check-tail-exn type-exception? (lambda () (cdaddr b6)))
(check-tail-exn type-exception? (lambda () (cdaddr b7)))
(check-tail-exn type-exception? (lambda () (cdaddr c0)))
(check-tail-exn type-exception? (lambda () (cdaddr c1)))
(check-tail-exn type-exception? (lambda () (cdaddr c2)))
(check-tail-exn type-exception? (lambda () (cdaddr c3)))
(check-eqv? (cdaddr d0) 13)
(check-eqv? (cdaddr d1) 29)
(check-eq? (cdaddr e0) a13)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cdaddr)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cdaddr a0 a0)))

(check-tail-exn type-exception? (lambda () (cddaar bool)))
(check-tail-exn type-exception? (lambda () (cddaar a0)))
(check-tail-exn type-exception? (lambda () (cddaar a1)))
(check-tail-exn type-exception? (lambda () (cddaar a2)))
(check-tail-exn type-exception? (lambda () (cddaar a3)))
(check-tail-exn type-exception? (lambda () (cddaar a4)))
(check-tail-exn type-exception? (lambda () (cddaar a5)))
(check-tail-exn type-exception? (lambda () (cddaar a6)))
(check-tail-exn type-exception? (lambda () (cddaar a7)))
(check-tail-exn type-exception? (lambda () (cddaar a8)))
(check-tail-exn type-exception? (lambda () (cddaar a9)))
(check-tail-exn type-exception? (lambda () (cddaar a10)))
(check-tail-exn type-exception? (lambda () (cddaar a11)))
(check-tail-exn type-exception? (lambda () (cddaar a12)))
(check-tail-exn type-exception? (lambda () (cddaar a13)))
(check-tail-exn type-exception? (lambda () (cddaar a14)))
(check-tail-exn type-exception? (lambda () (cddaar a15)))
(check-tail-exn type-exception? (lambda () (cddaar b0)))
(check-tail-exn type-exception? (lambda () (cddaar b1)))
(check-tail-exn type-exception? (lambda () (cddaar b2)))
(check-tail-exn type-exception? (lambda () (cddaar b3)))
(check-tail-exn type-exception? (lambda () (cddaar b4)))
(check-tail-exn type-exception? (lambda () (cddaar b5)))
(check-tail-exn type-exception? (lambda () (cddaar b6)))
(check-tail-exn type-exception? (lambda () (cddaar b7)))
(check-tail-exn type-exception? (lambda () (cddaar c0)))
(check-tail-exn type-exception? (lambda () (cddaar c1)))
(check-tail-exn type-exception? (lambda () (cddaar c2)))
(check-tail-exn type-exception? (lambda () (cddaar c3)))
(check-eqv? (cddaar d0) 3)
(check-eqv? (cddaar d1) 19)
(check-eq? (cddaar e0) a3)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cddaar)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cddaar a0 a0)))

(check-tail-exn type-exception? (lambda () (cddadr bool)))
(check-tail-exn type-exception? (lambda () (cddadr a0)))
(check-tail-exn type-exception? (lambda () (cddadr a1)))
(check-tail-exn type-exception? (lambda () (cddadr a2)))
(check-tail-exn type-exception? (lambda () (cddadr a3)))
(check-tail-exn type-exception? (lambda () (cddadr a4)))
(check-tail-exn type-exception? (lambda () (cddadr a5)))
(check-tail-exn type-exception? (lambda () (cddadr a6)))
(check-tail-exn type-exception? (lambda () (cddadr a7)))
(check-tail-exn type-exception? (lambda () (cddadr a8)))
(check-tail-exn type-exception? (lambda () (cddadr a9)))
(check-tail-exn type-exception? (lambda () (cddadr a10)))
(check-tail-exn type-exception? (lambda () (cddadr a11)))
(check-tail-exn type-exception? (lambda () (cddadr a12)))
(check-tail-exn type-exception? (lambda () (cddadr a13)))
(check-tail-exn type-exception? (lambda () (cddadr a14)))
(check-tail-exn type-exception? (lambda () (cddadr a15)))
(check-tail-exn type-exception? (lambda () (cddadr b0)))
(check-tail-exn type-exception? (lambda () (cddadr b1)))
(check-tail-exn type-exception? (lambda () (cddadr b2)))
(check-tail-exn type-exception? (lambda () (cddadr b3)))
(check-tail-exn type-exception? (lambda () (cddadr b4)))
(check-tail-exn type-exception? (lambda () (cddadr b5)))
(check-tail-exn type-exception? (lambda () (cddadr b6)))
(check-tail-exn type-exception? (lambda () (cddadr b7)))
(check-tail-exn type-exception? (lambda () (cddadr c0)))
(check-tail-exn type-exception? (lambda () (cddadr c1)))
(check-tail-exn type-exception? (lambda () (cddadr c2)))
(check-tail-exn type-exception? (lambda () (cddadr c3)))
(check-eqv? (cddadr d0) 11)
(check-eqv? (cddadr d1) 27)
(check-eq? (cddadr e0) a11)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cddadr)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cddadr a0 a0)))

(check-tail-exn type-exception? (lambda () (cdddar bool)))
(check-tail-exn type-exception? (lambda () (cdddar a0)))
(check-tail-exn type-exception? (lambda () (cdddar a1)))
(check-tail-exn type-exception? (lambda () (cdddar a2)))
(check-tail-exn type-exception? (lambda () (cdddar a3)))
(check-tail-exn type-exception? (lambda () (cdddar a4)))
(check-tail-exn type-exception? (lambda () (cdddar a5)))
(check-tail-exn type-exception? (lambda () (cdddar a6)))
(check-tail-exn type-exception? (lambda () (cdddar a7)))
(check-tail-exn type-exception? (lambda () (cdddar a8)))
(check-tail-exn type-exception? (lambda () (cdddar a9)))
(check-tail-exn type-exception? (lambda () (cdddar a10)))
(check-tail-exn type-exception? (lambda () (cdddar a11)))
(check-tail-exn type-exception? (lambda () (cdddar a12)))
(check-tail-exn type-exception? (lambda () (cdddar a13)))
(check-tail-exn type-exception? (lambda () (cdddar a14)))
(check-tail-exn type-exception? (lambda () (cdddar a15)))
(check-tail-exn type-exception? (lambda () (cdddar b0)))
(check-tail-exn type-exception? (lambda () (cdddar b1)))
(check-tail-exn type-exception? (lambda () (cdddar b2)))
(check-tail-exn type-exception? (lambda () (cdddar b3)))
(check-tail-exn type-exception? (lambda () (cdddar b4)))
(check-tail-exn type-exception? (lambda () (cdddar b5)))
(check-tail-exn type-exception? (lambda () (cdddar b6)))
(check-tail-exn type-exception? (lambda () (cdddar b7)))
(check-tail-exn type-exception? (lambda () (cdddar c0)))
(check-tail-exn type-exception? (lambda () (cdddar c1)))
(check-tail-exn type-exception? (lambda () (cdddar c2)))
(check-tail-exn type-exception? (lambda () (cdddar c3)))
(check-eqv? (cdddar d0) 7)
(check-eqv? (cdddar d1) 23)
(check-eq? (cdddar e0) a7)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cdddar)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cdddar a0 a0)))

(check-tail-exn type-exception? (lambda () (cddddr bool)))
(check-tail-exn type-exception? (lambda () (cddddr a0)))
(check-tail-exn type-exception? (lambda () (cddddr a1)))
(check-tail-exn type-exception? (lambda () (cddddr a2)))
(check-tail-exn type-exception? (lambda () (cddddr a3)))
(check-tail-exn type-exception? (lambda () (cddddr a4)))
(check-tail-exn type-exception? (lambda () (cddddr a5)))
(check-tail-exn type-exception? (lambda () (cddddr a6)))
(check-tail-exn type-exception? (lambda () (cddddr a7)))
(check-tail-exn type-exception? (lambda () (cddddr a8)))
(check-tail-exn type-exception? (lambda () (cddddr a9)))
(check-tail-exn type-exception? (lambda () (cddddr a10)))
(check-tail-exn type-exception? (lambda () (cddddr a11)))
(check-tail-exn type-exception? (lambda () (cddddr a12)))
(check-tail-exn type-exception? (lambda () (cddddr a13)))
(check-tail-exn type-exception? (lambda () (cddddr a14)))
(check-tail-exn type-exception? (lambda () (cddddr a15)))
(check-tail-exn type-exception? (lambda () (cddddr b0)))
(check-tail-exn type-exception? (lambda () (cddddr b1)))
(check-tail-exn type-exception? (lambda () (cddddr b2)))
(check-tail-exn type-exception? (lambda () (cddddr b3)))
(check-tail-exn type-exception? (lambda () (cddddr b4)))
(check-tail-exn type-exception? (lambda () (cddddr b5)))
(check-tail-exn type-exception? (lambda () (cddddr b6)))
(check-tail-exn type-exception? (lambda () (cddddr b7)))
(check-tail-exn type-exception? (lambda () (cddddr c0)))
(check-tail-exn type-exception? (lambda () (cddddr c1)))
(check-tail-exn type-exception? (lambda () (cddddr c2)))
(check-tail-exn type-exception? (lambda () (cddddr c3)))
(check-eqv? (cddddr d0) 15)
(check-eqv? (cddddr d1) 31)
(check-eq? (cddddr e0) a15)
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cddddr)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (cddddr a0 a0)))

#|

;; tests were generated with this code

(define a0  (cons 0 1))
(define a1  (cons 2 3))
(define a2  (cons 4 5))
(define a3  (cons 6 7))
(define a4  (cons 8 9))
(define a5  (cons 10 11))
(define a6  (cons 12 13))
(define a7  (cons 14 15))
(define a8  (cons 16 17))
(define a9  (cons 18 19))
(define a10 (cons 20 21))
(define a11 (cons 22 23))
(define a12 (cons 24 25))
(define a13 (cons 26 27))
(define a14 (cons 28 29))
(define a15 (cons 30 31))

(define b0  (cons a0 a1))
(define b1  (cons a2 a3))
(define b2  (cons a4 a5))
(define b3  (cons a6 a7))
(define b4  (cons a8 a9))
(define b5  (cons a10 a11))
(define b6  (cons a12 a13))
(define b7  (cons a14 a15))

(define c0  (cons b0 b1))
(define c1  (cons b2 b3))
(define c2  (cons b4 b5))
(define c3  (cons b6 b7))

(define d0  (cons c0 c1))
(define d1  (cons c2 c3))

(define e0  (cons d0 d1))

(define defs
  (list (cons 'a0  a0 )
        (cons 'a1  a1 )
        (cons 'a2  a2 )
        (cons 'a3  a3 )
        (cons 'a4  a4 )
        (cons 'a5  a5 )
        (cons 'a6  a6 )
        (cons 'a7  a7 )
        (cons 'a8  a8 )
        (cons 'a9  a9 )
        (cons 'a10 a10)
        (cons 'a11 a11)
        (cons 'a12 a12)
        (cons 'a13 a13)
        (cons 'a14 a14)
        (cons 'a15 a15)
        (cons 'b0  b0 )
        (cons 'b1  b1 )
        (cons 'b2  b2 )
        (cons 'b3  b3 )
        (cons 'b4  b4 )
        (cons 'b5  b5 )
        (cons 'b6  b6 )
        (cons 'b7  b7 )
        (cons 'c0  c0 )
        (cons 'c1  c1 )
        (cons 'c2  c2 )
        (cons 'c3  c3 )
        (cons 'd0  d0 )
        (cons 'd1  d1 )
        (cons 'e0  e0 )))

(define objs
  (list (cons a0  'a0 )
        (cons a1  'a1 )
        (cons a2  'a2 )
        (cons a3  'a3 )
        (cons a4  'a4 )
        (cons a5  'a5 )
        (cons a6  'a6 )
        (cons a7  'a7 )
        (cons a8  'a8 )
        (cons a9  'a9 )
        (cons a10 'a10)
        (cons a11 'a11)
        (cons a12 'a12)
        (cons a13 'a13)
        (cons a14 'a14)
        (cons a15 'a15)
        (cons b0  'b0 )
        (cons b1  'b1 )
        (cons b2  'b2 )
        (cons b3  'b3 )
        (cons b4  'b4 )
        (cons b5  'b5 )
        (cons b6  'b6 )
        (cons b7  'b7 )
        (cons c0  'c0 )
        (cons c1  'c1 )
        (cons c2  'c2 )
        (cons c3  'c3 )
        (cons d0  'd0 )
        (cons d1  'd1 )
        (cons e0  'e0 )))

(define (test prim)
  (newline)
  (write
   `(check-tail-exn type-exception? (lambda () (,prim bool))))
  (newline)
  (let ((p (eval prim)))
    (for-each
     (lambda (var-obj)
       (let ((var (car var-obj))
             (obj (cdr var-obj)))
         (write
          (with-exception-catcher
           (lambda (e)
             `(check-tail-exn type-exception? (lambda () (,prim ,var))))
           (lambda ()
             (let ((result (p obj)))
               (if (number? result)
                   `(check-eqv? (,prim ,var) ,result)
                   (let ((x (assq result objs)))
                     (if x
                         (let ((expected (cdr x)))
                           `(check-eq? (,prim ,var) ,expected))
                         (error "unexpected result"))))))))
         (newline)))
     defs))
  (write
   `(check-tail-exn wrong-number-of-arguments-exception?
                    (lambda () (,prim))))
  (newline)
  (write
   `(check-tail-exn wrong-number-of-arguments-exception?
                    (lambda () (,prim a0 a0))))
  (newline))

(for-each test '(

car
cdr

caar
cadr
cdar
cddr

caaar
caadr
cadar
caddr
cdaar
cdadr
cddar
cdddr

caaaar
caaadr
caadar
caaddr
cadaar
cadadr
caddar
cadddr
cdaaar
cdaadr
cdadar
cdaddr
cddaar
cddadr
cdddar
cddddr

))

|#
