common lisp solution by swizard0