#include <bits/stdc++.h>

using namespace std;

int udaljenost(pair<int, int> A, pair<int, int> B){
    return (A.first-B.first)*(A.first-B.first) +
           (A.second-B.second)*(A.second-B.second);
}

int nadji(pair<int, int> tacka, vector<pair<pair<int, int>, int>> &nis){
    int levo = 0;
    int desno = nis.size()-1;
    int mid;
    while(levo<desno){
        mid = (levo+desno)/2;
        if(udaljenost(nis[mid].first, tacka)
           <= udaljenost(nis[levo].first, tacka)){
            levo = mid+1;
        }else{
            desno = mid;
        }
    }
    return mid;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n, m, k;
    cin >> n >> m >> k;
    vector<pair<int, int>> nis;
    vector<pair<int, int>> mars;
    for(int i = 0; i < n; i++){
        int a, b;
        cin >> a >> b;
        nis.push_back(make_pair(a,b));
    }
    sort(nis.begin(), nis.end());
    for(int i = 0; i < m; i++){
        int a, b;
        cin >> a >> b;
        mars.push_back(make_pair(a,b));
    }
    sort(mars.begin(), mars.end());
    int dist = INT_MIN;
    int i = 0;
    int cuvk = k;
    while(k--){
        dist = max(dist, udaljenost(nis[n-i-1], mars[i]));
        i++;
    }
    cout << dist << "\n";
    for(int j = 1; j <= cuvk; j++){
        cout << j << " " << n-j-1 << "\n";
    }
    return 0;
}