We can ignore flipping the grids around if we have a way to determine the "position" of each grid.
__ G4 __ G1 G2 G3 __ G5 __
Consider this grid layout. If you only consider G1 and G2 (which is our two grid layout), G1 is "left" of G2. Which means if a chicken is standing on G1, then the "front" most column is on the right, while the "backmost" column is on the left.
On the other hand, if the chicken was standing on G3, then the "front" most column is on the left, and the back most columns is on the right
We don't consider the diagonal cases for now, but I think this approach should be suitable for even 4-sided attacks shown above.