import sys sys.stdout.write("This is my string") sys.stdout.flush() for i in range(1000): sys.stdout.write(i.zfill(3)) sys.stdout.flush() a = input() if a == 'unlocked': break