#!/usr/bin/python3

import socket
import base64

conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
conn.connect(("challenge01.root-me.org", 51009))

stat = [None]*42
for i in range(42):
	stat[i] = [0]*256

conn.recv(2048).decode()

for k in range(4000):
	conn.send(b'flag\n')
	b64cipher = conn.recv(2048).decode()[17:73]
	cipher = base64.b64decode(b64cipher)
	for i in range(42):
		stat[i][cipher[i]] += 1
conn.close()

for i in range(42):
	for j in range(256):
		if stat[i][j] == 0:
			print(chr(j), end="")
print("")
