#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int comp(pair<int,int> a,pair<int,int> b){
if(a.first==b.first)return a.second<b.second;
return a.first<b.first;
}
unsigned long long dist(pair<int,int> n1,pair<int,int> n2){
unsigned long long x=n1.first-n2.first;
unsigned long long y=n1.second-n2.second;
return x*x+y*y;
}
unsigned long long maxdist(pair<int,int> n1,pair<int,int> n2,pair<int,int> m1,pair<int,int> m2){
return max(max(dist(n1,m2),dist(n2,m1)),max(dist(n1,m1),dist(n2,m2)));
}
int main()
{
    int n,m,k;
    cin>>n>>m>>k;
    vector<pair<int,int>> N(n),M(m);
    for(int i=0;i<n;i++)cin>>N[i].first>>N[i].second;
    for(int i=0;i<m;i++)cin>>M[i].first>>M[i].second;
   // sort(N.begin(),N.end(),comp);
   // sort(M.begin(),M.end(),comp);

        unsigned long long ans=ULLONG_MAX;
        int jmin=0;
        int i=0;
        int iopt=0,jopt=0;
         unsigned long long curans=0;
        for(i=0;i+k-1<n;i++){
        for(int j=0;j+k-1<m;j++){
           curans=0;
            for(int ik=0;ik<k;ik++){
                curans=max(curans,dist(N[i+ik],M[j+ik]));
            }
            //cout<<"otvet flja "<<i<<' '<<j<<':'<<curans;
        if(curans<ans){//cout<<"Nasli s curans="<<curans<<endl;
                iopt=i;jopt=j;ans=curans;}
        }
        }
    cout<<ans<<endl;
    for(int ik=0;ik<k;ik++)cout<<iopt+ik+1<<' '<<jopt+ik+1<<endl;
    //cout << "Hello world!" << endl;
    return 0;
}