#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define pii pair <ll, ll>
#define MAXN 200010
#define MAXL 20
#define INF 1e18

using namespace std;

ll N, M, K;
vector <ll> AX(MAXN), BX(MAXN), AY(MAXN), BY(MAXN);
vector < vector <ll> > RMQ_MIN(MAXL, vector <ll> (MAXN));
vector < vector <ll> > RMQ_MAX(MAXL, vector <ll> (MAXN));
vector <ll> LOG(MAXN);
multiset <pii> intervals;
long double k;
long double n;
ll best_idx;

ll MIN_Query(ll L, ll R)
{
    ll D = LOG[R - L + 1];
    return min(RMQ_MIN[D][L], RMQ_MIN[D][R - (1 << D) + 1]);
}

ll MAX_Query(ll L, ll R)
{
    ll D = LOG[R - L + 1];
    return max(RMQ_MAX[D][L], RMQ_MAX[D][R - (1 << D) + 1]);
}

long double dist(ll x, ll y, ll X, long double Y)
{
    return (long double) (x - X) * (long double) (x - X) + (long double) (y - Y) * (long double) (y - Y);
}

ll left(ll x, ll y, ll D)
{
    ll L = -2e18, R = x + 1;
    while(R - L >= 2)
    {
        ll mid = (L + R) / 2;
        if(dist(x, y, mid, k * (long double) mid + n) <= D) R = mid;
        else L = mid;
    }
    if(R == x + 1) return x;
    return R;
}

ll right(ll x, ll y, ll D)
{
    ll L = x - 1, R = 2e18;
    while(R - L >= 2)
    {
        ll mid = (L + R) / 2;
        if(dist(x, y, mid, k * (long double) mid + n) <= D) L = mid;
        else R = mid;
    }
    if(L == x - 1) return x;
    return L;
}

bool check(ll D)
{
    vector <ll> L(N + 1), R(N + 1);
    multiset <ll> min_x;
    multiset <ll, greater <ll> > max_x;
    for(int i = 1; i <= N; i++)
    {
        L[i] = left(AX[i], BX[i], D);
        R[i] = right(AX[i], BX[i], D);
    }
    for(int i = 1; i <= K; i++) {min_x.insert(L[i]); max_x.insert(R[i]);}
    ll l = *min_x.begin();
    ll r = *max_x.begin();
    auto it = intervals.lower_bound({l, -INF});
    if(it != intervals.end())
    {
        ll rr = (*it).second;
        if(rr <= r) {best_idx = 1; return true;}
    }
    for(int i = K + 1; i <= N; i++)
    {
        min_x.insert(L[i]);
        max_x.insert(R[i]);
        min_x.erase(min_x.find(L[i - K]));
        max_x.erase(max_x.find(R[i - K]));
        ll l = *min_x.begin();
        ll r = *max_x.begin();
        auto it = intervals.lower_bound({l, -INF});
        if(it != intervals.end())
        {
            ll rr = (*it).second;
            if(rr <= r) {best_idx = i - K + 1; return true;}
        }
    }
    return false;
}

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
    LOG[1] = 0;
    for(int i = 2; i < MAXN; i++) LOG[i] = LOG[i / 2] + 1;
    cin >> N >> M >> K;
    for(int i = 1; i <= N; i++) cin >> AX[i] >> AY[i];
    for(int i = 1; i <= M; i++) {cin >> BX[i] >> BY[i]; RMQ_MIN[0][i] = BX[i]; RMQ_MAX[0][i] = BX[i];}
    cout << endl;
    k = (long double) (BY[2] - BY[1]) / (long double) (BX[2] - BX[1]); /// !!!
    n = (long double) BY[1] - k * (long double) BX[1];
    for(int i = 1; i < MAXL; i++)
    {
        for(int j = 1; j + (1 << i) <= M + 1; j++)
        {
            RMQ_MIN[i][j] = min(RMQ_MIN[i - 1][j], RMQ_MIN[i - 1][j + (1 << (i - 1))]);
            RMQ_MAX[i][j] = max(RMQ_MAX[i - 1][j], RMQ_MAX[i - 1][j + (1 << (i - 1))]);
        }
    }
    for(int i = 1; i <= M - K + 1; i++) intervals.insert({MIN_Query(i, i + K - 1), MAX_Query(i, i + K - 1)});
    ll L = 0, R = 2e18;
    while(R - L >= 2)
    {
        ll mid = (L + R) / 2;
        if(check(mid)) R = mid;
        else L = mid;
    }
    cout << R << endl;
    ll minX = 2e18, maxX = -2e18;
    for(int i = best_idx; i <= best_idx + K; i++) {minX = min(minX, left(AX[i], AY[i], R)); maxX = max(maxX, right(AX[i], AY[i], R));}
    multiset < vector <ll> > res;
    for(int i = 1; i <= M - K + 1; i++)
    {
        L = MIN_Query(i, i + K - 1);
        R = MAX_Query(i, i + K - 1);
        if(minX <= L && maxX >= R)
        {
            for(int j = i; j <= i + K - 1; j++) res.insert({BX[j], BY[j], j});
            break;
        }
    }
    for(int i = best_idx; i <= best_idx + K - 1; i++)
    {
        cout << i << " ";
        auto it = res.lower_bound({AX[best_idx], BX[best_idx], 0});
        if(it != res.end()) {cout << (*it)[2] << endl; res.erase(it);}
        else {it--; cout << (*it)[2] << endl; res.erase(it);}
        /// res.erase(it);
    }
    return 0;
}