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 N = 400010;
int n;
int a[N];
int T[N << 2];
void build(int x, int l, int r) {
  if (l == r) {
    T[x] = a[r];
    return;
  }
  build(x + x, l, ((l + r) >> 1));
  build(x + x + 1, ((l + r) >> 1) + 1, r);
  T[x] = min(T[x + x], T[x + x + 1]);
}
int find_left(int x, int l, int r, int u, int v, int val) {
  if (l > v || r < u || T[x] >= val) return -1;
  if (l == r) return r;
  int fl = find_left(x + x, l, ((l + r) >> 1), u, v, val);
  if (fl != -1) return fl;
  return find_left(x + x + 1, ((l + r) >> 1) + 1, r, u, v, val);
}
int find_right(int x, int l, int r, int u, int v, int val) {
  if (l > v || r < u || T[x] >= val) return -1;
  if (l == r) return r;
  int fr = find_right(x + x + 1, ((l + r) >> 1) + 1, r, u, v, val);
  if (fr != -1) return fr;
  return find_right(x + x, l, ((l + r) >> 1), u, v, val);
}
int depth[N << 2];
int lazy[N << 3];
void toggle(int x) {
  depth[x] += lazy[x];
  lazy[x + x] += lazy[x];
  lazy[x + x + 1] += lazy[x];
  lazy[x] = 0;
}
void upd(int x, int l, int r, int u, int v, int val) {
  if (u > v) return;
  toggle(x);
  if (l > v || r < u) return;
  if (l >= u && r <= v) {
    lazy[x] += val;
    toggle(x);
    return;
  }
  upd(x + x, l, ((l + r) >> 1), u, v, val);
  upd(x + x + 1, ((l + r) >> 1) + 1, r, u, v, val);
  depth[x] = max(depth[x + x], depth[x + x + 1]);
}
int query(int x, int l, int r, int pos) {
  if (l == r) return depth[x] + lazy[x];
  if (pos <= ((l + r) >> 1))
    return query(x + x, l, ((l + r) >> 1), pos) + lazy[x];
  return query(x + x + 1, ((l + r) >> 1) + 1, r, pos) + lazy[x];
}
int pos[N];
int ls[N], rs[N];
stack<int> st;
int height[N + N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  int m = n + n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    pos[a[i]] = i;
    a[i + n] = a[i];
  }
  for (int i = 1; i <= n; ++i) {
    while (!st.empty() && a[st.top()] > a[i]) {
      rs[st.top()] = i;
      st.pop();
    }
    if (st.empty())
      ls[i] = -1;
    else
      ls[i] = st.top();
    st.push(i);
  }
  while (!st.empty()) {
    rs[st.top()] = -1;
    st.pop();
  }
  height[pos[1]] = 1;
  for (int i = 2; i <= n; ++i) {
    int p = pos[i];
    int par = ls[p];
    if (par == -1) par = rs[p];
    if (rs[p] != -1 && a[rs[p]] > a[par]) par = rs[p];
    height[p] = height[par] + 1;
  }
  for (int i = 1; i <= n; ++i) {
    upd(1, 1, m, i, i, height[i]);
  }
  build(1, 1, m);
  pair<int, int> ans = make_pair(depth[1], 0);
  for (int i = 1; i < n; ++i) {
    int val = a[i];
    {
      int pos = find_left(1, 1, m, i, i + n, val);
      if (pos == -1) pos = i + n;
      upd(1, 1, m, i + 1, pos - 1, -1);
      upd(1, 1, m, i, i, -N - N);
    }
    {
      int pos = find_right(1, 1, m, i, i + n, val);
      if (pos != -1)
        upd(1, 1, m, pos + 1, i + n - 1, 1);
      else
        upd(1, 1, m, i + 1, i + n - 1, 1);
      if (pos != -1)
        upd(1, 1, m, i + n, i + n, query(1, 1, m, pos) + 1);
      else
        upd(1, 1, m, i + n, i + n, 1);
    }
    ans = min(ans, make_pair(depth[1], i));
  }
  cout << ans.first << " " << ans.second << endl;
  return 0;
}