SPOJ Favorite Dice