http://www.spoj.com/problems/OLOLO/