#include <bits/stdc++.h>

using namespace std;
using ll = long long;
const int N = 2e5 + 5, LOG = 20;
ll x[N], y[N], X[N], Y[N];
ll dist(int p, int q) {
    return (x[p]-X[q])*(x[p]-X[q])+(y[p]-Y[q])*(y[p]-Y[q]);
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n, m, k;
    cin >> n >> m >> k;
    for (int i = 1; i <= n; ++i)    cin >> x[i] >> y[i];
    for (int i = 1; i <= m; ++i)    cin >> X[i] >> Y[i];
    ll u = 0;
    for (int j = 0; j < k; ++j) u = max(u, dist(n-k+1+j, j+1));
    ll v = 0;
    for (int j = 0; j < k; ++j) v = max(v, dist(j+1, m-k+1+j));
    if (u < v) {
        cout << u << '\n';
        for (int j = 0; j < k; ++j) cout << n-k+1+j << ' ' << j+1 << '\n';
    }
    else {
        cout << u << '\n';
        for (int j = 0; j < k; ++j) cout << j+1 << ' ' << m-k+1+j << '\n';
    }
    return 0;
}