#T358. 周末舞会
周末舞会
Description
Suppose at a weekend dance party, when men and women enter the dance hall, they each form a separate line. At the start of the dance, partners are paired by sequentially taking one person from the front of the men's line and one from the front of the women's line.
It is stipulated that each dance song can have one pair of dancers. If the initial number of people in the two lines is different, the unpaired individuals in the longer line will wait for the next round of dance songs.
Now, write a program to simulate the dance partner pairing problem described above.
Input Format
The first line contains the number of people in each of the two lines;
The second line contains the number of dance songs.
Output Format
The pairing results.
4 6
7
1 1
2 2
3 3
4 4
1 5
2 6
3 1