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 PYTHON3):

Solution:
import sys
readline = sys.stdin.readline

def popcount(i):
    assert 0 <= i < 0x100000000
    i = i - ((i >> 1) & 0x55555555)
    i = (i & 0x33333333) + ((i >> 2) & 0x33333333)
    return (((i + (i >> 4) & 0xF0F0F0F) * 0x1010101) & 0xffffffff) >> 24

N, M = map(int, readline().split())

Ar = [tuple(map(int, readline().split())) for _ in range(N)]

pc = [popcount(i) for i in range(1<<(M+1))]

inf = 1<<31
maxi = [0]*(1<<M)

for i in range(N):
    a = Ar[i]
    dp = [0]*(1<<M)
    for S in range(1, 1<<M):
        p = pc[S]
        if p == 1:
            k = S.bit_length() - 1
            dp[S] = a[k]
        else:
            dp[S] = min(dp[-S&S], dp[S^(-S&S)]) 
        maxi[S] = max(maxi[S], dp[S])
for i in range(M):
    for j in range(1<<M):
        if not j & (1<<i):
            maxi[j] = max(maxi[j], maxi[j|(1<<i)])

D = (1<<M)-1
ans = maxi[D]
aS, bS = D, D
for S in range(1<<M):
    candi = min(maxi[S], maxi[D^S])
    if candi > ans:
        aS, bS = S, D^S
        ans = candi

Ans = [None]*2
pre = False
fro = False

for i in range(N):
    a = Ar[i]
    resa = inf
    resb = inf
    for j in range(M):
        if (1<<j)&aS:
            resa = min(resa, a[j])
        else:
            resb = min(resb, a[j])
    if resa >= ans:
        pre = True
        Ans[0] = i+1
    if resb >= ans:
        fro = True
        Ans[1] = i+1
    if pre and fro:
        break
print(*Ans)