8
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
Grady distributed $x$ pieces of candy evenly among nine Halloween bags such that every bag received the greatest possible number of whole pieces of candy, but some candy was left over. What is the greatest possible number of pieces that could have been left over?
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
8
Grady distributed $x$ pieces of candy evenly among nine Halloween bags such that every bag received the greatest possible number of whole pieces of candy, but some candy was left over. What is the greatest possible number of pieces that could have been left over?
train