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>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
using PII = pair<int, int>;
using LL = long long;
using ULL = unsigned long long;
using MAT = array<array<LL, 2>, 2>;
template <class T>
constexpr inline T begin(const T &) {
  return T(0);
}
template <class T>
constexpr inline T end(const T &x) {
  return max(T(0), x);
}
template <class T>
inline void _read(T &x) {
  cin >> x;
}
inline void _read(size_t &x) { scanf("%zu", &x); }
inline void _read(int &x) { scanf("%d", &x); }
inline void _read(LL &x) { scanf("%lld", &x); }
inline void _read(ULL &x) { scanf("%llu", &x); }
inline void _read(double &x) { scanf("%lf", &x); }
inline void _read(char &x) { scanf(" %c", &x); }
inline void _read(char *x) { scanf("%s", x); }
inline void read() {}
template <class T, class... U>
inline void read(T &head, U &...tail) {
  _read(head);
  read(tail...);
}
template <class T>
inline void _print(const T &x) {
  cout << x;
}
inline void _print(const size_t &x) { printf("%zu", x); }
inline void _print(const int &x) { printf("%d", x); }
inline void _print(const LL &x) { printf("%lld", x); }
inline void _print(const ULL &x) { printf("%llu", x); }
inline void _print(const double &x) { printf("%.16lf", x); }
inline void _print(const char &x) { putchar(x); }
inline void _print(const char *x) { printf("%s", x); }
inline void _print(const string &x) { printf("%s", x.c_str()); }
inline void print() { putchar('\n'); }
template <class T, class... U>
inline void print(const T &head, const U &...tail) {
  _print(head);
  if (sizeof...(tail)) putchar(' ');
  print(tail...);
}
const int MOD = 1000000007;
int a[300005][10];
int main() {
  int n, m;
  read(n, m);
  static_assert(std::is_same<remove_reference<decltype(n)>::type,
                             remove_reference<decltype(n)>::type>::value,
                "REP diff types");
  for (auto i = begin(n); i != end(n); ++i) {
    static_assert(std::is_same<remove_reference<decltype(m)>::type,
                               remove_reference<decltype(m)>::type>::value,
                  "REP diff types");
    for (auto j = begin(m); j != end(m); ++j) {
      read(a[i][j]);
    }
  }
  int best = -1, best_i = -1, best_j = -1;
  static_assert(std::is_same<remove_reference<decltype(1)>::type,
                             remove_reference<decltype((1 << m))>::type>::value,
                "REP diff types");
  for (auto t = (1); t < ((1 << m)); ++t) {
    int best1 = -1, best2 = -1;
    int best1i = -1, best2i = -1;
    static_assert(std::is_same<remove_reference<decltype(n)>::type,
                               remove_reference<decltype(n)>::type>::value,
                  "REP diff types");
    for (auto i = begin(n); i != end(n); ++i) {
      int m1 = 0x3f3f3f3f, m2 = 0x3f3f3f3f;
      static_assert(std::is_same<remove_reference<decltype(m)>::type,
                                 remove_reference<decltype(m)>::type>::value,
                    "REP diff types");
      for (auto j = begin(m); j != end(m); ++j) {
        if (t & (1 << j)) {
          m1 = min(m1, a[i][j]);
        } else {
          m2 = min(m2, a[i][j]);
        }
      }
      if (m1 > best1) {
        best1 = m1;
        best1i = i;
      }
      if (m2 > best2) {
        best2 = m2;
        best2i = i;
      }
    }
    if (min(best1, best2) > best) {
      best = min(best1, best2);
      best_i = best1i;
      best_j = best2i;
    }
  }
  print(best_i + 1, best_j + 1);
  return 0;
}