Rating:

Hint: Make multiple queries in order to find $q$.

Original writeup (https://dunsp4rce.github.io/redpwn-2020/crypto/2020/06/27/ratification.html).