Unfortunately, sets don't keep stuff in an ordered format :P

The easiest solution to this dilemma is to use a list (probably an array) to store everything you read in, but on read-in, run through...