Madhav Jha's submission of pattern28 | CodeChef