Problem: You are given n arrays a_1, a_2, ..., a_n; each array consists of exactly m integers. We denote the y-th element of the x-th array as a_{x, y}.

You have to choose two arrays a_i and a_j (1 ≤ i, j ≤ n, it is possible that i = j). After that, you will obtain a new array b consisting of m integers, such that for every k ∈ [1, m] b_k = max(a_{i, k}, a_{j, k}).

Your goal is to choose i and j so that the value of min _{k = 1}^{m} b_k is maximum possible.

Input

The first line contains two integers n and m (1 ≤ n ≤ 3 ⋅ 10^5, 1 ≤ m ≤ 8) — the number of arrays and the number of elements in each array, respectively.

Then n lines follow, the x-th line contains the array a_x represented by m integers a_{x, 1}, a_{x, 2}, ..., a_{x, m} (0 ≤ a_{x, y} ≤ 10^9).

Output

Print two integers i and j (1 ≤ i, j ≤ n, it is possible that i = j) — the indices of the two arrays you have to choose so that the value of min _{k = 1}^{m} b_k is maximum possible. If there are multiple answers, print any of them.

Example

Input


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


Output


1 5

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const int INFMEM = 63;
const int INF = 1061109567;
const double DINF = numeric_limits<double>::infinity();
const int MOD = 1000000007;
const int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
const double PI = 3.141592653589793;
inline void open(string a) {
  freopen((a + ".in").c_str(), "r", stdin);
  freopen((a + ".out").c_str(), "w", stdout);
}
inline void fasterios() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
inline void fastll(int &input_number) {
  input_number = 0;
  int ch = getchar_unlocked();
  int sign = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') sign = -1;
    ch = getchar_unlocked();
  }
  while (ch >= '0' && ch <= '9') {
    input_number = (input_number << 3) + (input_number << 1) + ch - '0';
    ch = getchar_unlocked();
  }
  input_number *= sign;
}
int n, m;
struct dt {
  int val, x, y;
  bool operator<(const dt &other) const {
    if (val != other.val) return val > other.val;
    if (x != other.x) return x < other.x;
    return y < other.y;
  };
};
vector<dt> all;
int mask[300005];
int idx[260];
int main() {
  fastll(n);
  fastll(m);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      int tmp;
      fastll(tmp);
      all.push_back({tmp, i, j - 1});
    }
  }
  sort(all.begin(), all.end());
  for (int i = 0; i < all.size(); i++) {
    dt cur = all[i];
    mask[cur.x] |= (1 << cur.y);
    for (int j = 0; j < (1LL << m); j++)
      if ((j & mask[cur.x]) == j) idx[j] = cur.x;
    int rev = (1 << m) - 1;
    rev ^= mask[cur.x];
    if (idx[rev] == 0) continue;
    printf("%d %d\n", cur.x, idx[rev]);
    exit(0);
  }
  printf("1 1\n");
  return 0;
}