Which classes did the samurai rule over?