Me:
Count the A's, SPACEs and -'s in each line, and in each section of each line.
Look for numerical patterns.
When you see the patterns, write down some calculations that you can turn into code.
Use lots of paper, and analyze analyze analyze. Plan plan plan.You'll need a few loops for each line.
OK, I guess you don't have to do any of this. Just convert Lucaci's pseudo code into real code. He did the hard work for you.
Be sure to thank him.