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>
using namespace std;
const int MN = 200200;
const int MM = MN * 2;
class SP {
 private:
  long long n, h;
  vector<long long> lt, w;
  vector<vector<long long> > st;
  void pre() {
    for (int i = 0; i < n; i++) {
      st[i][0] = i;
    }
    for (int j = 1; j <= h; j++) {
      for (int i = 0; i + (1 << j) <= n; i++) {
        long long a = st[i][j - 1], b = st[i + (1 << (j - 1))][j - 1];
        if (w[a] < w[b]) {
          st[i][j] = a;
        } else {
          st[i][j] = b;
        }
      }
    }
  }

 public:
  SP(vector<long long> ar) {
    n = ar.size();
    w = ar;
    h = 0;
    lt.assign(2, 0);
    for (int i = 2; i <= n; i++) {
      lt.push_back(lt[i / 2] + 1);
    }
    h = lt[n] + 1;
    st.assign(n, vector<long long>(h, -1));
    pre();
  }
  long long qu(long long l, long long r) {
    long long j = lt[r - l + 1];
    long long a = st[l][j], b = st[(r - (1 << j) + 1)][j];
    if (w[a] < w[b]) return a;
    return b;
  }
  vector<long long> arr() { return w; }
};
class ST {
 private:
  int n, h;
  vector<long long> st, lz;
  const long long STV = -1LL << 62;
  int log2(int v) {
    if (v <= 1) return 1;
    return log2(v / 2) + 1;
  }
  void ap(int p, int val) {
    st[p] += val;
    if (p < n) {
      lz[p] += val;
    }
  }
  void build(int p) {
    while (p > 1) {
      p >>= 1;
      if (p >= n) continue;
      st[p] = max(st[p << 1], st[p << 1 | 1]) + lz[p];
    }
  }
  void psh(int p) {
    for (int s = h; s > 0; s--) {
      int i = p >> s;
      if (lz[i] != 0) {
        ap(i << 1, lz[i]);
        ap(i << 1 | 1, lz[i]);
        lz[i] = 0;
      }
    }
  }

 public:
  ST(int _n) {
    n = _n;
    h = log2(n);
    st.assign(2 * n, 0);
    lz.assign(n, 0);
  }
  void up(int l, int r, long long val) {
    if (l >= r) return;
    l += n;
    r += n;
    int li = l, ri = r;
    for (; l < r; l >>= 1, r >>= 1) {
      if (l & 1) {
        ap(l++, val);
      }
      if (r & 1) {
        ap(--r, val);
      }
    }
    build(li);
    build(ri - 1);
  }
  long long qu(int l, int r) {
    l += n;
    r += n;
    psh(l);
    psh(r - 1);
    long long res = STV;
    for (; l < r; l >>= 1, r >>= 1) {
      if (l & 1) {
        res = max(res, st[l++]);
      }
      if (r & 1) {
        res = max(res, st[--r]);
      }
    }
    return res;
  }
};
ST sa(MM);
int w[MN];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<long long> tv(2 * n);
  for (int i = 0; i < n; i++) {
    cin >> w[i];
    tv[i] = tv[i + n] = w[i];
  }
  SP sb(tv);
  for (int i = 0; i < n; i++) {
    long long s = 0, e = i;
    long long id = -1, lv;
    while (s <= e) {
      long long m = (s + e) / 2;
      if (tv[sb.qu(m, i)] < w[i]) {
        id = m;
        s = m + 1;
      } else {
        e = m - 1;
      }
    }
    if (id < 0) {
      lv = 1;
    } else {
      lv = sa.qu(id, id + 1) + 1;
    }
    sa.up(id + 1, i, 1);
    sa.up(i, i + 1, lv);
  }
  long long ma = sa.qu(0, n), mi = 0;
  for (int i = 0; i < n; i++) {
    long long s = i + 1, e = i + n;
    long long x = -1, lv;
    while (s <= e) {
      long long m = (s + e) / 2;
      if (tv[sb.qu(i + 1, m)] < w[i]) {
        x = m;
        e = m - 1;
      } else {
        s = m + 1;
      }
    }
    if (x < 0) {
      x = i + n;
    }
    long long id = -1;
    s = i + 1, e = i + n;
    while (s <= e) {
      long long m = (s + e) / 2;
      if (tv[sb.qu(m, i + n)] < w[i]) {
        id = m;
        s = m + 1;
      } else {
        e = m - 1;
      }
    }
    if (id < 0) {
      lv = 1;
    } else {
      lv = sa.qu(id, id + 1) + 1;
    }
    sa.up(i, x, -1);
    sa.up(id + 1, i + n, 1);
    sa.up(i + n, i + n + 1, lv);
    long long nn = sa.qu(i + 1, i + n + 1);
    if (nn < ma) {
      ma = nn;
      mi = i + 1;
    }
  }
  cout << ma << " " << mi << '\n';
}