Not able to understand this part of problem!

There are N buckets (5 ≤ N ≤ 105), each with a certain capacity Ci (1 ≤ Ci ≤ 100). One
day, after a rainstorm, each bucket is filled with Ai units of water (1 ≤ Ai ≤ Ci). Charlie
then performs the following process: he pours bucket 1 into bucket 2, then bucket 2 into
bucket 3, and so on, up until pouring bucket N − 1 into bucket N. When Charlie pours
bucket B into bucket B + 1, he pours as much as possible until bucket B is empty or bucket
B + 1 is full. Find out how much water is in each bucket once Charlie is done pouring.

I am not able to understand the highlighted lines in the question.?

I will demonstrate with an example:
Bucket 1 has a capacity 100, and Bucket 2 has a capacity 50
If Bucket 1 is full, then a pour will leave Bucket 1 with 50 and Bucket 2 with 50; alternatively, if Bucket 1 had 40, then a pour would make Bucket 1 have 0 and Bucket 2 have 40/50. You can do this for 1 → 2 → 3 → 1