#include <bits/stdc++.h>

using namespace std;

int main(){
    #define int long long
    int n,m,k;
    cin>>n>>m>>k;
    int x1[n];
    int y1[n];
    int x2[m];
    int y2[m];
    for(int i=0;i<n;i++){
        cin>>x1[i]>>y1[i];
    }
    for(int i=0;i<m;i++){
        cin>>x2[i]>>y2[i];
    }
   int d[n][m];
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            d[i][j] = (x1[i]-x2[j])*(x1[i]-x2[j])+(y1[i]-y2[j])*(y1[i]-y2[j]);
        }
    }
    int minn = 2e18;
    int ii, jj;
    for(int i=0;i<=n-k;i++){
        for(int j=0;j<=m-k;j++){
            int trmin = 0;
            for(int e=0;e<k;e++){
                int tr = d[i+e][j+e];
                trmin = max(trmin, tr);
            }
            if(trmin<=minn){
                minn = trmin;
                ii = i;
                jj = j;
            }
        }
    }
    ii++;
    jj++;
    cout<<minn<<endl;
    for(int i=0;i<k;i++){
        cout<<ii+i<<" "<<jj+i<<endl;
    }
}