from requests import session
from time import sleep

bot = session()

while True:
    q = bot.get('http://127.0.0.1:8003/').text.split('this: ')[1].split('<')[0]
    try:
        a = eval(q)
    except (NameError, SyntaxError):
        print('flag: ' + q)
        break
    bot.post('http://127.0.0.1:8003/check', data=dict(solution=a))
    print('{} = {}'.format(q, a))
    sleep(0.1)
