#include <iostream>
#include<vector>
#include<algorithm>
#include<set>
#define int long long
#define pii pair<int,int>
#define fi first
#define se second
#define MAXN (int)2e5+5
using namespace std;
pii c1[MAXN],c2[MAXN];
int rx = 0, ry = 0;
bool s(pii& a, pii& b) {
	if (a.fi == b.fi) {
		return a.se * ry > b.se * ry;
	}
	return a.fi * rx > b.fi * rx;
}
int sq(int a) {
	return a * a;
}
int dis(pii a, pii b) {
	return sq(a.fi- b.fi) + sq(a.se- b.se);
}
void solve() {
	int n, m, k; cin >> n >> m >> k;
	for (int i = 1; i <= n; i++) {
		int a, b; cin >> a >> b;
		c1[i] = { a,b };
	}for (int i = 1; i <= m; i++) {
		int a, b; cin >> a >> b;
		c2[i] = { a,b };
	}

	if (m > 1) {
		rx = c2[1].fi - c2[0].fi;
		ry = c2[1].se - c2[0].se;
	}
	sort(c2 + 1, c2 + m + 1, s);
	if (n > 1) {
		rx = c1[1].fi - c1[0].fi;
		ry = c1[1].se - c1[0].se;
	}
	sort(c1 + 1, c1 + n + 1, s);
	int j = 1;
	pii rez = { -1,-1 };
	int s = 1e18;
	for (int i = 1; i <= n; i++) {
		while (j > 1 && dis(c2[j - 1], c1[i]) < dis(c2[j], c1[i])) {
			j--;
		}while (j < m && dis(c2[j + 1], c1[i]) < dis(c2[j], c1[i])) {
			j++;
		}
		if (s >= dis(c2[j], c1[i])) {
			s = dis(c2[j], c1[i]);
			rez = { i,j };
		}
	}
	cout << s << '\n';
	cout << rez.fi << ' ' << rez.se << '\n';
}
int32_t main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int32_t T = 1;// cin >> T;
	while (T--) {
		solve();
	}
	return 0;
}