On an island, two types of people live: good and bad. The good ones always tell the truth, the bad ones always lie. Naturally, everyone is either a boy or a girl on the island. Once, two young people said the following:

$A$ : If I am good, $B$ is bad.

$B$ : If I am a boy, $A$ is a girl.

Determine for both of them whether they are good and what gender they are!
Solution. Let's assume that $A$ is bad. Then he must lie, but if he is bad, his statement is true, regardless of whether $B$ is good or bad. This case is therefore not possible.

$A$ must be good, so he tells the truth. This means that $B$ is bad, and thus lies. If $B$ is a boy, then $A$ cannot be a girl; if $B$ is a girl, then her statement would be true, but we know that she lies. Therefore, $A$ is a good boy, and $B$ is a bad boy.