Solution to all Spoj problems goes here