From these 12 rows, I just want to extract the consecutive rows pairwise that will contain C:G in the first row and G:C in the second row. 4 such combinations can be seen in the lines that I have printed above (1 and 2, 3 and 4, 9 and 10 and 11 and 12). Thus, my output should look like: