SPOJ easy: A game with numbers