<human>:  When did the first hats appear?
<bot>: The first hats appeared in the Middle Ages. They were made of felt and were worn by both men and women. They were used to keep the wearer's head warm in cold weather.