http://www.codechef.com/NOV13/problems/JOHNY