Nested loops. How to iterate through only the left center and right elements within a list