http://www.codechef.com/COOK33/problems/AMSTRING