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;
long long nxt() {
  long long x;
  cin >> x;
  return x;
}
void setIO(string s) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  freopen((s + ".in").c_str(), "r", stdin);
  freopen((s + ".out").c_str(), "w", stdout);
}
const long long mod = 1e9 + 7;
void yes() { cout << "YES\n"; }
void no() { cout << "NO\n"; }
bool possible(long long mid, long long n, long long m,
              vector<vector<long long> > &a, long long &I, long long &J) {
  long long max_mask = 1 << m;
  vector<long long> bit_present(max_mask, -1);
  for (long long i = (long long)(0); i < (long long)(n); i++) {
    long long cur_bit = 0;
    long long looking_for = 0;
    long long bit_cnt_looking_for = 0;
    for (long long j = (long long)(0); j < (long long)(m); j++) {
      if (a[i][j] >= mid)
        cur_bit |= (1 << j);
      else {
        looking_for |= (1 << j);
        bit_cnt_looking_for++;
      }
    }
    bit_present[cur_bit] = i;
    for (long long j = (long long)(0); j < (long long)(max_mask); j++) {
      if ((j & looking_for) == looking_for && bit_present[j] != -1) {
        I = bit_present[j];
        J = i;
        return 1;
      }
    }
  }
  return 0;
}
void solve() {
  long long n, m;
  cin >> n >> m;
  vector<vector<long long> > a(n, vector<long long>(m));
  for (long long i = (long long)(0); i < (long long)(n); i++)
    for (long long j = (long long)(0); j < (long long)(m); j++) cin >> a[i][j];
  long long lo = 0, hi = 1000 * 1000 * 1000 + 5;
  long long I = 0, J = 0;
  while (lo < hi) {
    long long mid = (lo + hi + 1) / 2;
    if (possible(mid, n, m, a, I, J)) {
      lo = mid;
    } else {
      hi = mid - 1;
    }
  }
  42;
  cout << I + 1 << " " << J + 1 << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout << fixed << setprecision(10);
  long long T = 1;
  for (long long tc = 1; tc <= T; tc++) {
    solve();
  }
}