Madhav Jha's submission of pattern22 | CodeChef