#include <bits/stdc++.h>
using namespace std;

#define Task "Test"
#define int long long
#define el '\n'
#define cnt_bit_1 __builtin_popcountll
#define float double
#define IO freopen(Task".inp","r",stdin); freopen(Task".out","w",stdout);
#define pii pair<int,int>
#define fi first
#define se second
#define pb push_back

const int N=2e5+5;
const int INF=1e18;
const int MOD=1e9+7;

int n, a[N];

signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    // IO

    cin >> n;

    for(int i = 1; i <= n; i++)
        cin >> a[i];

    int mn = a[1];
    int pos = 1;

    int best = LLONG_MIN;
    int l = 1, r = 2;

    for(int j = 2; j <= n; j++)
    {
        if(a[j] - mn > best)
        {
            best = a[j] - mn;
            l = pos;
            r = j;
        }

        if(a[j] < mn)
        {
            mn = a[j];
            pos = j;
        }
    }

    cout << l << ' ' << r << el;
    cout << best << el;

    return 0;
}