I was able to solve this using [tesseract](https://github.com/tesseract-ocr/tesseract).
I converted the ascii art captchas (consisting of 2 different chars) to bitmaps and fed them into tesseract with the following parameters:*tesseditcharwhitelist* - to the given alphabet with few extra chars like 1 and 7 which I converted to T later in the code (they sometimes looked similar in the captcha).*tessedit_unrej_any_wd* - true (that disables dictionary word recognition).and ran with *PSM_SINGLE_LINE* as the page segmentation mode.
That wasn't perfect but they were expecting a certain % of correct answers and it took quite a few runs to get the flag.