**Answer:** Here are the contents of the containers after each stage:

A = 9 litres, B = 4 litres

A B

9 0 fill A

5 4 fill B from A (leaving 5 litres in A)

5 0 empty B

1 4 fill B from A (leaving 1 litre in A)

1 0 empty B

0 1 fill B from A

9 1 fill A

6 4 fill B from A (only 3 more litres fit in B)

6 0 empty B

This leaves 6 litres in container A.