Solution for 1000 is accepted.