Problem: Gardener Alex loves to grow trees. We remind that tree is a connected acyclic graph on n vertices. 

Today he decided to grow a rooted binary tree. A binary tree is a tree where any vertex has no more than two sons. Luckily, Alex has a permutation of numbers from 1 to n which he was presented at his last birthday, so he decided to grow a tree according to this permutation. To do so he does the following process: he finds a minimum element and makes it a root of the tree. After that permutation is divided into two parts: everything that is to the left of the minimum element, and everything that is to the right. The minimum element on the left part becomes the left son of the root, and the minimum element on the right part becomes the right son of the root. After that, this process is repeated recursively on both parts.

Now Alex wants to grow a forest of trees: one tree for each cyclic shift of the permutation. He is interested in what cyclic shift gives the tree of minimum depth. Unfortunately, growing a forest is a hard and long process, but Alex wants the answer right now. Will you help him?

We remind that cyclic shift of permutation a_1, a_2, …, a_k, …, a_n for k elements to the left is the permutation a_{k + 1}, a_{k + 2}, …, a_n, a_1, a_2, …, a_k.

Input

First line contains an integer number n ~ (1 ⩽ n ⩽ 200 000) — length of the permutation.

Second line contains n integer numbers a_1, a_2, …, a_n ~ (1 ⩽ a_i ⩽ n), and it is guaranteed that all numbers occur exactly one time.

Output

Print two numbers separated with space: minimum possible depth of a tree and how many elements we need to shift left to achieve this depth. The number of elements should be a number from 0 to n - 1. If there are several possible answers, print any of them.

Example

Input


4
1 2 3 4


Output


3 2

Note

The following picture depicts all possible trees for sample test and cyclic shifts on which they are achieved. 

<image>

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
mt19937_64 mt_rand(chrono::system_clock::now().time_since_epoch().count());
template <typename T1, typename T2>
inline bool upmax(T1& a, T2 b) {
  return (a < b ? (a = b, true) : false);
}
template <typename T1, typename T2>
inline bool upmin(T1& a, T2 b) {
  return (b < a ? (a = b, true) : false);
}
const int maxn = (int)4e5 + 100;
const int maxlog = 21;
const int base = 1e9 + 7;
const long double eps = (long double)1e-9;
const long double PI = acos(-1.);
const int inf = 2e9;
const long long llinf = 1e18;
int tmin[4 * maxn];
int tdep[4 * maxn];
int tmxdep[4 * maxn];
int table[22][maxn];
int numlog[maxn];
int n;
int a[maxn];
int L, R;
void buildTable() {
  numlog[1] = 0;
  for (int i = 2; i <= R; i++) numlog[i] = numlog[i / 2] + 1;
  for (int i = 0; i <= numlog[R]; i++) {
    int curlen = 1 << i;
    for (int j = 1; j <= R; j++) {
      if (i == 0) {
        table[i][j] = a[j];
        continue;
      }
      table[i][j] = min(table[i - 1][j], table[i - 1][j + curlen / 2]);
    }
  }
}
int GetMin(int l, int r) {
  int curlog = numlog[r - l + 1];
  return min(table[curlog][l], table[curlog][r - (1 << curlog) + 1]);
}
void bld(int v, int l, int r) {
  if (l == r)
    tmin[v] = inf;
  else {
    int m = (l + r) >> 1;
    bld(v + v, l, m);
    bld(v + v + 1, m + 1, r);
    tmin[v] = min(tmin[v + v], tmin[v + v + 1]);
  }
}
void push(int v, int l, int r) {
  if (l != r && tdep[v]) {
    tdep[v + v] += tdep[v];
    tdep[v + v + 1] += tdep[v];
    tmxdep[v + v] += tdep[v];
    tmxdep[v + v + 1] += tdep[v];
    tdep[v] = 0;
  }
}
void add(int v, int l, int r, int pos, int val, int deps) {
  if (l == r) {
    tmin[v] = val;
    tdep[v] = deps;
    tmxdep[v] = deps;
  } else {
    push(v, l, r);
    int m = (l + r) >> 1;
    if (pos <= m)
      add(v + v, l, m, pos, val, deps);
    else
      add(v + v + 1, m + 1, r, pos, val, deps);
    tmin[v] = min(tmin[v + v], tmin[v + v + 1]);
    tmxdep[v] = max(tmxdep[v + v], tmxdep[v + v + 1]);
  }
}
void upd(int v, int tl, int tr, int l, int r, int kek) {
  if (tl == l && tr == r) {
    tdep[v] += kek;
    tmxdep[v] += kek;
  } else {
    push(v, tl, tr);
    int m = (tl + tr) >> 1;
    if (l <= m) upd(v + v, tl, m, l, min(r, m), kek);
    if (r > m) upd(v + v + 1, m + 1, tr, max(l, m + 1), r, kek);
    tmxdep[v] = max(tmxdep[v + v], tmxdep[v + v + 1]);
  }
}
int getmin(int v, int tl, int tr, int l, int r) {
  if (tl == l && tr == r) {
    return tmin[v];
  } else {
    push(v, tl, tr);
    int m = (tl + tr) >> 1;
    int mn = inf;
    if (l <= m) upmin(mn, getmin(v + v, tl, m, l, min(r, m)));
    if (r > m) upmin(mn, getmin(v + v + 1, m + 1, tr, max(l, m + 1), r));
    return mn;
  }
}
int getdep(int v, int l, int r, int pos) {
  if (l == r) {
    return tmxdep[v];
  }
  push(v, l, r);
  int m = (l + r) >> 1;
  if (pos <= m)
    return getdep(v + v, l, m, pos);
  else
    return getdep(v + v + 1, m + 1, r, pos);
}
void add(int pos, int val) {
  int l = 1;
  int r = pos;
  while (l != r) {
    int m = (l + r) >> 1;
    if (GetMin(m, pos) < val) {
      l = m + 1;
    } else {
      r = m;
    }
  }
  int dep = getdep(1, L, R, l - 1) + 1;
  if (l <= pos - 1) {
    upd(1, L, R, l, pos - 1, +1);
  }
  add(1, L, R, pos, val, dep);
}
void rem(int pos, int val) {
  int l = pos;
  int r = R;
  while (l != r) {
    int m = (l + r + 1) >> 1;
    if (GetMin(pos, m) < val) {
      r = m - 1;
    } else {
      l = m;
    }
  }
  if (l >= pos + 1) {
    upd(1, L, R, pos + 1, l, -1);
  }
  add(1, L, R, pos, val, 0);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    a[i + n] = a[i];
  }
  L = 0;
  R = 2 * n;
  bld(1, L, R);
  buildTable();
  for (int i = 1; i <= n; i++) {
    add(i, a[i]);
  }
  int ans = tmxdep[1];
  int shift = 0;
  for (int i = 1; i < n; i++) {
    rem(i, a[i]);
    a[i + n] = a[i];
    add(i + n, a[i + n]);
    if (upmin(ans, tmxdep[1])) {
      shift = i;
    }
  }
  cout << ans << ' ' << shift << "\n";
  return 0;
}