#include<bits/stdc++.h>
#define ll long long
using namespace std;
struct doublet{
    int x,y;
};
bool Uporedi(doublet a, doublet b)
{
    return a.x<b.x;
}
int main()
{
    int n,m,k;
    vector<doublet> Ni,res;
    vector<doublet> Mi;
    cin>>n>>m>>k;
    for(int i=0;i<n;i++)
    {
        int xi,yi;
        cin>>xi>>yi;
        doublet a;
        a.x=xi;
        a.y=yi;
        Ni.push_back(a);
    }
    for(int i=0;i<m;i++)
    {
        int xj,yj;
        cin>>xj>>yj;
        doublet a;
        a.x=xj;
        a.y=yj;
        Mi.push_back(a);
    }
    sort(Mi.begin(),Mi.end(),Uporedi);
    sort(Ni.begin(),Ni.end(),Uporedi);
    for(int i=0;i<k;i++)
    {
        doublet a;
        a.x=i;
        a.y=m-i;
        res.push_back(a);
    }
    int min=1000000000;
    for(int i=0;i<k;i++)
    {
        float dist=1.0*((Mi[res[i].x].x)-(Ni[res[i].y].x))*((Mi[res[i].x].x)-(Ni[res[i].y].x))+1.0*((Mi[res[i].x].y)-(Ni[res[i].y].y))*((Mi[res[i].x].y)-(Ni[res[i].y].y));
        if(dist<min) min=dist;
    }
    cout<<min;
    for(int i=0;i<k;i++)
    {
        cout<<res[i].x+1<<" "<<res[i].y+1<<endl;
    }


}