4 programs with semaphores and mutex