文件目录

#include <bits/stdc++.h>
using namespace std;
int main()
{
    queue<int> m, wm;
    int a, b;
    cin >> a >> b;
    for (int i = 1; i <= a; i++)
        m.push(i);
    for (int i = 1; i <= b; i++)
        wm.push(i);
    int n;
    cin >> n;
    while (n--)
    {
        cout << m.front() << " " << wm.front() << endl;
        m.push(m.front());
        m.pop();
        wm.push(wm.front());
        wm.pop();
    }
    return 0;
}