What are the possible values printed by the `println` command in the `Client2` actor? Why? Would the output be different if the commands annotated with `XXX` were issued in the other order? What if both messages are sent through the `Proxy` actor?
## Problem 2: The Josephus Problem
In this exercise, we will revisit the famous *Josephus problem*. In this problem, a group of soldiers trapped by the enemy decide to commit suicide instead of surrendering. In order not to have to take their own lives, the soldiers devise a plan. All soldiers are arranged in a single circle. Each soldier, when it is their turn to act, has to kill the next soldier alive next to them in the clockwise direction. Then, the next soldier that is still alive in the same direction acts. This continues until there remains only one soldier in the circle. This last soldier is the lucky one, and can surrender if he decides to. The *Josephus problem* consists in finding the position in the circle of this lucky soldier, depending on the number of soldiers.
In this exercise, you will implement a *simulation* of the mass killing of the soldiers. Each soldier will be modeled by an actor. Soldiers are arranged in a circle and when their turn comes to act, they kill the next alive soldier in the circle. The next soldier that is still alive in the circle should act next. The last soldier remaining alive does not kill himself but prints out its number to the standard output.
The code on the next page covers the creation of all actors and the initialisation of the system. Your goal is to implement the `receive` method of the actors.
*Hint:* Think about what state the soldier must have.
```scala
classSoldier(number:Int)extendsActor{
// You goal is to implement this.
defreceive:Receive=???
}
objectSoldier{
// The different messages that can be sent between the actors:
// The recipient should die.
caseobjectDeath
// The recipient should update its next reference.