#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll sqr(ll x) {return x * x;}
struct Point
{
  ll x, y;
}A[200001], B[200001];
int N, M, K;
ll DIST[3001][3001];
void Brute()
{
  if((N > 10) || (M > 10)) return;
  for(int i = 1; i <= N; i++)
  {
    for(int j = 1; j <= M; j++) DIST[i][j] = sqr(A[i].x - B[j].x) + sqr(A[i].y - B[j].y);
  }
  ll sol = 3e18, temp;
  vector <int> V;
  vector <pair <int, int>> OUT;
  for(int i = K; i <= N; i++)
  {
    for(int j = i - K + 1; j <= i; j++) V.push_back(j);
    do
    {
      for(int j = K; j <= M; j++)
      {
        temp = 0;
        for(int k = j - K + 1, l = 0; k <= j; k++, l++) temp = max(DIST[V[l]][k], temp);
        if(temp >= sol) continue;
        sol = temp;
        OUT.clear();
        for(int k = j - K + 1, l = 0; k <= j; k++, l++) OUT.push_back({V[l], k});
      }
    }while(next_permutation(V.begin(), V.end()));
    V.clear();
  }
  cout << sol << '\n';
  for(pair <int, int> p : OUT) cout << p.first << ' ' << p.second << '\n';
  exit(0);
}
ll Dist(int i, int j) {return sqr(A[i].x - B[j].x) + sqr(A[i].y - B[j].y);}
void K1()
{
  if(K > 1) return;
  ll sol = 3e18;
  pair <int, int> OUT;
  for(int i = 1, j = 1; i <= N; i++)
  {
    while((j < M) && (Dist(i, j + 1) <= Dist(i, j))) j++;
    while((j > 1) && (Dist(i, j - 1) <= Dist(i, j))) j--;
    if(Dist(i, j) >= sol) continue;
    sol = Dist(i, j);
    OUT = {i, j};
  }
  cout << sol << '\n' << OUT.first << ' ' << OUT.second << '\n';
  exit(0);
}
int main()
{
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> N >> M >> K;
  for(int i = 1; i <= N; i++) cin >> A[i].x >> A[i].y;
  for(int i = 1; i <= M; i++) cin >> B[i].x >> B[i].y;
  Brute();
  K1();

  return 0;
}