USACO 2019 US Open Contest, Bronze Problem 1 Bucket Brigade
A fire has broken out on the farm, and the cows are rushing to try and put it out! The farm is described by a 10×1010×10 grid of characters like this: .......... .......... .......... ..B....... .....