#include<bits/stdc++.h>
#define ll long long
using namespace std;
struct doublet{
    int x,y;
};
int distanca(doublet a, doublet b)
{
    return (a.x+b.x)*(a.x+b.x)+(a.y+b.y)*(a.y+b.y);
}
bool Uporedi(doublet a, doublet b)
{
    return a.x<b.x;
}
int main()
{
    int n,m,k;
    vector<doublet> Ni,res;
    vector<doublet> Mi;
    cin>>n>>m>>k;
    for(int i=0;i<n;i++)
    {
        int xi,yi;
        cin>>xi>>yi;
        doublet a;
        a.x=xi;
        a.y=yi;
        Ni.push_back(a);
    }
    for(int i=0;i<m;i++)
    {
        int xj,yj;
        cin>>xj>>yj;
        doublet a;
        a.x=xj;
        a.y=yj;
        Mi.push_back(a);
    }
    int min=100000000;
    int jx=0,ix=0;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {
            if(distanca(Mi[j],Ni[i])<min)
            {
                min=distanca(Mi[j],Ni[i]);
                ix=i;
                jx=j;
            }
        }
    }
    cout<<min<<endl;
    cout<<ix+1<<" "<<jx+1;
}