This was a simple python jail escape task. We didn't realize it's a python jail for a long time, because apparently we needed to send "\r\n" after the line. Otherwise the input was just echoed back.
Here is the exploit:
Source for the escape code: http://gynvael.coldwind.pl/n/python_sandbox_escape