early times, when, according to the 10th-century Shōmonki, the boy spy Hasetsukabe no Koharumaru was killed for spying against the insurgent Taira no Masakado. Later, the 14th-century war chronicle Taiheiki contained many references to shinobi and credited the destruction of a castle by fire to an unnamed but "highly skilled shinobi". Early history It was not until the 15th century that spies were specially trained for their purpose. It was around this time that the word shinobi appeared to define and clearly identify ninja as a secretive group of agents. Evidence for this can be seen in historical documents, which began to refer to stealthy soldiers as shinobi during the Sengoku period. Later manuals regarding espionage are often grounded in Chinese military strategy, quoting works such as The Art of War by Sun Tzu. The ninja emerged as mercenaries in the 15th century, where they were recruited as spies, raiders, arsonists and even terrorists. Amongst the samurai, a sense of ritual and decorum was observed, where one was expected to fight or duel openly. Combined with the unrest of the Sengoku period, these factors created a demand for men willing to commit deeds considered disreputable for conventional warriors. By the Sengoku period, the shinobi had several roles, including spy (kanchō), scout (teisatsu), surprise attacker (kishu), and agitator (konran). The ninja families were organized into larger guilds, each with their own territories. A system of rank existed. A jōnin ("upper person") was the highest rank, representing the group and hiring out mercenaries. This is followed by the chūnin ("middle person"), assistants to the jōnin. At the bottom was the genin ("lower person"), field agents drawn from the lower class and assigned to carry out actual missions. Iga and Kōga clans The Iga and Kōga clans have come to describe jizamurai families living in the province of Iga (modern Mie Prefecture) and the adjacent region of Kōka (later written as Kōga), named after a village in what is now Shiga Prefecture. From these regions, villages devoted to the training of ninja first appeared. The remoteness and inaccessibility of the surrounding mountains in Iga may have had a role in the ninja's secretive development. Historical documents regarding the ninja's origins in these mountainous regions are considered generally correct. The chronicle Go Kagami Furoku writes, of the two clans' origins: Likewise, a supplement to the Nochi Kagami, a record of the Ashikaga shogunate, confirms