#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll dist(pair<ll,ll> t1, pair<ll,ll> t2){
    return (t1.first-t2.first)*(t1.first-t2.first) + (t1.second-t2.second)*(t1.second-t2.second);
}
void ccout(pair<ll,ll> t){
    cout<<t.first<<" "<<t.second<<endl;
}
int main(){
    int n,m,k;
    cin>>n>>m>>k;
    vector<pair<ll,ll> > nis(n+1);
    vector<pair<ll,ll> > mars(m+1);
    for(int i=1;i<=n;i++){
        cin>>nis[i].first>>nis[i].second;
    }
    for(int i=1;i<=m;i++){
        cin>>mars[i].first>>mars[i].second;
    }
    int a,b;
    ll mind = 1000000000000000002;
    if(n<=10 && m<=10){
        ll maksd,d;
        for(int i=1;i<=n-k+1;i++){
            for(int j=1;j<=m-k+1;j++){
                maksd = 0;
                for(int l=0;l<=k-1;l++){
                    d = dist(nis[i+l],mars[j+l]);
                    if(d > maksd){
                        maksd = d;
                    }
                }
                if(maksd < mind){
                    mind = maksd;
                    a = i;
                    b = j;
                }
            }
        }

    } else {
        if(k==1){

        } else {

        }
    }
    cout<<mind<<endl;
    for(int i=0;i<k;i++){
        cout<<a+i<<" "<<b+i<<endl;
    }
}