The Prisoner Hat Riddle

Can You Solve This Prisoner Hat Riddle?

You and nine other people have suddenly been captured by super intelligent alien overlords. The aliens think humans look quite tasty, but they are not allowed to eat highly logical and cooperative beings. Unfortunately, they're not sure whether you qualify, so they decide to test if you can solve this prisoner hat riddle.