Submission for code ninja competeition