#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define sc second
#define endl "\n"
#define pii pair<int,int>

using namespace std;

const int MAXN = 1e5+5;
const int mod7 = 1e9+7;
const long long inf = 1e18;

int kvadrat(int x)
{
    return x*x;
}


signed main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int n,m,k;
    cin >> n >> m >> k;
    vector<pii> mars(n);
    vector<pii> nis(m);
    for(int i=0; i<n; i++)cin >> mars[i].fi >> mars[i].sc;
    for(int i=0; i<m; i++)cin >> nis[i].fi >> nis[i].sc;
    sort(all(mars));
    sort(all(nis));
    if(n == 1 && m == 1)
    {
        cout << kvadrat(mars[0].fi - nis[0].fi) + kvadrat(mars[0].sc - nis[0].sc) << endl;
        cout << 1 << " " << 1 << endl;
    }
    else if(m == 1)
    {
        int mn = inf;
        int rez = -1;
        for(int i=0; i<n; i++)
        {
            int tr = kvadrat(mars[i].fi - nis[0].fi) + kvadrat(mars[i].sc - nis[0].sc);
            if(mn > tr)
            {
                mn = tr;
                rez = i+1;
            }
        }
        cout << mn << endl;
        cout << rez << " " << 1 << endl;
    }
    else if(n == 1)
    {
        int mn = inf;
        int rez = -1;
        for(int i=0; i<n; i++)
        {
            int tr = kvadrat(mars[0].fi - nis[i].fi) + kvadrat(mars[0].sc - nis[i].sc);
            if(mn > tr)
            {
                mn = tr;
                rez = i+1;
            }
        }
        cout << mn << endl;
        cout << rez << " " << 1 << endl;
    }
    else if(nis[m-1].fi <= mars[0].fi)
    {
        vector<pii> rez;
        int mn = inf;
        for(int i=0; i<k; i++)
        {
            rez.pb({i+1,m-k+i+1});
            mn=min(mn,kvadrat(nis[m-k+i].fi - mars[i].fi) + kvadrat(nis[m-k+i].sc - mars[i].sc));
        }
        cout << mn << endl;
        for(auto x: rez)cout << x.fi << " " << x.sc << endl;
    }
    else if(nis[0].fi >= mars[n-1].fi)
    {
        vector<pii> rez;
        int mn = inf;
        for(int i=0; i<k; i++)
        {
            rez.pb({n-k+i+1,i+1});
            mn=min(mn,kvadrat(nis[i].fi - mars[n-k+i].fi) + kvadrat(nis[i].sc - mars[n-k+i].sc));
        }
        cout << mn << endl;
        for(auto x: rez)cout << x.fi << " " << x.sc << endl;
    }




}