Exercise 3 for the course "Parallel and distributed systems" of THMMY in AUTH university.