Let's call the amount of water in the first container X liters, and the amount of water in the second container Y liters.
According to the given information, the total amount of water in both containers at the beginning is 78 liters. So, we have the equation:
X + Y = 78
When 12 liters of water were taken from the first container, the amount of water in the first container becomes X - 12, and the amount of water in the second container remains Y. In this case, the water in both containers becomes equal. Therefore, we have the equation:
X - 12 = Y
Now, we can substitute the second equation into the first equation:
X + (X - 12) = 78
2X - 12 = 78
2X = 90
X = 45
Substitute X back into the second equation to find Y:
45 - 12 = Y
Y = 33
Therefore, at the beginning, there were 45 liters of water in the first container and 33 liters of water in the second container.