Problem: You've got a table of size n × m. On the intersection of the i-th row (1 ≤ i ≤ n) and the j-th column (1 ≤ j ≤ m) there is a non-negative integer ai, j. Besides, you've got a non-negative integer k.

Your task is to find such pair of integers (a, b) that meets these conditions: 

  * k ≤ a ≤ n - k + 1; 
  * k ≤ b ≤ m - k + 1; 
  * let's denote the maximum of the function <image> among all integers x and y, that satisfy the inequalities k ≤ x ≤ n - k + 1 and k ≤ y ≤ m - k + 1, as mval; for the required pair of numbers the following equation must hold f(a, b) = mval. 

Input

The first line contains three space-separated integers n, m and k (1 ≤ n, m ≤ 1000, <image>). Next n lines each contains m integers: the j-th number on the i-th line equals ai, j (0 ≤ ai, j ≤ 106).

The numbers in the lines are separated by spaces.

Output

Print the required pair of integers a and b. Separate the numbers by a space.

If there are multiple correct answers, you are allowed to print any of them.

Examples

Input

4 4 2
1 2 3 4
1 1 1 1
2 2 2 2
4 3 2 1


Output

3 2


Input

5 7 3
8 2 3 4 2 3 3
3 4 6 2 3 4 6
8 7 6 8 4 5 7
1 2 3 2 1 3 2
4 5 3 2 1 2 1


Output

