import java.io.IOException;

public class Main {
    public static void main(String[] args) throws IOException {
        System.out.println("First separator's length = " + System.getProperty("line.separator").length() + ".");
        System.out.print("First multiline string will be small. It's length = ");
        System.out.println(getString().length() + ".");
        System.out.println();

        System.setProperty("line.separator", "e".repeat(100));
        System.out.println("Second separator's length = " + System.getProperty("line.separator").length() + ".");
        System.out.print("Second multiline string should be huge. It's length = ");
        System.out.println(getString().length() + ".");
    }

    public static String getString() throws java.io.IOException {
        try (java.io.PipedOutputStream pipeOut = new java.io.PipedOutputStream();
             java.io.PipedInputStream pipeIn = new java.io.PipedInputStream();
             java.io.PrintStream outputStream = new java.io.PrintStream(pipeOut);
        ) {
            pipeOut.connect(pipeIn);
            outputStream.println("q");
            outputStream.println("w");
            outputStream.close();

            return new String(pipeIn.readAllBytes());
        }
    }
}