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;
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
const long long maxn = 4e5 + 5, N = 1e6 + 20, SQ = 450, base = 800287,
                mod = 1e9 + 7, INF = 1e18 + 5, lg = 20;
const long double eps = 1e-4;
struct node {
  long long mx, lazy;
};
stack<long long> st;
node seg[4 * maxn];
long long n, a[maxn], L[maxn], R[maxn];
void build(long long v = 1, long long s = 0, long long e = 2 * n) {
  if (e - s == 1) {
    long long x = (s < n ? 0 : -INF);
    seg[v].mx = x;
    seg[v].lazy = 0;
    return;
  }
  build(2 * v, s, (s + e) / 2);
  build(2 * v + 1, (s + e) / 2, e);
  seg[v].lazy = 0;
  seg[v].mx = max(seg[2 * v].mx, seg[2 * v + 1].mx);
}
void find_L() {
  for (long long i = 0; i < 2 * n; ++i) {
    while ((long long)st.size() && a[st.top()] > a[i]) {
      st.pop();
    }
    L[i] = ((long long)st.size() ? st.top() : -1);
    st.push(i);
  }
  while ((long long)st.size()) {
    st.pop();
  }
}
void find_R() {
  for (long long i = 2 * n - 1; i >= 0; --i) {
    while ((long long)st.size() && a[st.top()] > a[i]) {
      st.pop();
    }
    R[i] = ((long long)st.size() ? st.top() : 2 * n);
    st.push(i);
  }
  while ((long long)st.size()) {
    st.pop();
  }
}
inline void shift(long long v) {
  seg[2 * v].mx += seg[v].lazy;
  seg[2 * v + 1].mx += seg[v].lazy;
  seg[2 * v].lazy += seg[v].lazy;
  seg[2 * v + 1].lazy += seg[v].lazy;
  seg[v].lazy = 0;
}
void add(long long l, long long r, long long x, long long v = 1,
         long long s = 0, long long e = 2 * n) {
  if (l >= e || s >= r) {
    return;
  }
  if (l <= s && e <= r) {
    seg[v].mx += x;
    seg[v].lazy += x;
    return;
  }
  shift(v);
  add(l, r, x, 2 * v, s, (s + e) / 2);
  add(l, r, x, 2 * v + 1, (s + e) / 2, e);
  seg[v].mx = max(seg[2 * v].mx, seg[2 * v + 1].mx);
}
void modify(long long p, long long x, long long v = 1, long long s = 0,
            long long e = 2 * n) {
  if (e - s == 1) {
    seg[v].mx = x;
    return;
  }
  shift(v);
  if (p < (s + e) / 2) {
    modify(p, x, 2 * v, s, (s + e) / 2);
  } else {
    modify(p, x, 2 * v + 1, (s + e) / 2, e);
  }
  seg[v].mx = max(seg[2 * v].mx, seg[2 * v + 1].mx);
}
long long get(long long p, long long v = 1, long long s = 0,
              long long e = 2 * n) {
  if (e - s == 1) {
    return seg[v].mx;
  }
  shift(v);
  long long res;
  if (p < (s + e) / 2) {
    res = get(p, 2 * v, s, (s + e) / 2);
  } else {
    res = get(p, 2 * v + 1, (s + e) / 2, e);
  }
  seg[v].mx = max(seg[2 * v].mx, seg[2 * v + 1].mx);
  return res;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (long long i = 0; i < n; ++i) {
    cin >> a[i];
    a[i + n] = a[i];
  }
  build();
  find_L();
  find_R();
  for (long long i = 0; i < n; ++i) {
    add(L[i] + 1, i, 1);
    add(i + 1, R[i], 1);
  }
  long long res = INF, id = -1;
  for (long long i = 0; i < n; ++i) {
    if (seg[1].mx < res) {
      res = seg[1].mx;
      id = i;
    }
    long long val = (L[i + n] <= i ? 0 : get(L[i + n]) + 1);
    add(i + 1, R[i], -1);
    add(L[i + n] + 1, i + n, 1);
    modify(i, -INF), modify(i + n, val);
  }
  cout << res + 1 << ' ' << id << '\n';
}