the trials consisted of various physical disciples ( archery , riding , fencing , hand-to-hand combat ) and a written test that covered everything from basic reading and writing skills to mathematics , history , literature , philosophy , logic , and geography .