(defun char-code-max (a b) (if (char>= a b) a b)) (defun main (&rest argv) (declare (ignorable argv)) (let* ((n (read)) (res 9876543219876543210)) (dotimes (_ n) (let* ((v (read-line)) (base (1+ (parse-integer (string (reduce #'char-code-max v)) :radix 36)))) (setq res (min res (parse-integer v :radix base))))) (format t "~d~%" res))) (main)