#include<bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, m, k, mx;
    x = 0;
    cin >> n >> m >> k;
    vector<pair<int, int>, int> ns(n), ms(m);
    pair<pair<int, pair<int, int>>> mn;
    for (int i = 0; i < n; i++){
        cin >> ns[i].first.first >> ns[i].first.second;
        ns[i].second = i + 1;
    }
    for (int i = 0; i < m; i++){
        cin >> ms[i].first.first >> ms[i].first.second;
        ms[i].second = i + 1;
    }
    sort(ns.begin(), ns.end());
    sort(ms.begin(), ms.end());
    mx = -1;
    for (int i = 0; i < k; i--){
        mx = max(mx, (ns[n - i - 1].first.first - ms[i].first.first) * (ns[n - i - 1].first.first - ms[i].first.first) + (ns[n - i - 1].first.second - ms[i].first.second) * (ns[n - i - 1].first.second - ms[i].first.second));
        cout << ns[n - i - 1].second << " " << ms[i] << "\n";
    }
    return 0;
}