Khachaturyan A.v.

It is known that the Jackal always lies, the Lion tells the truth, the Parrot simply repeats the last heard answer (and if asked first, will answer randomly), and the Giraffe gives an honest answer but to the previous question asked to him (and on the first question, answers randomly). The wise Hedgehog in the fog stumbled upon the Jackal, Lion, Parrot, and Giraffe and decided to find out in what order they stood. Asking each in turn, "Are you the Jackal?", he only figured out where the Giraffe was. Asking everyone in the same order, "Are you the Giraffe?", he was able to understand where the Jackal was, but full clarity did not come. Only after the first one answered "Yes" to the question "Are you the Parrot?", did the Hedgehog finally understand the order in which the animals stood. So, in what order did they stand?

("Randomly" means that one of the answers, "Yes" or "No," is chosen arbitrarily.)
For the first question "Are you a Jackal?" the Lion and the Jackal will definitely say "no." Therefore, the Giraffe can be identified, and the Parrot cannot be identified by the Hedgehog only in one case: if the Giraffe answers "Yes" and the Parrot answers "No." The same can be said about the second question "Are you a Giraffe?" - to which the Lion and the Giraffe will say "No" (the Giraffe thinks it is being asked if it is a Jackal), which means the Jackal is identified because he is the only one who said "Yes."

Since the answer of the first animal to the third question was enough for the Hedgehog to determine all of them (and before this answer, there was not enough information), the first one could not be the Giraffe or the Jackal (their answers the Hedgehog could predict in advance, and they would not have told him anything new). The first one could not be the Lion either (he would have answered "no" to the third question), so the first one was the Parrot, who repeated the answer of the fourth one to the previous question. Now it is clear that the fourth one is the Jackal. We are left with two possible arrangements:

(1): Parrot, Giraffe, Lion, Jackal and (2): Parrot, Lion, Giraffe, Jackal. Let's consider them.

If the order (1) had been the case, the Hedgehog would have already understood after the first questioning that the third one is not the Parrot, since he did not repeat the answer of the second one. Then, after the second questioning, everything would have been clearly determined, and the last question would not have been necessary. However, in the case of the order (2), the variants Parrot, Lion, Giraffe, Jackal and Lion, Parrot, Giraffe, Jackal would indeed not have been distinguishable until the last question.

## Answer

Parrot, Lion, Giraffe, Jackal.