#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long n,m,k;
    cin>>n>>m>>k;
    map<pair<long,long>,int>mp1;
    map<pair<long,long>,int>mp2;
    vector<pair<long long,long long>>a(n),b(m);
    for(int i=0;i<n;i++){
        cin>>a[i].first>>a[i].second;
        mp1[a[i]]=i+1;
    }
    for(int i=0;i<m;i++){
        cin>>b[i].first>>b[i].second;
        mp2[b[i]]=i+1;
    }
    sort(a.begin(),a.end());
    sort(b.begin(),b.end());
    long long res=min((a[0].first-b[m-1].first)*(a[0].first-b[m-1].first)+(a[0].second-b[m-1].second)*(a[0].second-b[m-1].second),(a[n-1].first-b[0].first)*(a[n-1].first-b[0].first)+(a[n-1].second-b[0].second)*(a[n-1].second-b[0].second));
    cout<<res<<'\n';
    if((a[0].first-b[m-1].first)*(a[0].first-b[m-1].first)+(a[0].second-b[m-1].second)*(a[0].second-b[m-1].second)<(a[n-1].first-b[0].first)*(a[n-1].first-b[0].first)+(a[n-1].second-b[0].second)*(a[n-1].second-b[0].second)){
        cout<<mp1[a[0]]<<' '<<mp2[b[m-1]]<<'\n';
    }
    else cout<<mp1[a[n-1]]<<' '<<mp2[b[0]]<<'\n';
    return 0;
}