#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cerr.tie(nullptr);
    int n, m, k;
    cin >> n >> m >> k;
    vector<long long> x1(n);
    vector<long long> y1(n);
    vector<long long> x2(m);
    vector<long long> y2(m);
    for (int i = 0; i < n; i++)
        cin >> x1[i] >> y1[i];
    for (int i = 0; i < m; i++)
        cin >> x2[i] >> y2[i];
    long long naj_zbir = -1;
    int naj_i = -1;
    int naj_j = -1;
    for (int i = 0; i <= n - k; i++) {
        for (int j = 0; j <= m - k; j++) {
            long long zbir = (x1[i] - x2[j]) * (x1[i] - x2[j]) + (y1[i] - y2[j]) * (y1[i] - y2[j]);
            for (int k1 = 1; k1 < k; k1++)
                zbir = max(zbir, (x1[i+k] - x2[j+k]) * (x1[i+k] - x2[j+k]) + (y1[i+k] - y2[j+k]) * (y1[i+k] - y2[j+k]));
            if (zbir < naj_zbir || naj_zbir == -1) {
                naj_zbir = zbir;
                naj_i = i;
                naj_j = j;
            }
        }
    }
    cout << naj_zbir << '\n';
    for (int k1 = 0; k1 < k; k1++)
        cout << k1 + naj_i + 1 << ' ' << k1+ naj_j + 1 << '\n';
    return 0;
}