don't understand the solution to 2016 Bronze P1 - Milk Pails

I don’t understand the solution to 2016 Bronze P1 - Milk Pails. This is the solution link
What does with open("pails.in") as fin: mean?