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;
struct segtree {
  long long n, h;
  vector<long long> t;
  vector<long long> d;
  segtree(vector<long long>& a) {
    n = a.size();
    t = vector<long long>(n << 1 | 1, 0);
    d = vector<long long>(n << 1 | 1);
    h = sizeof(long long) * 8 - __builtin_clz(n);
  }
  void apply(long long p, long long val) {
    t[p] += val;
    if (p < n) d[p] += val;
  }
  void build(long long p) {
    while (p > 1) p >>= 1, t[p] = max(t[p << 1], t[p << 1 | 1]) + d[p];
  }
  void push(long long p) {
    for (long long s = h; s > 0; --s) {
      long long i = p >> s;
      if (d[i] != 0) {
        apply(i << 1, d[i]);
        apply(i << 1 | 1, d[i]);
        d[i] = 0;
      }
    }
  }
  void inc(long long l, long long r, long long val) {
    if (l >= r) return;
    l += n, r += n;
    long long l0 = l, r0 = r;
    for (; l < r; l >>= 1, r >>= 1) {
      if (l & 1) apply(l++, val);
      if (r & 1) apply(--r, val);
    }
    build(l0);
    build(r0 - 1);
  }
  long long query(long long l, long long r) {
    if (l >= r) return 0;
    l += n, r += n;
    push(l), push(r - 1);
    long long ret = 0;
    while (l < r) {
      if (l & 1) {
        ret = max(ret, t[l++]);
      }
      if (r & 1) {
        ret = max(ret, t[--r]);
      }
      l >>= 1, r >>= 1;
    }
    return ret;
  }
};
int32_t main() {
  long long n;
  cin >> n;
  vector<long long> a(2 * n);
  for (long long i = 0; i < n; ++i) {
    cin >> a[i];
    a[i + n] = a[i];
  }
  stack<pair<long long, long long>> s;
  vector<long long> nxt(2 * n, 2 * n), prev(n << 1, -1);
  for (long long i = 0; i < 2 * n; ++i) {
    while (!s.empty() && a[i] < s.top().first) s.pop();
    if (!s.empty()) prev[i] = s.top().second;
    s.push({a[i], i});
  }
  s = stack<pair<long long, long long>>();
  for (long long i = 2 * n - 1; i >= 0; --i) {
    while (!s.empty() && a[i] < s.top().first) s.pop();
    if (!s.empty()) nxt[i] = s.top().second;
    s.push({a[i], i});
  }
  vector<long long> h(2 * n);
  segtree T = segtree(h);
  for (long long i = 0; i < n; ++i) {
    T.inc(i + 1, min(n, nxt[i]), 1);
    T.inc(prev[i] + 1, i, 1);
  }
  long long hmin = INT_MAX, shift = 0;
  for (long long s = 0; s < n; ++s) {
    long long hs = T.query(s, s + n);
    if (hmin > hs) {
      hmin = hs;
      shift = s;
    }
    T.inc(s + 1, min(s + n, nxt[s]), -1);
    if (s < n) {
      T.inc(prev[s + n] + 1, s + n, 1);
      if (prev[s + n] >= s + 1) {
        long long p = T.query(prev[s + n], prev[s + n] + 1);
        T.inc(s + n, s + n + 1, 1 + p);
      }
    }
  }
  cout << hmin + 1 << " " << shift;
}