import socket
import struct
s = socket.socket()
s.connect(("127.0.0.1", 25565))
s.send(struct.pack(">b", 2))
s.send(struct.pack(">b", 49))
s.send(struct.pack(">h", 4) + "dupa".encode("utf-16le"))
s.send(struct.pack(">h", 4) + "crap".encode("utf-16le"))
s.send(struct.pack(">i", 25565))
print " ".join("%02x" % ord(c) for c in s.recv(1024))