#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n,m,k,pamtimnis,pamtimmars;
    long double koef,l=0,d,sr;
    cin>>n>>m>>k;

   vector<long double>nis(n),mars(m),nisy(n),marsy(m);
    for(int i=0;i<n;i++){
        cin>>nis[i]>>nisy[i];
    }
    for(int i=0;i<m;i++){
        cin>>mars[i]>>marsy[i];
    }
    koef=(nisy[1]-nisy[0])/(nis[1]-nis[0]);
    for(int i=0;i<n;i++){
        long double q;
        q=nis[i]/sqrt(1+koef*koef)+nisy[i]*koef/sqrt(1+koef*koef);
        nisy[i]=nisy[i]/sqrt(koef*koef+1)-nis[i]*koef/sqrt(koef*koef+1);
        nis[i]=q;
    }
    for(int i=0;i<m;i++){
        long double q;
        q=mars[i]/sqrt(1+koef*koef)+marsy[i]*koef/sqrt(1+koef*koef);
        marsy[i]=marsy[i]/sqrt(koef*koef+1)-mars[i]*koef/sqrt(koef*koef+1);
        mars[i]=q;
    }
    for(int i=0;i<n;i++){
        //cout<<nis[i]<<" "<<nisy[i]<<endl;
    }
    for(int i=0;i<m;i++){
        //cout<<mars[i]<<" "<<marsy[i]<<endl;
    }
    d=max(abs(nis[0]-mars[m-1]),abs(nis[n-1]-mars[0]));
    for(int j=0;j<60;j++){
        sr=(l+d)/2;
        //cout<<j<<" "<<l<<" "<<d<<" "<<sr<<endl;
        bool moze=false;
        int pok=0,br=0,pamtim=0;
        vector<int>lg(n),dg(n);
        for(int i=0;i<n;i++){
            while(pok<m && nis[i]-mars[pok]>sr){

                pok++;
            }
            //cout<<nis[i]<<" "<<mars[pok]<<endl;
            lg[i]=pok;
        }
        pok=m-1;
        for(int i=n-1;i>=0;i--){
            while(pok>=0 && -nis[i]+mars[pok]>sr){
                pok--;
            }
            dg[i]=pok;
        }
        for(int i=0;i<n;i++){
          //cout<<lg[i]<<" "<<dg[i]<<endl;
        }
        multiset<int>levi,desni;
        for(int i=0;i<n;i++){
            //cout<<endl<<endl<<i<<endl;
            if(lg[i]>dg[i]){
                levi.clear();
                desni.clear();
            }else{
                lg[i]=-lg[i]-br+i;
                dg[i]=dg[i]+br-i;
                levi.insert(lg[i]);
                desni.insert(dg[i]);
                //cout<<lg[i]<<" "<<dg[i]<<endl;
                auto it=levi.begin(),it1=desni.begin();
                //cout<<*it<<" "<<*it1<<endl;
                while(!levi.empty() && -*it>*it1){
                    //cout<<*it<<" "<<*it1<<endl;
                    auto gde=levi.find(lg[br]);
                    levi.erase(gde);
                    //cout<<67<<endl;
                    gde=desni.find(dg[br]);
                    desni.erase(gde);
                    //cout<<6767<<endl;
                    it=levi.begin();
                    it1=desni.begin();
                    br++;
                    //cout<<br<<endl;
                }
                if(levi.size()>=k){
                        moze=true;
                        pamtimnis=i;
                        pamtimmars=*it1-br+i;
                        //cout<<i+1-br<<" "<<br<<endl;
                }
            }

        }
        if(moze){
            d=sr;
        }else{
            l=sr;
        }
        //cout<<endl<<endl;

    }
    cout<<setprecision(0)<<fixed<<l*l+(nisy[0]-marsy[0])*(nisy[0]-marsy[0])<<endl;
    for(int i=0;i<k;i++){
        cout<<pamtimnis+i+1<<" "<<pamtimmars+i+1<<endl;
    }
    return 0;
}