3 3

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int S = 1000 + 5;
int n, m, k, kk, lb, rb, ub, db, num[S][S];
long long L[S][S], R[S][S], U[S][S], D[S][S];
long long LL[S][S], RR[S][S], UU[S][S], DD[S][S];
long long LU[S][S], RU[S][S], LD[S][S], RD[S][S];
long long LUC[S][S], RUC[S][S], LDC[S][S], RDC[S][S];
long long LUS[S][S], RUS[S][S], LDS[S][S], RDS[S][S];
long long ans, tot, sum;
int ansx, ansy, tmp;
inline long long calc(int x, int y) {
  long long rt = LUS[x][y] + RUS[x][y] + LDS[x][y] + RDS[x][y];
  rt -= LL[x][y] - L[x][y] + RR[x][y] - R[x][y] + UU[x][y] - U[x][y] +
        DD[x][y] - D[x][y];
  return rt + num[x][y] * k;
}
int main(int argc, char **argv) {
  scanf("%d%d%d", &n, &m, &k);
  kk = k + 1;
  lb = k;
  rb = m - k + 1;
  ub = k;
  db = n - k + 1;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) scanf("%d", &num[i][j]);
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= lb; ++j)
      L[i][j] = L[i][j - 1] + num[i][j],
      LL[i][j] = LL[i][j - 1] + num[i][j] * (j + 1);
    for (int j = lb + 1; j <= m; ++j)
      L[i][j] = L[i][j - 1] + num[i][j] - num[i][j - kk],
      LL[i][j] = LL[i][j - 1] - L[i][j - 1] + num[i][j] * kk;
    for (int j = m; j >= rb; --j)
      R[i][j] = R[i][j + 1] + num[i][j],
      RR[i][j] = RR[i][j + 1] + num[i][j] * (m - j + 2);
    for (int j = rb - 1; j >= 1; --j)
      R[i][j] = R[i][j + 1] + num[i][j] - num[i][j + kk],
      RR[i][j] = RR[i][j + 1] - R[i][j + 1] + num[i][j] * kk;
  }
  for (int j = 1; j <= m; ++j) {
    for (int i = 1; i <= ub; ++i)
      U[i][j] = U[i - 1][j] + num[i][j],
      UU[i][j] = UU[i - 1][j] + num[i][j] * (i + 1);
    for (int i = ub + 1; i <= n; ++i)
      U[i][j] = U[i - 1][j] + num[i][j] - num[i - kk][j],
      UU[i][j] = UU[i - 1][j] - U[i - 1][j] + num[i][j] * kk;
    for (int i = n; i >= db; --i)
      D[i][j] = D[i + 1][j] + num[i][j],
      DD[i][j] = DD[i + 1][j] + num[i][j] * (n - i + 2);
    for (int i = db - 1; i >= 1; --i)
      D[i][j] = D[i + 1][j] + num[i][j] - num[i + kk][j],
      DD[i][j] = DD[i + 1][j] - D[i + 1][j] + num[i][j] * kk;
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m + 1; ++j)
      if (!(i > ub && j > lb))
        LU[i][j] = LU[i - 1][j - 1] + num[i][j];
      else
        LU[i][j] = LU[i - 1][j - 1] + num[i][j] - num[i - kk][j - kk];
    for (int j = m; j >= 0; --j)
      if (!(i > ub && j < rb))
        RU[i][j] = RU[i - 1][j + 1] + num[i][j];
      else
        RU[i][j] = RU[i - 1][j + 1] + num[i][j] - num[i - kk][j + kk];
  }
  for (int i = n; i >= 1; --i) {
    for (int j = 1; j <= m + 1; ++j)
      if (!(i < db && j > lb))
        LD[i][j] = LD[i + 1][j - 1] + num[i][j];
      else
        LD[i][j] = LD[i + 1][j - 1] + num[i][j] - num[i + kk][j - kk];
    for (int j = m; j >= 0; --j)
      if (!(i < db && j < rb))
        RD[i][j] = RD[i + 1][j + 1] + num[i][j];
      else
        RD[i][j] = RD[i + 1][j + 1] + num[i][j] - num[i + kk][j + kk];
  }
  tot = sum = 0;
  for (int i = 1; i <= ub; ++i)
    for (int j = 1; j <= lb; ++j)
      if ((tmp = k - (ub - i + lb - j)) >= 0)
        tot += num[i][j], sum += num[i][j] * tmp;
  for (int i = ub; i <= db; ++i) {
    LUC[i][lb] = tot;
    LUS[i][lb] = sum;
    for (int j = lb + 1; j <= rb; ++j)
      LUC[i][j] = LUC[i][j - 1] - RU[i][j - kk] + U[i][j],
      LUS[i][j] = LUS[i][j - 1] + UU[i][j] - LUC[i][j];
    tot += L[i + 1][lb] - RU[i][0];
    sum += LL[i + 1][lb] - tot;
  }
  tot = sum = 0;
  for (int i = 1; i <= ub; ++i)
    for (int j = m; j >= rb; --j)
      if ((tmp = k - (ub - i + j - rb)) >= 0)
        tot += num[i][j], sum += num[i][j] * tmp;
  for (int i = ub; i <= db; ++i) {
    RUC[i][rb] = tot;
    RUS[i][rb] = sum;
    for (int j = rb - 1; j >= lb; --j)
      RUC[i][j] = RUC[i][j + 1] - LU[i][j + kk] + U[i][j],
      RUS[i][j] = RUS[i][j + 1] + UU[i][j] - RUC[i][j];
    tot += R[i + 1][rb] - LU[i][m + 1];
    sum += RR[i + 1][rb] - tot;
  }
  tot = sum = 0;
  for (int i = n; i >= db; --i)
    for (int j = 1; j <= lb; ++j)
      if ((tmp = k - (i - db + lb - j)) >= 0)
        tot += num[i][j], sum += num[i][j] * tmp;
  for (int i = db; i >= ub; --i) {
    LDC[i][lb] = tot;
    LDS[i][lb] = sum;
    for (int j = lb + 1; j <= rb; ++j)
      LDC[i][j] = LDC[i][j - 1] - RD[i][j - kk] + D[i][j],
      LDS[i][j] = LDS[i][j - 1] + DD[i][j] - LDC[i][j];
    tot += L[i - 1][lb] - RD[i][0];
    sum += LL[i - 1][lb] - tot;
  }
  tot = sum = 0;
  for (int i = n; i >= db; --i)
    for (int j = m; j >= rb; --j)
      if ((tmp = k - (i - db + j - rb)) >= 0)
        tot += num[i][j], sum += num[i][j] * tmp;
  for (int i = db; i >= ub; --i) {
    RDC[i][rb] = tot;
    RDS[i][rb] = sum;
    for (int j = rb - 1; j >= lb; --j)
      RDC[i][j] = RDC[i][j + 1] - LD[i][j + kk] + D[i][j],
      RDS[i][j] = RDS[i][j + 1] + DD[i][j] - RDC[i][j];
    tot += R[i - 1][rb] - LD[i][m + 1];
    sum += RR[i - 1][rb] - tot;
  }
  ans = ansx = ansy = -1;
  for (int i = ub; i <= db; ++i)
    for (int j = lb; j <= rb; ++j)
      if ((tot = calc(i, j)) > ans) ans = tot, ansx = i, ansy = j;
  printf("%d %d\n", ansx, ansy);
  return 0;
}