Using multithreading and recursion.