#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
	
	int n, m,k;
	cin>>n>>m>>k;
	vector<int> x1(n),y1(n),x2(m),y2(m);
	for (int i = 0;i<n;i++){
		cin>>x1[i]>>y1[i];
	}
	for (int i = 0;i < m;i++){
		cin>>x2[i]>>y2[i];
	}
	
	int i1 = 0, j1 = k;
	int i2 = 0, j2 = k;
	long long rez = LONG_LONG_MAX;
	int i1_rez, i2_rez;
	while(i1+k -1 <n){
		i2 = 0;
		while(i2+k-1 < m) {
//			cout<<i1<<" "<<i1+k<<"   "<<i2<<" "<<i2+k<<'\n';	

			long long rastojanje = LONG_LONG_MIN;
			for (int i = 0; i < k; i++){
				long long dx = x1[i1+i] - x2[i2+i];
				long long dy = y1[i1+i] - y2[i2+i];
				rastojanje = max(rastojanje, dx*dx+dy*dy);
//				cout<<rastojanje<<'\n';
			}
			
			if (rastojanje < rez){
				rez = rastojanje;
				i1_rez = i1;
				i2_rez = i2;
			}
//			rez = min(rez, rastojanje);
			i2++;
		}
		i1++;
		
	}
	cout<<rez<<'\n';
	for (int i = 0; i < k; i++){
		cout<<i1_rez + i+1<<" "<<i2_rez + i+1<<'\n';
	}
	
	return 0;
}