#include <iostream>
#include <vector>
#include <cmath>
using namespace std;

struct napad{
    int id1;
    int id2;
    int d;
    bool p;
};

struct tacka{
    int x;
    int y;
    int id;
};

int main()
{
    int n,m,k,i,x1,y1,a,j,indeks,maksimum,minimum,br;
    br=-1;
    maksimum=-9999999999;
    vector<tacka>t1;
    vector<tacka>t2;
    vector<napad>napadi;
    vector<napad>v;
    cin>>n;
    cin>>m;
    cin>>k;
    for(i=0;i<n;i++){
        cin>>x1;
        cin>>y1;
        tacka a;
        a.x=x1;
        a.y=y1;
        a.id=i+1;
        t1.push_back(a);
    }
    for(i=0;i<m;i++){
        cin>>x1;
        cin>>y1;
        tacka a;
        a.x=x1;
        a.y=y1;
        a.id=i+1;
        t2.push_back(a);
    }
    for(i=0;i<n;i++){
        for(j=0;j<m;j++){
            napad b;
            b.id1=i+1;
            b.id2=j+1;
            b.d=pow(t1[i].x-t2[j].x,2)+pow(t1[i].y-t2[j].y,2);
            b.p=false;
            napadi.push_back(b);
        }
    }

    for(i=0;i<k;i++){
            minimum=999999999;
        for(j=0;j<napadi.size();j++){
            if(napadi[j].d<minimum and napadi[j].p==false){
                minimum=napadi[j].d;
                indeks=j;
            }
        }
        v.push_back(napadi[indeks]);
        br++;
        for(j=0;j<napadi.size();j++){
            if(napadi[j].id1==v[br].id1){
                napadi[j].p=true;
            }
        }
        for(i=0;i<napadi.size();j++){
            if(napadi[j].id2==v[br].id2){
                napadi[j].p=true;
            }
        }
    }

    for(i=0;i<v.size();i++){
        if(v[i].d>maksimum){
            maksimum=v[i].d;
        }
    }
    cout<<maksimum<<"\n";
    for(i=0;i<v.size();i++){
        cout<<v[i].id1<<" "<<v[i].id2<<"\n";
    }
}