Assume Max1 and Max2 are the variables used to store the largest and the second largest integers.
first you compare A and B and put the bigger one into Max1 and the other one into Max2.
For the next integer C, compare it with Max1 and Max2. If C is no less than Max1, then C is the largest so far and Max1 is updated to C. Max2 stays unchanged. If C is less than Max1 but no less than Max2, then C is the second largest so far and Max2 is updated to C and Max1 stays unchanged. Otherwise if C is less than Max2, Max1 and Max2 keep unchanged.
Following the same logic with D to G, you will get the global largest and second largest Max1 and Max2.