#include <iostream>
#include <bits/stdc++.h>

using namespace std;

struct poz{
    long long x, y;
};

long long dist(poz a, poz b){
    return abs(a.x-b.x)*abs(a.x-b.x) + abs(a.y-b.y)*abs(a.y-b.y);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n, m, k;
    cin >> n >> m >> k;

    vector<poz> a(n), b(m);

    for(int i = 0; i < n; i++){
        cin >> a[i].x >> a[i].y;
    }
    for(int i = 0; i < m; i++){
        cin >> b[i].x >> b[i].y;
    }

    int in = 0, i = 0;
    long long r = 9*1e18, rez = 9*1e18, rezi, rezin;

    set<long long> s;

    for(i = 0; i < n-k+1 && in < m-k+1; ){
        long long ma = 0;
        for(int j = 0; j < k; j++){
            if(ma < dist(a[i+j], b[in+j])) ma = dist(a[i+j], b[in+j]);
        }
        //prvo punjenje seta
        /*if(i == 0 && in == 0){
            for(int j = 0; j < k; j++){
                s.insert(dist(a[i+j], b[in+j]));
            }
        }*/

        if(ma < r){
            r = ma;
            in++;
            if(in == m-k+1){
                if(r < rez){
                    rez = r;
                    rezi = i;
                    rezin = in-1;
                }
                in = max(in-2, 0);
                i++;
                r = 9*1e18;
            }
        }
        else{ //ma > r
            if(r < rez){
                rez = r;
                rezi = i;
                rezin = in-1;
            }
            i++;
            in = max(in-2, 0);
            r = 9*1e18;
        }
    }

    if(r < rez){
        rez = r;
        rezi = i;
        rezin = in-1;
    }


    cout << rez << endl;
    for(int j = 0; j < k; j++){
        cout << rezi+1+j << " " << rezin+1+j << endl;
    }

    return 0;
}