#include <iostream>
#include <vector>
#include <math.h>
#include <algorithm>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n, m, k;
    cin >> n >> m >> k;
    vector<pair<long long, long long>>v1(n);
    vector<pair<long long, long long>>v2(m);
    for (int i = 0; i < n; i++) {
        cin >> v1[i].first >> v1[i].second;
    }
    for (int i = 0; i < m; i++) {
        cin >> v2[i].first >> v2[i].second;
    }
    long long maxx = 3 * 1e9, ri=0, rj=0;
    for (int i = 0; i < n - k+1; i++) {
        for (int j = 0; j < m - k+1; j++) {
            long long gas = 0;
            for (int z = 0; z < k; z++) {
                long long pox = (v1[i+z].first - v2[j+z].first) * (v1[i+z].first - v2[j+z].first);
                long long poy = (v1[i+z].second - v2[j + z].second) * (v1[i + z].second - v2[j + z].second);
                //cout << pox << " " << poy << endl;
                gas = max(gas, pox + poy);
            } 
            //cout << "keva " << gas << endl;
           
            if (gas < maxx) {
                maxx = gas;
                ri = (long long)i; rj = (long long)j;
            }
        } 
    }
    cout << maxx << "\n";
    for (long long i = 0; i < k; i++) {
        cout << ri + i+1 << " " << rj + i+1 << "\n";
    }
}