#include <bits/stdc++.h>

using namespace std;

long long d(pair<long long,long long> a, pair<long long,long long> b){

    return ((a.first - b.first) * (a.first - b.first) + (a.second - b.second) * (a.second - b.second));

}


bool sort_func(pair<long long, int>& a, pair<long long, int>& b){
    return a.first>b.first;
}

bool srt2(vector<pair<long long ,int >>& a, vector<pair<long long ,int >>& b){
    return a[0].first>b[0].first;
}


int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(false);

    int n,m,k;

    cin>>n>>m>>k;

    vector<pair<long long,long long>> a(n);
    vector<pair<long long,long long>> b(m);

    for(int i=0;i<n;i++){
        cin>>a[i].first>>a[i].second;
    }
    for(int i=0;i<m;i++){
        cin>>b[i].first>>b[i].second;
    }

    vector<vector<pair<long long ,int >>> ab(n,vector<pair<long long, int>>(m));
    vector<bool> zauzet(m+1,false);

    for(int i =0;i<n;i++){
        for(int j=0;j<m;j++){
            ab[i][j] = {d(a[i],b[j]),j};
        }
        sort(ab[i].begin(),ab[i].end(),sort_func);
    }

    sort(ab.begin(),ab.end(), srt2);

    for(int i=n-1;i>0;i++){

        for(int j=0;j<m;j++){
            if(!zauzet[ab[i][j].second]){
                zauzet[ab[i][j].second] = true;
                ab[i][0].second = ab[i][j].second;
            }
        }
    }

    cout<<ab[k-1][0].first<<'\n';

    for(int i =0;i<min(n,m) - k;i++){
        cout<<i+1<<" "<<ab[i][0].second+1<<'\n';
    }


    return 0;
}