Code

#lang racket

(define (cons x y)
  (lambda (m) (m x y)))

(define (car z)
  (z (lambda (p q) p)))

(define (cdr z)
  (z (lambda (p q) q)))

; tests

(define a (cons 10 20))
(car a)
(cdr a)

Output

10
20