import java.io.*;
public class Test {
    public static void main(String args[]) throws Throwable {
	if (args.length == 2) {
	    System.out.close();
	    ProcessBuilder pb = new ProcessBuilder().inheritIO()
		.command(args[0], "Test",
			 args[0], // location of java.exe
			 args[1], // num loops in child process
			 "child");
	    var env = pb.environment();
	    Process process = pb.start();
	    process.waitFor();

	    System.out.println("Done");
	} else {
	    int n = Integer.parseInt(args[1]);
	    for (int i = 0; i < n; i++) {
		System.out.println("Hello");
	    }
	}
    }
}
