#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define pii pair <ll, ll>
#define MaxN 200010

using namespace std;

ll N, M, K;
ll dist = 2e18;
vector <ll> ax(MaxN), bx(MaxN), ay(MaxN), by(MaxN);
multiset < vector <ll> > sa, sb;
vector <pii> now, res;

void check()
{
    now.clear();
    ll maks = -1, dist_now = 0;
    auto it1 = sa.begin(), it2 = sb.begin();
    for(int k = 0; k < K; k++)
    {
        if(it1 == sa.end() || it2 == sb.end()) break;
        ll idx1 = (*it1)[2];
        ll x1 = (*it1)[0];
        ll y1 = (*it1)[1];
        ll idx2 = (*it2)[2];
        ll x2 = (*it2)[0];
        ll y2 = (*it2)[1];
        dist_now = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
        maks = max(maks, dist_now);
        now.push_back({idx1 + 1, idx2 + 1});
        it1++;
        it2++;
    }
    if(maks < dist && maks != -1) {dist = maks; res = now;}
}

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
    cin >> N >> M >> K;
    for(int i = 0; i < N; i++) cin >> ax[i] >> ay[i];
    for(int i = 0; i < M; i++) cin >> bx[i] >> by[i];

    for(int i = 0; i < K; i++) sa.insert({ax[i], ay[i], i});
    for(int i = 0; i < K; i++) sb.insert({bx[i], by[i], i});
    check();
    for(int i = K; i < M; i++)
    {
        sb.erase(sb.find({bx[i - K], by[i - K], i - K}));
        sb.insert({bx[i], by[i], i});
        check();
    }
    for(int i = K; i < N; i++)
    {
        sa.erase(sa.find({ax[i - K], ay[i - K], i - K}));
        sa.insert({ax[i], ay[i], i});
        sb.clear();
        for(int j = 0; j < K; j++) sb.insert({bx[j], by[j], j});
        check();
        for(int j = K; j < M; j++)
        {
            sb.erase(sb.find({bx[j - K], by[j - K], j - K}));
            sb.insert({bx[j], by[j], j});
            check();
        }
    }
    cout << dist << endl;
    for(auto p : res) cout << p.first << " " << p.second << endl;
    return 0;
}