First, fill the 5-liter container and pour it into the 7-liter container. Then, fill the 5-liter container again and pour it into the 7-liter container. Now, there are 3 liters left in the 5-liter container. Empty the 7-liter container and pour the 3 liters into it. Fill the 5-liter container again and pour it into the 7-liter container. Now, the 7-liter container is full, and there is 1 liter left in the 5-liter container. Empty the 7-liter container and pour the remaining 1 liter from the 5-liter container into it. Now, there is already 1 liter in the 7-liter container, so fill the 5-liter container and pour it into the 7-liter container. Now, there are 6 liters in the 7-liter container, and the problem is solved.