<P> The aim of the system was to produce strong and capable warriors to serve in the Spartan army . It encouraged conformity and the importance of the Spartan state over one's personal interest and generated the future elites of Sparta . The men would become the "walls of Sparta" because Sparta was the only Greek city with no defensive walls after they had been demolished at the order of Lycurgus . Discipline was strict and the males were encouraged to fight amongst themselves to determine the strongest member of the group . </P> <P> The agoge was prestigious throughout the Greek world, and many aristocratic families from other cities vied to send their sons to Sparta to participate in the agoge for varying periods of time . The Spartans were very selective in which young men they would permit to enroll . Such honors were usually awarded to the próxenoi of Sparta in other cities and to a few other families of supreme ancestry and importance . </P> <P> When a boy was born, he was washed with wine in the belief that this would make him strong . Every infant was then examined by members of the Gerousia (a council of leading elder Spartans) from the child's tribe to see whether he was fit and healthy enough to be allowed to live . In the event that the baby did not pass the test, he was placed at the base of Mt Taygetus for several days for a test that ended with death by exposure or survival . At the age of seven, the male child was enrolled in the agoge under the authority of the paidonómos (παιδονόμος), or "boy - herder", a magistrate charged with supervising education . This began the first of the three stages of the agoge: the paídes (about ages 7--17), the paidískoi (ages 17--19), and the hēbōntes (ages 20--29). Some classical sources indicate that there were further subdivisions by year within these classes . </P> <P> The boys lived in groups (agélai, "herds") under an older man . They were encouraged to give their loyalty to their communal mess hall known as the Syssitia, rather than to their families . Beginning at the age of 12 boys would be given only one item of clothing per year--a red cloak known as a Phoinikis (a toponym reflecting the Phoenician origin of the Tyrian purple dye used or imitated in the cloak). They also created beds out of reeds pulled by hand, with no knife, from the Eurotas River . Boys were intentionally underfed to encourage them to steal food for themselves; however, they were severely punished for stealing . This was also meant to produce well - built soldiers rather than fat ones . This let the boys become accustomed to hunger, and this prevented hunger from being a problem during battle . Only the heirs apparent of the two Spartan royal households (the Agiads and Eurypontids) were exempt from the process . </P>

How many years did a spartan boy spend in the agoge
find me the text answering this question