def findMaxIndex(self, index, a, curr):
    ans = (- 1)
    index = 0
    for i in range(index, len(a)):
        if (a[i] > curr):
            if (ans == (- 1)):
                ans = curr
                index = i
            else:
                ans = min(ans, a[i])
                index = i
    return index
def findMaxIndex(self, index, a, curr):
    ans = (- 1)
    index = 0
    for i in range(index, len(a)):
        if (a[i] > curr):
            if (ans == (- 1)):
                ans = curr
                index = i
            else:
                ans = min(ans, a[i])
                index = i
    return index