import java.net.*;
import java.io.*;
import java.util.zip.*;

public class CompRcv {
  public static void main(String[] args) throws Exception {
    ServerSocket ssock = new ServerSocket(
       Integer.parseInt(args[0]));
    System.out.println("Listening");
    Socket sock=ssock.accept();
    GZIPInputStream zip = new GZIPInputStream(
      sock.getInputStream());
    while (true) {
      int c;
      c = zip.read();
      if (c==-1) break;
      System.out.print((char)c);
      }
    }
  }
