(defun custom-sort (lst) (sort lst (lambda (a b) (let ((first-a (first a)) (first-b (first b)) (second-a (second a)) (second-b (second b))) (or (> first-a first-b) (and (= first-a first-b) (> second-a second-b))))))) (defun main (&rest argv) (declare (ignorable argv)) (let* ((ha (read)) (wa (read)) (hb (read)) (wb (read)) (hc (read)) (wc (read)) (h1 (list ha wa 'A)) (h2 (list hb wb 'B)) (h3 (list hc wc 'C)) (h (custom-sort (list h1 h2 h3)))) (dotimes (i 3) (format t "~a~%" (nth 2 (nth i h)))))) (main)