(defun int-to-digit (n &key (base 10)) ;; (int-to-digit 123) => (1 2 3)
  (if (zerop n)
      `(0)
      (labels ((rec (n list)
                 (if (= n 0)
                     list
                     (rec (floor n base) (cons (rem n base) list)))))
        (rec n nil))))

(defun solver ()
  (let ((k (read)) (count 0) current  (temp 1))
    (loop for i fixnum from 2 do
          (when (= count k) (return))
          (setf current (/ i (apply #'+ (int-to-digit i))))
          (when (<= temp current)
            (format t "~a~%" (1- i)) (incf count))
          (setf temp current))))

(solver)
