From chatgpt Gratis, 8 Months ago, written in Prolog.
  1. Your paste - Paste your paste here