#include <stdio.h>
#include <unistd.h>
void fork4() {
if (fork() != 0) { // Parent process executes this
if (fork() != 0) { // Parent process executes this
fork(); // Creates another process
}
}
}
int main() {
fork4();
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDx1bmlzdGQuaD4KCnZvaWQgZm9yazQoKSB7CiAgICBwcmludGYoIkwwXG4iKTsKCiAgICBpZiAoZm9yaygpICE9IDApIHsgIC8vIFBhcmVudCBwcm9jZXNzIGV4ZWN1dGVzIHRoaXMKICAgICAgICBwcmludGYoIkwxXG4iKTsKCiAgICAgICAgaWYgKGZvcmsoKSAhPSAwKSB7ICAvLyBQYXJlbnQgcHJvY2VzcyBleGVjdXRlcyB0aGlzCiAgICAgICAgICAgIHByaW50ZigiTDJcbiIpOwoKICAgICAgICAgICAgZm9yaygpOyAgLy8gQ3JlYXRlcyBhbm90aGVyIHByb2Nlc3MKICAgICAgICB9CiAgICB9CiAgICAKICAgIHByaW50ZigiQnllXG4iKTsKfQoKaW50IG1haW4oKSB7CiAgICBmb3JrNCgpOwogICAgcmV0dXJuIDA7Cn0K