#include <bits/stdc++.h>
#define int long long
using namespace std;
const int MAXN = 2e5+5;


int n, m, k;
array<int,3> a[MAXN], b[MAXN];

int dist(int i, int j){
    int x = (a[i][0]-b[j][0]), y = (a[i][1]-b[j][1]);
    return x*x+y*y;
}

array<int,2> gr[MAXN];

int ans, idx1, idx2;

bool check(int dst){
    for(int i = 1; i <= n; ++i){
        gr[i][0] = m+1;
        if(dist(i,1) <= dst){
            gr[i][0] = 1;
            continue;
        }
        int l = 2, r = m;
        while(l<=r){
            int mid = (l+r)/2;
            if(dist(i,mid) <= dst){
                r = mid-1;
                gr[i][0] = mid;
            }
            else{
                if(dist(i,mid-1) <= dist(i,mid)) r = mid-1;
                else l = mid+1;
            }
        }
    }
    for(int i = 1; i <= n; ++i){
        gr[i][1] = 0;
        if(dist(i,m) <= dst){
            gr[i][1] = m;
            continue;
        }
        int l = 1, r = m-1;
        while(l<=r){
            int mid = (l+r)/2;
            if(dist(i,mid) <= dst){
                l = mid+1;
                gr[i][1] = mid;
            }
            else{
                if(dist(i,mid) >= dist(i,mid+1)) l = mid+1;
                else r = mid-1;
            }
        }
    }
    /*cout << "dst " << dst << '\n';
    for(int i = 1; i <= n; ++i){
        cout << gr[i][0] << ' ' << gr[i][1] << '\n';
    }*/
    /*multiset<int> s1, s2;
    for(int i = 1; i < k; ++i){
        s1.insert(gr[i][0]-i);
        s2.insert(gr[i][1]-i);
    }
    for(int i = 1; i+k-1 <= min(n,m); ++i){
        s1.insert(gr[i+k-1][0]-(i+k-1));
        s2.insert(gr[i+k-1][1]-(i+k-1));
        int v1 = *prev(s1.end()), v2 = *s2.begin();
        if(v1 <= v2){
            idx1 = i, idx2 = v1+i;
            return 1;
        }
        s1.erase(s1.find(gr[i][0]-i));
        s2.erase(s2.find(gr[i][1]-i));
    }*/
    return 0;
}


void solve(){
    cin >> n >> m >> k;
    for(int i = 1; i <= n; ++i){
        cin >> a[i][0] >> a[i][1];
        a[i][2] = i;
    }
    for(int i = 1; i <= m; ++i){
        cin >> b[i][0] >> b[i][1];
        b[i][2] = i;
    }
    sort(a+1,a+n+1);
    sort(b+1,b+m+1);
    int l = 0, r = 2e18;
    ans = 2e18;
    while(l <= r){
        int mid = (l+r)/2;
        if(check(mid)){
            ans = mid;
            r = mid-1;
        }
        else l = mid+1;
    }
    cout << ans << '\n';
    for(int i = 0; i < k; ++i){
        cout << a[idx1+i][2] << ' ' << b[idx2+i][2] << '\n';
    }
}

int32_t main(){
    ios_base::sync_with_stdio(0);cin.tie(0);
    int qqq=1;
    //cin>>qqq;
    while(qqq--) solve();
}