Start loop A, get a line. Start loop B, get a line. B doesn't match A so print a blank line. Go to the next iteration of loop A. Start loop B, get a line. Now A and B match, so print out B. Go to the next iteration of loop A. Start loop B, get a line.