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

main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int n , m , k , a , b , bmar , bnis;
    cin>>n>>m>>k;
//    vector<pair<int , int>>par(n);
    vector<pair<int , int>>nis(n);
    vector<pair<int , int>>mars(m);
//
//    for(int i = 0; i<n; i++){
//        cin>>a>>b;
//        if(i == 0){apr = a; bpr = b;continue;}
//        if(apr = a && bpr != b){}
//    }

    for(int i = 0; i<n; i++){
        cin>>a>>b;
        nis[i] = {a , b};
        bnis = b;
    }
    for(int i = 0; i<m; i++){
        cin>>a>>b;
        mars[i] = {a , b};
        bmar = b;
    }

    sort(nis.begin() , nis.end());
    sort(mars.begin() , mars.end());




    if(k == 1){
        int prosla , ni , mi , res = LONG_MAX-67 , jpr = 0 , dist;
        for (int i = 0; i<n; i++){
            for (int j = jpr; j<m; j++){
                dist = (nis[i].first - mars[j].first)*(nis[i].first - mars[j].first) + (nis[i].second - mars[j].second)*(nis[i].second - mars[j].second);
                if(j == jpr){
                    prosla = dist;
                    continue;
                }
                if(prosla < dist){
                    jpr = j-1;
                    if(res > prosla){
                        res = prosla;
                        ni = i+1;
                        mi = j;
                    }
                    break;
                }
                prosla = dist;
            }
        }

        cout<<res<<"\n"<<ni<<" "<<mi;

    }




























//
//    int dist = 0 , res = 0;
//    a = (bnis - bmar) * (bnis - bmar);
//
//    if (nis[n-1] < mars[0]){
//        for (int i = 0; i<k; i++){
//            dist = (mars[i] - nis[n-k + i])*(mars[i] - nis[n-k + i]);
//            res = max(res , dist + a);
//        }
//
//        cout<<res<<"\n";
//
//
//        for (int i = 1; i<=k; i++){
//            cout<<n-k + i<<" "<<i<<"\n";
//        }
//
//
//    }else{
//        for (int i = 0; i<k; i++){
//            dist = (nis[i] - mars[m-k + i])*(nis[i] - mars[m-k + i]);
//            res = max(res , dist + a);
//        }
//
//        cout<<res<<"\n";
//
//
//        for (int i = 1; i<=k; i++){
//            cout<<i<<" "<<n-k + i<<"\n";
//        }
//    }
//
////    a = (bnis - bmar) * (bnis - bmar);
////
////    int res = min(a + (mars[0] - nis[n-1])*(mars[0] - nis[n-1])  , a + (nis[0] - mars[m-1])*(nis[0] - mars[m-1]));
////    cout<<res;
////
////    if (res == a + (mars[0] - nis[n-1])*(mars[0] - nis[n-1])){
////        cout<<n<<" "<<1;
////    }else if (res == a + (nis[0] - mars[m-1])*(nis[0] - mars[m-1])){
////        cout<<1<<" "<<m;
////    }

}