Sorting Hat

The Sorting Hat  is a sentient Hogwarts  artefact which magically determines to which of the four school Houses each new student is to be assigned