#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<int>nis(n);
    vector<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;
        bnis = b;
    }
    for(int i = 0; i<m; i++){
        cin>>a>>b;
        mars[i] = a;
        bmar = b;
    }

    sort(nis.begin() , nis.end());
    sort(mars.begin() , mars.end());
    a = (abs(bnis - bmar)) * (abs(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;
    }

}