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 long long ool = 1e18 + 9;
const int oo = 1e9 + 9, base = 1e9 + 7;
const double eps = 1e-7;
const int N = 4e5 + 6;
struct SegTree {
  int sz;
  pair<int, int> mn[N * 4];
  int mxd[N * 4], add[N * 4];
  void recalc(int v) {
    mn[v] = min(mn[v << 1], mn[v << 1 | 1]);
    mxd[v] = max(mxd[v << 1], mxd[v << 1 | 1]);
  }
  void push(int v, int tl, int tr) {
    if (tl != tr - 1) {
      add[v << 1] += add[v];
      add[v << 1 | 1] += add[v];
    }
    mxd[v] += add[v];
    add[v] = 0;
  }
  void build(int *a, int _sz) {
    sz = _sz;
    _build(1, 1, sz + 1, a);
  }
  void _build(int v, int tl, int tr, int *a) {
    if (tl == tr - 1) {
      mn[v] = {a[tl], 0};
      return;
    }
    int mid = (tl + tr) >> 1;
    _build(v << 1, tl, mid, a);
    _build(v << 1 | 1, mid, tr, a);
    recalc(v);
  }
  void updDepth(int l, int r, int val) {
    _updDepth(1, 1, sz + 1, l, r + 1, val);
  }
  void _updDepth(int v, int tl, int tr, int ql, int qr, int val) {
    push(v, tl, tr);
    if (qr <= tl || tr <= ql) return;
    if (ql <= tl && tr <= qr) {
      add[v] += val;
      push(v, tl, tr);
      return;
    }
    int mid = (tl + tr) >> 1;
    _updDepth(v << 1, tl, mid, ql, qr, val);
    _updDepth(v << 1 | 1, mid, tr, ql, qr, val);
    recalc(v);
  }
  int getMaxDepth(int l, int r) { return _getMaxDepth(1, 1, sz + 1, l, r + 1); }
  int _getMaxDepth(int v, int tl, int tr, int ql, int qr) {
    push(v, tl, tr);
    if (qr <= tl || tr <= ql) return -1;
    if (ql <= tl && tr <= qr) return mxd[v];
    int mid = (tl + tr) >> 1;
    return max(_getMaxDepth(v << 1, tl, mid, ql, qr),
               _getMaxDepth(v << 1 | 1, mid, tr, ql, qr));
  }
  pair<int, int> getMin(int l, int r) {
    return _getMin(1, 1, sz + 1, l, r + 1);
  }
  pair<int, int> _getMin(int v, int tl, int tr, int ql, int qr) {
    push(v, tl, tr);
    if (qr <= tl || tr <= ql) return {oo, 0};
    if (ql <= tl && tr <= qr) return mn[v];
    int mid = (tl + tr) >> 1;
    return min(_getMin(v << 1, tl, mid, ql, qr),
               _getMin(v << 1 | 1, mid, tr, ql, qr));
  }
} t;
int n, a[N], ind[N], prv[N], nxt[N];
void init(int l, int r, int depth) {
  if (r < l) return;
  int mn = t.getMin(l, r).first;
  int pos = ind[mn];
  t.updDepth(pos, pos, depth);
  init(l, pos - 1, depth + 1);
  init(pos + 1, r, depth + 1);
}
int main() {
  ios_base ::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    ind[a[i]] = i;
  }
  for (int i = n + 1; i <= n + n; ++i) {
    a[i] = a[i - n];
  }
  stack<int> st;
  for (int i = 1; i <= n + n; ++i) {
    while ((int)st.size() && a[st.top()] > a[i]) {
      st.pop();
    }
    if ((int)st.size())
      prv[i] = st.top();
    else
      prv[i] = 0;
    st.push(i);
  }
  while ((int)st.size()) st.pop();
  for (int i = n + n; i >= 1; --i) {
    while ((int)st.size() && a[st.top()] > a[i]) {
      st.pop();
    }
    if ((int)st.size())
      nxt[i] = st.top();
    else
      nxt[i] = n + n + 1;
    st.push(i);
  }
  t.build(a, n + n);
  init(1, n, 0);
  int ans = t.getMaxDepth(1, n);
  int ansPos = 0;
  for (int i = 1; i <= n - 1; ++i) {
    int pos = i + n;
    if (a[i] != 1) pos = nxt[i];
    t.updDepth(i + 1, pos - 1, -1);
    pos = i;
    if (a[i] != 1) pos = prv[i + n];
    t.updDepth(pos + 1, i + n - 1, 1);
    int newDepth = t.getMaxDepth(pos, pos) + (a[i] != 1);
    t.updDepth(i + n, i + n, newDepth);
    int height = t.getMaxDepth(i + 1, i + n);
    if (height < ans) {
      ans = height;
      ansPos = i;
    }
  }
  cout << ans + 1 << " " << ansPos << "\n";
  return 0;
}