#include <bits/stdc++.h>

using namespace std;

int main(){
    #define int long long
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n,m,k;
    cin>>n>>m>>k;
    pair<int, int> t1[n];
    pair<int, int> t2[m];
    for(int i=0;i<n;i++){
        int x,y;
        cin>>x>>y;
        t1[i] = {x,y};
    }
    for(int i=0;i<m;i++){
        int x,y;
        cin>>x>>y;
        t2[i] = {x,y};
    }
    sort(t1, t1+n);
    sort(t2, t2+n);
    if(t1[n-1].first<t2[0].first){
        bool obrt = false;
        int maxdist = 0;
        for(int i=0;i<k;i++){
            int trr = (t1[n-k+i].first-t2[i].first)*(t1[n-k+i].first-t2[i].first)+(t1[n-k+i].second-t2[i].second)+(t1[n-k+i].second-t2[i].second);
            int trr2 = (t1[n-k+i].first-t2[k-1-i].first)*(t1[n-k+i].first-t2[k-1-i].first)+(t1[n-k+i].second-t2[k-1-i].second)+(t1[n-k+i].second-t2[k-1-i].second);
            if(trr2<trr) obrt = true;
            maxdist = max(maxdist, min(trr,trr2));
        }
        cout<<maxdist<<endl;
        for(int i=0;i<k;i++){
            if(!obrt){
                cout<<n-k-i+1<<" "<<i+1<<endl;
            }
            else{
                cout<<n-k-i+1<<" "<<k-i<<endl;
            }
        }
    }
    else{
        bool obrt = false;
        int maxdist = 0;
        for(int i=0;i<k;i++){
            int trr = (t1[i].first-t2[n-k+i].first)*(t1[i].first-t2[n-k+i].first)+(t1[i].second-t2[n-k+i].second)+(t1[i].second-t2[n-k+i].second);
            int trr2 = (t1[k-1-i].first-t2[n-k+i].first)*(t1[k-1-i].first-t2[n-k+i].first)+(t1[k-1-i].second-t2[n-k+i].second)+(t1[k-1-i].second-t2[n-k+i].second);
            if(trr2<trr) obrt = true;
            maxdist = max(maxdist, min(trr,trr2));
        }
        cout<<maxdist<<endl;
        for(int i=0;i<k;i++){
            if(!obrt){
                cout<<i+1<<" "<<n-k-i+1<<endl;
            }
            else{
                cout<<k-i<<" "<<n-k-i+1<<endl;
            }
        }
    }
}